diff --git a/change/@fluentui-eslint-plugin-912d0763-d6cf-4fec-beac-2843c49fc62d.json b/change/@fluentui-eslint-plugin-912d0763-d6cf-4fec-beac-2843c49fc62d.json new file mode 100644 index 00000000000000..34f007fdf89deb --- /dev/null +++ b/change/@fluentui-eslint-plugin-912d0763-d6cf-4fec-beac-2843c49fc62d.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: migrate to @typescript/eslint v6", + "packageName": "@fluentui/eslint-plugin", + "email": "vgenaev@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-tabster-b0807315-3821-4fdb-a2ac-25c10dd1d266.json b/change/@fluentui-react-tabster-b0807315-3821-4fdb-a2ac-25c10dd1d266.json new file mode 100644 index 00000000000000..dd3cbbf3081061 --- /dev/null +++ b/change/@fluentui-react-tabster-b0807315-3821-4fdb-a2ac-25c10dd1d266.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: suppress @typescript-eslint/naming-convention report on TabsterTypes_6_0_1_DoNotUse", + "packageName": "@fluentui/react-tabster", + "email": "vgenaev@gmail.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-web-components-8db325bc-acef-4d3a-af10-591cfd00cc42.json b/change/@fluentui-web-components-8db325bc-acef-4d3a-af10-591cfd00cc42.json new file mode 100644 index 00000000000000..8e57bf458219ed --- /dev/null +++ b/change/@fluentui-web-components-8db325bc-acef-4d3a-af10-591cfd00cc42.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: suppress @typescript-eslint/no_unsafe_declaration-merging reports", + "packageName": "@fluentui/web-components", + "email": "vgenaev@gmail.com", + "dependentChangeType": "none" +} diff --git a/package.json b/package.json index b63ddcfbd2073f..54c00ea0c93836 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "@phenomnomnominal/tsquery": "6.1.3", "@playwright/test": "1.44.0", "@react-native/babel-preset": "0.73.21", - "@rnx-kit/eslint-plugin": "0.4.2", + "@rnx-kit/eslint-plugin": "0.5.3", "@rollup/plugin-node-resolve": "13.3.0", "@storybook/addon-a11y": "6.5.15", "@storybook/addon-actions": "6.5.15", @@ -142,7 +142,7 @@ "@types/doctrine": "0.0.5", "@types/ejs": "3.1.2", "@types/enzyme": "3.10.7", - "@types/eslint": "7.2.13", + "@types/eslint": "8.56.10", "@types/express": "4.17.21", "@types/fs-extra": "8.0.1", "@types/glob": "7.1.1", @@ -183,9 +183,10 @@ "@types/webpack-hot-middleware": "2.25.9", "@types/yargs": "13.0.11", "@types/yargs-unparser": "2.0.1", - "@typescript-eslint/eslint-plugin": "5.62.0", - "@typescript-eslint/parser": "5.62.0", - "@typescript-eslint/utils": "5.62.0", + "@typescript-eslint/eslint-plugin": "6.21.0", + "@typescript-eslint/parser": "6.21.0", + "@typescript-eslint/rule-tester": "6.21.0", + "@typescript-eslint/utils": "6.21.0", "@wojtekmaj/enzyme-adapter-react-17": "0.6.7", "ajv": "8.4.0", "autoprefixer": "10.2.1", @@ -223,20 +224,20 @@ "enzyme-to-json": "3.6.2", "esbuild": "0.20.1", "esbuild-loader": "4.1.0", - "eslint": "7.32.0", + "eslint": "8.57.0", "eslint-config-airbnb": "18.2.1", "eslint-config-prettier": "8.3.0", - "eslint-import-resolver-typescript": "2.7.1", - "eslint-plugin-deprecation": "1.6.0", + "eslint-import-resolver-typescript": "3.6.1", + "eslint-plugin-deprecation": "2.0.0", "eslint-plugin-es": "4.1.0", "eslint-plugin-import": "2.29.1", - "eslint-plugin-jest": "26.9.0", - "eslint-plugin-jsdoc": "48.2.0", - "eslint-plugin-jsx-a11y": "6.4.1", + "eslint-plugin-jest": "28.6.0", + "eslint-plugin-jsdoc": "48.7.0", + "eslint-plugin-jsx-a11y": "6.9.0", "eslint-plugin-playwright": "0.15.3", "eslint-plugin-react": "7.26.0", "eslint-plugin-react-compiler": "0.0.0-experimental-a97cca1-20240529", - "eslint-plugin-react-hooks": "4.3.0", + "eslint-plugin-react-hooks": "4.6.2", "express": "4.19.2", "extract-comments": "1.1.0", "file-loader": "6.2.0", @@ -374,11 +375,11 @@ }, "resolutions": { "@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.0c3f3b7.0", - "@typescript-eslint/eslint-plugin": "5.62.0", - "@typescript-eslint/parser": "5.62.0", - "@typescript-eslint/utils": "5.62.0", + "@typescript-eslint/eslint-plugin": "6.21.0", + "@typescript-eslint/parser": "6.21.0", + "@typescript-eslint/utils": "6.21.0", "@types/jest-axe/axe-core": "4.7.2", - "eslint": "7.32.0", + "eslint": "8.57.0", "@mdx-js/loader/loader-utils": "~2.0.4", "swc-loader": "^0.2.6", "prettier": "2.8.8", diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index eed68872a4ca2f..67fcf1e9006470 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -15,27 +15,29 @@ }, "dependencies": { "@griffel/eslint-plugin": "^1.6.3", - "@rnx-kit/eslint-plugin": "^0.4.2", - "@typescript-eslint/eslint-plugin": "^5.62.0", - "@typescript-eslint/utils": "^5.62.0", - "@typescript-eslint/parser": "^5.62.0", + "@rnx-kit/eslint-plugin": "^0.5.3", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/utils": "^6.21.0", + "@typescript-eslint/rule-tester": "6.21.0", + "@typescript-eslint/parser": "^6.21.0", + "@typescript-eslint/type-utils": "^6.21.0", "eslint-config-airbnb": "^18.2.1", "eslint-config-prettier": "^8.3.0", - "eslint-import-resolver-typescript": "^2.7.1", - "eslint-plugin-deprecation": "^1.2.1", + "eslint-import-resolver-typescript": "^3.6.1", + "eslint-plugin-deprecation": "^2.0.0", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-jest": "^26.9.0", - "eslint-plugin-jsdoc": "^48.2.0", - "eslint-plugin-jsx-a11y": "^6.4.1", + "eslint-plugin-jest": "^28.6.0", + "eslint-plugin-jsdoc": "^48.7.0", + "eslint-plugin-jsx-a11y": "^6.9.0", "eslint-plugin-react": "^7.24.0", - "eslint-plugin-react-hooks": "^4.2.0", + "eslint-plugin-react-hooks": "^4.6.2", "fs-extra": "^8.1.0", "minimatch": "^3.1.2", "jju": "^1.4.0" }, "peerDependencies": { - "eslint": "^7.0.0", - "typescript": "^4.1.0" + "eslint": "^8.0.0", + "typescript": "^4.2.4" }, "files": [ "src" diff --git a/packages/eslint-plugin/src/rules/ban-context-export/index.js b/packages/eslint-plugin/src/rules/ban-context-export/index.js index 91757644a06a98..6b49ccd8cb094c 100644 --- a/packages/eslint-plugin/src/rules/ban-context-export/index.js +++ b/packages/eslint-plugin/src/rules/ban-context-export/index.js @@ -35,7 +35,7 @@ module.exports = createRule({ type: 'problem', docs: { description: 'Ban export of React context or context selector objects', - recommended: 'error', + recommended: 'recommended', }, messages: { nativeContext: '{{exportName}} should not be exported directly', diff --git a/packages/eslint-plugin/src/rules/ban-context-export/index.test.js b/packages/eslint-plugin/src/rules/ban-context-export/index.test.js index fe604d453394cd..b1f3f60ca7fa30 100644 --- a/packages/eslint-plugin/src/rules/ban-context-export/index.test.js +++ b/packages/eslint-plugin/src/rules/ban-context-export/index.test.js @@ -1,9 +1,9 @@ // @ts-check -const { ESLintUtils } = require('@typescript-eslint/utils'); +const { RuleTester } = require('@typescript-eslint/rule-tester'); const path = require('path'); const rule = require('./index'); -const ruleTester = new ESLintUtils.RuleTester({ +const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', parserOptions: { project: path.resolve(__dirname, './fixtures/ban-context-export/tsconfig.json'), diff --git a/packages/eslint-plugin/src/rules/ban-imports.js b/packages/eslint-plugin/src/rules/ban-imports.js index 2cfd0afc5e603e..9cb305cf22676b 100644 --- a/packages/eslint-plugin/src/rules/ban-imports.js +++ b/packages/eslint-plugin/src/rules/ban-imports.js @@ -31,7 +31,6 @@ module.exports = createRule({ type: 'problem', docs: { description: 'Ban importing (or re-exporting) certain identifiers from certain paths or modules.', - recommended: false, }, messages: { pathNotAllowed: "{{verb}} from '{{path}}' is not allowed{{message}}", diff --git a/packages/eslint-plugin/src/rules/ban-instanceof-html-element/index.js b/packages/eslint-plugin/src/rules/ban-instanceof-html-element/index.js index 91d60320518cf7..49277fb01e1ef6 100644 --- a/packages/eslint-plugin/src/rules/ban-instanceof-html-element/index.js +++ b/packages/eslint-plugin/src/rules/ban-instanceof-html-element/index.js @@ -13,7 +13,7 @@ module.exports = createRule({ type: 'problem', docs: { description: 'Ban usage of instanceof HTMLElement comparison', - recommended: 'error', + recommended: 'recommended', }, messages: { invalidBinaryExpression: 'instanceof {{right}} should be avoided, use isHTMLElement instead.', @@ -44,66 +44,66 @@ module.exports = createRule({ /** @type {HTMLElementConstructorName[]} */ const constructorNames = [ - 'HTMLElement', - 'HTMLAnchorElement', - 'HTMLAreaElement', - 'HTMLAudioElement', - 'HTMLBaseElement', - 'HTMLBodyElement', - 'HTMLBRElement', - 'HTMLButtonElement', - 'HTMLCanvasElement', - 'HTMLDataElement', - 'HTMLDataListElement', - 'HTMLDetailsElement', - 'HTMLDialogElement', - 'HTMLDivElement', - 'HTMLDListElement', - 'HTMLEmbedElement', - 'HTMLFieldSetElement', - 'HTMLFormElement', - 'HTMLHeadingElement', - 'HTMLHeadElement', - 'HTMLHRElement', - 'HTMLHtmlElement', - 'HTMLIFrameElement', - 'HTMLImageElement', - 'HTMLInputElement', - 'HTMLModElement', - 'HTMLLabelElement', - 'HTMLLegendElement', - 'HTMLLIElement', - 'HTMLLinkElement', - 'HTMLMapElement', - 'HTMLMetaElement', - 'HTMLMeterElement', - 'HTMLObjectElement', - 'HTMLOListElement', - 'HTMLOptGroupElement', - 'HTMLOptionElement', - 'HTMLOutputElement', - 'HTMLParagraphElement', - 'HTMLParamElement', - 'HTMLPreElement', - 'HTMLProgressElement', - 'HTMLQuoteElement', - 'HTMLSlotElement', - 'HTMLScriptElement', - 'HTMLSelectElement', - 'HTMLSourceElement', - 'HTMLSpanElement', - 'HTMLStyleElement', - 'HTMLTableElement', - 'HTMLTableColElement', - 'HTMLTableRowElement', - 'HTMLTableSectionElement', - 'HTMLTemplateElement', - 'HTMLTextAreaElement', - 'HTMLTimeElement', - 'HTMLTitleElement', - 'HTMLTrackElement', - 'HTMLUListElement', - 'HTMLVideoElement', + 'HTMLElement', // Base class for all HTML elements + 'HTMLAnchorElement', // elements + 'HTMLAreaElement', // elements + 'HTMLAudioElement', //