Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/vr-tests/src/stories/PivotOverflow.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ export default {
.executeScript('document.querySelector(".testWrapper").style.width = "750px"')
.snapshot('Wide', { cropTo: '.testWrapper' })
.executeScript('document.querySelector(".testWrapper").style.width = "250px"')
.snapshot('Narrow', { cropTo: '.testWrapper' })
.click('.ms-Pivot-overflowMenuButton')
.wait(2500)
.snapshot('Narrow - Overflow menu open', { cropTo: '.testWrapper' })
.click('.ms-Pivot-linkInMenu[data-last-tab]')
.snapshot('Narrow - Last tab selected', { cropTo: '.testWrapper' })
.click('.ms-Pivot-overflowMenuButton')
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// @ts-check

const fluentPlugin = require('@fluentui/eslint-plugin');

module.exports = [...fluentPlugin.configs['flat/react']];
42 changes: 21 additions & 21 deletions tools/workspace-plugin/src/generators/react-library/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ describe('react-library generator', () => {
Array [
"project.json",
".babelrc.json",
".eslintrc.json",
".swcrc",
"LICENSE",
"README.md",
"config",
"docs",
"eslint.config.js",
"etc",
"jest.config.js",
"package.json",
Expand Down Expand Up @@ -172,7 +172,7 @@ describe('react-library generator', () => {
"src",
".storybook",
"README.md",
".eslintrc.json",
"eslint.config.js",
"tsconfig.json",
"tsconfig.lib.json",
"package.json",
Expand Down Expand Up @@ -213,24 +213,24 @@ describe('react-library generator', () => {
"
`);

expect(readJson(tree, `${stories.root}/.eslintrc.json`)).toMatchInlineSnapshot(`
Object {
"extends": Array [
"plugin:@fluentui/eslint-plugin/react",
],
"root": true,
"rules": Object {
"import/no-extraneous-dependencies": Array [
"error",
Object {
"packageDir": Array [
".",
"../../../../",
],
},
],
const eslintConfig = tree.read(`${stories.root}/eslint.config.js`, 'utf-8');
expect(eslintConfig).toMatchInlineSnapshot(`
"// @ts-check

const fluentPlugin = require('@fluentui/eslint-plugin');

module.exports = [
...fluentPlugin.configs['flat/react'],
{
rules: {
'import/no-extraneous-dependencies': [
'error',
{ packageDir: ['.', '../../../../'] },
],
},
},
}
];
"
`);

// global updates
Expand Down Expand Up @@ -264,12 +264,12 @@ describe('react-library generator', () => {
Array [
"project.json",
".babelrc.json",
".eslintrc.json",
".swcrc",
"LICENSE",
"README.md",
"config",
"docs",
"eslint.config.js",
"etc",
"jest.config.js",
"package.json",
Expand All @@ -294,7 +294,7 @@ describe('react-library generator', () => {
"src",
".storybook",
"README.md",
".eslintrc.json",
"eslint.config.js",
"tsconfig.json",
"tsconfig.lib.json",
"package.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,25 +233,25 @@ describe('split-library-in-two generator', () => {
],
}
`);
expect(readJson(tree, `${storiesConfig.root}/.eslintrc.json`)).toMatchInlineSnapshot(`
Object {
"extends": Array [
"plugin:@fluentui/eslint-plugin/react",
],
"root": true,
"rules": Object {
"import/no-extraneous-dependencies": Array [
"error",
Object {
"packageDir": Array [
".",
"../../../../",
],
},
],
expect(tree.read(`${storiesConfig.root}/eslint.config.js`, 'utf-8')).toMatchInlineSnapshot(`
"// @ts-check

const fluentPlugin = require('@fluentui/eslint-plugin');

module.exports = [
...fluentPlugin.configs['flat/react'],
{
rules: {
'import/no-extraneous-dependencies': [
'error',
{ packageDir: ['.', '../../../../'] },
],
},
},
}
];
"
`);

expect(tree.read(`${storiesConfig.root}/README.md`, 'utf-8')).toMatchInlineSnapshot(`
"# @proj/react-hello-stories

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,22 @@ function makeStoriesLibrary(tree: Tree, options: Options, logger: CLIOutput) {
},
},
publicApi: stripIndents`export {}`,
eslintrc: {
extends: ['plugin:@fluentui/eslint-plugin/react'],
root: true,
rules: {
'import/no-extraneous-dependencies': ['error', { packageDir: ['.', options.projectOffsetFromRoot.updated] }],
},
eslintConfig: `// @ts-check

const fluentPlugin = require('@fluentui/eslint-plugin');

module.exports = [
...fluentPlugin.configs['flat/react'],
{
rules: {
'import/no-extraneous-dependencies': [
'error',
{ packageDir: ['.', '${options.projectOffsetFromRoot.updated}'] },
],
},
},
];
`,
tsconfig: {
root: {
...options.oldContent.tsConfig,
Expand Down Expand Up @@ -361,7 +370,7 @@ function makeStoriesLibrary(tree: Tree, options: Options, logger: CLIOutput) {

tree.write(joinPathFragments(newProjectRoot, 'README.md'), templates.readme);
tree.write(joinPathFragments(newProjectSourceRoot, 'index.ts'), templates.publicApi);
writeJson(tree, joinPathFragments(newProjectRoot, '.eslintrc.json'), templates.eslintrc);
tree.write(joinPathFragments(newProjectRoot, 'eslint.config.js'), templates.eslintConfig);
writeJson(tree, joinPathFragments(newProjectRoot, 'tsconfig.json'), templates.tsconfig.root);
writeJson(tree, joinPathFragments(newProjectRoot, 'tsconfig.lib.json'), templates.tsconfig.lib);
writeJson(tree, joinPathFragments(newProjectRoot, 'package.json'), templates.packageJson);
Expand Down
Loading