Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate to eslint v9 #33527

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d4308f0
chore: update eslint and related deps, dedupe
mainframev Dec 27, 2024
54fe5bc
chore(nx): set ESLINT_USE_FLAT_CONFIG=false
mainframev Dec 30, 2024
4b58004
chore(eslint-plugin): remove archived deprecated plugin
mainframev Dec 30, 2024
e2b0b9a
chore: replace old deprecated plugin suppressions
mainframev Dec 30, 2024
ffad241
chore(lint-staged): use eslint.config.js
mainframev Dec 30, 2024
7b532fd
chore(lint-staged): use legacy eslint
mainframev Dec 30, 2024
bf8e26c
chore(workspace-plugin): use legacy type until flat config migration
mainframev Dec 30, 2024
ded933b
chore: update playwright eslint config
mainframev Dec 30, 2024
2be3e86
chore(web-components): remove eslint errors after upgrading playwrigh…
mainframev Dec 31, 2024
71ce5ad
chore(react-calendar-compat): suppress react-hooks eslint errors
mainframev Dec 31, 2024
a492346
chore(react): suppress react-hooks errors in CalendarYear
mainframev Dec 31, 2024
b2d0d9b
chore(react): override ts-eslint no-deprecated to warn
mainframev Dec 31, 2024
02d281c
chore: suppress and remove eslint errors for deprecated errors and re…
mainframev Dec 31, 2024
8c57a18
chore: update packages .eslintrc files
mainframev Dec 31, 2024
8207aa3
chore(pr-deploy-site): migrate to flat config
mainframev Dec 31, 2024
8b1b31c
chore(public-docsite-setup): migrate to flat config
mainframev Dec 31, 2024
1433793
chore: fix format
mainframev Dec 31, 2024
6c1e7c1
chore(eslint-plugin-react): update eslint deps
mainframev Jan 2, 2025
8e9d334
chore: update change files
mainframev Jan 2, 2025
e1a4584
chore(gulp): use LegacyESLint
mainframev Jan 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 9 additions & 2 deletions apps/chart-docsite/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
"rules": {
Copy link
Collaborator

@fabricteam fabricteam Dec 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵🏾‍♀️ visual regressions to review in the fluentuiv8 Visual Regression Report

react-charting-LineChart 1 screenshots
Image Name Diff(in Pixels) Image Type
react-charting-LineChart.Gaps.chromium.png 1 Changed

Copy link
Collaborator

@fabricteam fabricteam Dec 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵🏾‍♀️ visual regressions to review in the fluentuiv9 Visual Regression Report

Avatar Converged 1 screenshots
Image Name Diff(in Pixels) Image Type
Avatar Converged.badgeMask.chromium.png 5 Changed
Drawer 2 screenshots
Image Name Diff(in Pixels) Image Type
Drawer.Full Overlay RTL.chromium.png 1167 Changed
Drawer.Full Overlay High Contrast.chromium.png 2247 Changed

"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/jsx-no-bind": "off",
"deprecation/deprecation": "off",
"import/no-extraneous-dependencies": ["error", { "packageDir": [".", "../.."] }]
"import/no-extraneous-dependencies": ["error", { "packageDir": [".", "../.."] }],
"overrides": [
{
"files": ["src/**/*.{tsx,ts}"],
"rules": {
"@typescript-eslint/no-deprecated": "off"
}
}
]
}
}
2 changes: 1 addition & 1 deletion apps/perf-test-react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"scripts": {
"bundle": "just-scripts perf-test:bundle",
"lint": "just-scripts lint",
"lint": "ESLINT_USE_FLAT_CONFIG=false just-scripts lint",
"just": "just-scripts",
"clean": "just-scripts clean",
"code-style": "just-scripts code-style",
Expand Down
2 changes: 1 addition & 1 deletion apps/perf-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"scripts": {
"bundle": "just-scripts perf-test:bundle",
"lint": "just-scripts lint",
"lint": "ESLINT_USE_FLAT_CONFIG=false just-scripts lint",
"just": "just-scripts",
"clean": "just-scripts clean",
"code-style": "just-scripts code-style",
Expand Down
21 changes: 0 additions & 21 deletions apps/pr-deploy-site/.eslintrc.json

This file was deleted.

29 changes: 29 additions & 0 deletions apps/pr-deploy-site/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const js = require('@eslint/js');
const sdl = require('@microsoft/eslint-plugin-sdl');
const es = require('eslint-plugin-es');
const { FlatCompat } = require('@eslint/eslintrc');

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

module.exports = [
...compat.extends('plugin:@fluentui/eslint-plugin/node'),
...sdl.configs.recommended,
{
files: ['**/pr-deploy-site.js'],
plugins: {
es,
},

rules: {
curly: 'off',
'no-var': 'off',
'vars-on-top': 'off',
'prefer-arrow-callback': 'off',
'no-restricted-globals': 'off',
},
},
];
2 changes: 1 addition & 1 deletion apps/pr-deploy-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"clean": "just-scripts clean",
"generate:site": "just-scripts generate:site",
"lint": "eslint --ext .js,.ts --cache .",
"lint": "eslint --cache .",
"type-check": "tsc -p . --noEmit"
},
"license": "MIT",
Expand Down
1 change: 0 additions & 1 deletion apps/public-docsite-resources/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/member-ordering": "off",
"deprecation/deprecation": "off",
"no-restricted-globals": "off"
}
}
2 changes: 1 addition & 1 deletion apps/public-docsite-resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"build": "just-scripts build",
"prebundle": "yarn build",
"bundle": "just-scripts bundle",
"lint": "eslint --ext .js,.ts,.tsx ./src",
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint --ext .js,.ts,.tsx ./src",
"just": "just-scripts",
"clean": "just-scripts clean",
"code-style": "just-scripts code-style",
Expand Down
11 changes: 9 additions & 2 deletions apps/public-docsite-v9/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/jsx-no-bind": "off",
"deprecation/deprecation": "off",
"import/no-extraneous-dependencies": ["error", { "packageDir": [".", "../.."] }]
}
},
"overrides": [
{
"files": ["src/**/*.{tsx,ts}"],
"rules": {
"@typescript-eslint/no-deprecated": "off"
}
}
]
}
2 changes: 1 addition & 1 deletion apps/public-docsite-v9/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"clean": "just-scripts clean",
"code-style": "just-scripts code-style",
"just": "just-scripts",
"lint": "just-scripts lint",
"lint": "ESLINT_USE_FLAT_CONFIG=false just-scripts lint",
"type-check": "just-scripts type-check",
"start": "yarn storybook:docs",
"storybook": "storybook dev --port 3000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const AutoSizeForSmallViewport = () => {
<MenuPopover>
<MenuList>
{Array.from({ length: menuItemCount }, (_, i) => (
<MenuItem>Item {i}</MenuItem>
<MenuItem key={i}>Item {i}</MenuItem>
))}
</MenuList>
</MenuPopover>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const CoverTargetForSmallViewport = () => {
<MenuPopover>
<MenuList>
{Array.from({ length: menuItemCount }, (_, i) => (
<MenuItem>Item {i}</MenuItem>
<MenuItem key={i}>Item {i}</MenuItem>
))}
</MenuList>
</MenuPopover>
Expand Down
3 changes: 1 addition & 2 deletions apps/public-docsite/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"root": true,
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"deprecation/deprecation": "off",
"import/no-webpack-loader-syntax": "off", // ok in this project
"import/no-webpack-loader-syntax": "off",
"prefer-const": "off",
"react/jsx-no-bind": "off",
"no-restricted-globals": "off"
Expand Down
2 changes: 1 addition & 1 deletion apps/public-docsite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"scripts": {
"prebundle": "just-scripts build",
"bundle": "just-scripts bundle",
"lint": "just-scripts lint",
"lint": "ESLINT_USE_FLAT_CONFIG=false just-scripts lint",
"just": "just-scripts",
"clean": "just-scripts clean",
"code-style": "just-scripts code-style",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const FabricIconsPage: React.FunctionComponent<IStylesPageProps> = props
};

function _otherSections(platform: Platforms): IPageSectionProps<Platforms>[] {
// eslint-disable-next-line react-hooks/rules-of-hooks
const [selectedItem, setSelectedItem] = React.useState('react-font');
switch (platform) {
case 'web':
Expand Down
2 changes: 1 addition & 1 deletion apps/react-18-tests-v8/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"format:check": "yarn format -c",
"e2e": "cypress run --component",
"e2e:local": "cypress open --component",
"lint": "eslint --ext .js,.ts,.tsx ./src",
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint --ext .js,.ts,.tsx ./src",
"test": "jest --passWithNoTests",
"start": "webpack-dev-server --mode=development"
},
Expand Down
2 changes: 1 addition & 1 deletion apps/react-18-tests-v9/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"scripts": {
"type-check": "just-scripts type-check",
"lint": "eslint --ext .js,.ts,.tsx ./src",
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint --ext .js,.ts,.tsx ./src",
"test": "jest --passWithNoTests",
"format": "prettier -w . --ignore-path ../.prettierignore",
"format:check": "yarn format -c",
Expand Down
2 changes: 1 addition & 1 deletion apps/ssr-tests-v9/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"scripts": {
"clean": "just-scripts clean",
"code-style": "just-scripts code-style",
"lint": "just-scripts lint",
"lint": "ESLINT_USE_FLAT_CONFIG=false just-scripts lint",
"storybook": "storybook dev",
"test": "jest --passWithNoTests",
"type-check": "just-scripts type-check",
Expand Down
1 change: 0 additions & 1 deletion apps/theming-designer/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"root": true,
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"deprecation/deprecation": "off",
"prefer-const": "off",
"no-restricted-globals": "off"
}
Expand Down
2 changes: 1 addition & 1 deletion apps/theming-designer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"scripts": {
"bundle": "just-scripts build && just-scripts bundle",
"lint": "just-scripts lint",
"lint": "ESLINT_USE_FLAT_CONFIG=false just-scripts lint",
"just": "just-scripts",
"clean": "just-scripts clean",
"code-style": "just-scripts code-style",
Expand Down
11 changes: 9 additions & 2 deletions apps/vr-tests-react-components/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/jsx-no-bind": "off",
"deprecation/deprecation": "off",
"import/no-extraneous-dependencies": ["error", { "packageDir": [".", "../.."] }],
"@nx/workspace-no-restricted-globals": "off"
}
},
"overrides": [
{
"files": ["**/*.{ts,tsx}"],
"rules": {
"@typescript-eslint/no-deprecated": "off"
}
}
]
}
2 changes: 1 addition & 1 deletion apps/vr-tests-react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build-storybook": "storybook build -o dist/storybook",
"clean": "just-scripts clean",
"format": "prettier . -w --ignore-path ../../.prettierignore",
"lint": "just-scripts lint",
"lint": "ESLINT_USE_FLAT_CONFIG=false just-scripts lint",
"start": "storybook dev",
"test": "just-scripts test",
"type-check": "tsc -p . --noEmit --baseUrl .",
Expand Down
2 changes: 1 addition & 1 deletion apps/vr-tests-web-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"build-storybook": "storybook build -o dist/storybook",
"format": "prettier . -w --ignore-path ../../.prettierignore",
"lint": "eslint src --ext .ts,.tsx",
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint src --ext .ts,.tsx",
"start": "storybook dev",
"type-check": "tsc -p . --baseUrl . --noEmit",
"test-vr": "storywright --browsers chromium --url dist/storybook --destpath dist/screenshots --waitTimeScreenshot 500 --concurrency 4 --headless true"
Expand Down
1 change: 0 additions & 1 deletion apps/vr-tests/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/jsx-no-bind": "off",
"deprecation/deprecation": "off",
"import/no-extraneous-dependencies": ["error", { "packageDir": [".", "../.."] }],
"no-restricted-globals": "off"
}
Expand Down
2 changes: 1 addition & 1 deletion apps/vr-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"clean": "just-scripts clean",
"code-style": "just-scripts code-style",
"just": "just-scripts",
"lint": "just-scripts lint",
"lint": "ESLINT_USE_FLAT_CONFIG=false just-scripts lint",
"start": "storybook dev -p 3000",
"type-check": "tsc -p . --noEmit --baseUrl .",
"test-vr": "storywright --browsers chromium --url dist/storybook --destpath dist/screenshots --waitTimeScreenshot 500 --concurrency 4 --headless true"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: use eslint with USE_ESLINT_FLAT_CONFIG=false",
"packageName": "@fluentui/api-docs",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: use eslint with USE_ESLINT_FLAT_CONFIG=false",
"packageName": "@fluentui/azure-themes",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: remove deprecation plugin in favor of ts-eslint/no-deprecated",
"packageName": "@fluentui/codemods",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: use eslint with USE_ESLINT_FLAT_CONFIG=false",
"packageName": "@fluentui/cra-template",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: use eslint with USE_ESLINT_FLAT_CONFIG=false",
"packageName": "@fluentui/date-time-utilities",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: use eslint with USE_ESLINT_FLAT_CONFIG=false",
"packageName": "@fluentui/dom-utilities",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: update eslint dependencies",
"packageName": "@fluentui/eslint-plugin",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: update eslint dependencies",
"packageName": "@fluentui/eslint-plugin-react-components",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: use eslint with USE_ESLINT_FLAT_CONFIG=false",
"packageName": "@fluentui/example-data",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: use eslint with USE_ESLINT_FLAT_CONFIG=false",
"packageName": "@fluentui/fluent2-theme",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: remove deprecation plugin if favor of ts-eslint/no-deprecated",
"packageName": "@fluentui/font-icons-mdl2",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: remove deprecation plugin in favor of ts-eslint/no-deprecated",
"packageName": "@fluentui/foundation-legacy",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: use eslint with USE_ESLINT_FLAT_CONFIG=false",
"packageName": "@fluentui/jest-serializer-merge-styles",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: remove deprecation plugin in favor of ts-eslint/no-deprecated",
"packageName": "@fluentui/keyboard-key",
"email": "[email protected]",
"dependentChangeType": "none"
}
Loading
Loading