Skip to content

Commit 97e6233

Browse files
authored
chore: migrate to eslint flat configs (#35590)
1 parent 92b783d commit 97e6233

File tree

170 files changed

+428
-427
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+428
-427
lines changed

.eslintrc.json

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
/typings @microsoft/fluentui-react-build
4343

4444
#### Root Build files
45-
/.eslintrc.* @microsoft/fluentui-react-build
4645
/.yarnrc @microsoft/fluentui-react-build
4746
/.gitattributes @microsoft/fluentui-react-build
4847
/.gitignore @microsoft/fluentui-react-build
@@ -400,8 +399,9 @@ packages/react-experiments/src/components/TileList @ThomasMichon
400399
**/just.config.ts @microsoft/fluentui-react-build
401400
**/jest.config.js @microsoft/fluentui-react-build
402401
**/webpack.*.js @microsoft/fluentui-react-build
403-
**/.eslintrc.js @microsoft/fluentui-react-build
404-
**/.eslintrc.json @microsoft/fluentui-react-build
402+
**/eslint.config.js @microsoft/fluentui-react-build
403+
**/eslint.config.cjs @microsoft/fluentui-react-build
404+
**/eslint.config.mjs @microsoft/fluentui-react-build
405405
**/tsconfig.json @microsoft/fluentui-react-build
406406
**/tsconfig.lib.json @microsoft/fluentui-react-build
407407
**/tsconfig.spec.json @microsoft/fluentui-react-build
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "chore: migrate to new eslint flat config format",
4+
"packageName": "@fluentui/tokens",
5+
"email": "vgenaev@gmail.com",
6+
"dependentChangeType": "none"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "chore: update verify-packaging script to exclude root eslintrc file",
4+
"packageName": "@fluentui/web-components",
5+
"email": "vgenaev@gmail.com",
6+
"dependentChangeType": "none"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "chore: migrate to new eslint flat config format",
4+
"packageName": "@fluentui/webpack-utilities",
5+
"email": "vgenaev@gmail.com",
6+
"dependentChangeType": "none"
7+
}

eslint.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// @ts-check
2+
3+
/**
4+
* Root ESLint configuration for Fluent UI monorepo
5+
*
6+
* - Root config provides base rules for react-components (v9) packages
7+
* - v9 packages extend this config and add overrides as needed
8+
* - v8 and other legacy packages maintain their own independent configs
9+
*/
10+
11+
const fluentPlugin = require('@fluentui/eslint-plugin');
12+
13+
module.exports = fluentPlugin.configs['flat/react'];

nx.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,9 @@
6868
"executor": "nx:run-commands",
6969
"dependsOn": ["build"],
7070
"cache": true,
71-
"inputs": [
72-
"default",
73-
"{workspaceRoot}/.eslintrc.json",
74-
"{workspaceRoot}/.eslintignore",
75-
"{workspaceRoot}/eslint.config.js"
76-
],
71+
"inputs": ["default", "{workspaceRoot/eslint.config.js}"],
7772
"options": {
78-
"command": "cross-env ESLINT_USE_FLAT_CONFIG=false eslint src"
73+
"command": "eslint src"
7974
}
8075
},
8176
"format": {

packages/codemods/.eslintrc.json

Lines changed: 0 additions & 23 deletions
This file was deleted.

packages/codemods/eslint.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// @ts-check
2+
const fluentPlugin = require('@fluentui/eslint-plugin');
3+
4+
/** @type {import("eslint").Linter.Config[]} */
5+
module.exports = [
6+
...fluentPlugin.configs['flat/node'],
7+
...fluentPlugin.configs['flat/react-legacy'],
8+
{
9+
files: ['./src/**/*.{ts,tsx,js}'],
10+
rules: {
11+
'@typescript-eslint/naming-convention': 'off',
12+
'@typescript-eslint/explicit-module-boundary-types': 'off',
13+
},
14+
},
15+
{
16+
files: ['./src/codeMods/tests/mock/**/*.{ts,tsx}'],
17+
rules: {
18+
'@typescript-eslint/ban-ts-comment': 'off',
19+
'@typescript-eslint/no-explicit-any': 'off',
20+
'@typescript-eslint/naming-convention': 'off',
21+
'import/no-extraneous-dependencies': 'off',
22+
'@typescript-eslint/no-deprecated': 'off',
23+
},
24+
},
25+
];
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @ts-check
22

3-
const fluentPlugin = require('@fluentui/eslint-plugin');
3+
const rootConfig = require('../../../../eslint.config.js');
44

5-
module.exports = [...fluentPlugin.configs['flat/react']];
5+
module.exports = [...rootConfig];

0 commit comments

Comments
 (0)