diff --git a/apps/public-docsite-resources/.eslintrc.json b/apps/public-docsite-resources/.eslintrc.json index 8e090ba63188f..0ea6130924f52 100644 --- a/apps/public-docsite-resources/.eslintrc.json +++ b/apps/public-docsite-resources/.eslintrc.json @@ -5,6 +5,6 @@ "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/explicit-member-accessibility": "off", "@typescript-eslint/member-ordering": "off", - "deprecation/deprecation": "off" + "etc/no-deprecated": "off" } } diff --git a/apps/public-docsite/.eslintrc.json b/apps/public-docsite/.eslintrc.json index 80f89945c1a8d..183ddef7f7731 100644 --- a/apps/public-docsite/.eslintrc.json +++ b/apps/public-docsite/.eslintrc.json @@ -3,7 +3,7 @@ "root": true, "rules": { "@typescript-eslint/no-explicit-any": "off", - "deprecation/deprecation": "off", + "etc/no-deprecated": "off", "import/no-webpack-loader-syntax": "off", // ok in this project "prefer-const": "off", "react/jsx-no-bind": "off" diff --git a/apps/theming-designer/.eslintrc.json b/apps/theming-designer/.eslintrc.json index f7aed51167d6c..064c5f97f3977 100644 --- a/apps/theming-designer/.eslintrc.json +++ b/apps/theming-designer/.eslintrc.json @@ -3,7 +3,7 @@ "root": true, "rules": { "@typescript-eslint/no-explicit-any": "off", - "deprecation/deprecation": "off", + "etc/no-deprecated": "off", "prefer-const": "off" } } diff --git a/apps/vr-tests-react-components/.eslintrc.json b/apps/vr-tests-react-components/.eslintrc.json index 45462ffe5954d..a36fe6f58ba83 100644 --- a/apps/vr-tests-react-components/.eslintrc.json +++ b/apps/vr-tests-react-components/.eslintrc.json @@ -4,7 +4,7 @@ "rules": { "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/jsx-no-bind": "off", - "deprecation/deprecation": "off", + "etc/no-deprecated": "off", "import/no-extraneous-dependencies": ["error", { "packageDir": [".", "../.."] }] } } diff --git a/apps/vr-tests/.eslintrc.json b/apps/vr-tests/.eslintrc.json index b3f394f7cbaca..53eda55bd949d 100644 --- a/apps/vr-tests/.eslintrc.json +++ b/apps/vr-tests/.eslintrc.json @@ -4,7 +4,7 @@ "rules": { "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/jsx-no-bind": "off", - "deprecation/deprecation": "off", + "etc/no-deprecated": "off", "import/no-extraneous-dependencies": ["error", { "packageDir": [".", "../.."] }] } } diff --git a/change/@fluentui-api-docs-86aa1957-a259-47fd-8b0f-af884969e964.json b/change/@fluentui-api-docs-86aa1957-a259-47fd-8b0f-af884969e964.json new file mode 100644 index 0000000000000..c49a08fa2df7d --- /dev/null +++ b/change/@fluentui-api-docs-86aa1957-a259-47fd-8b0f-af884969e964.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "style: fix lint errors", + "packageName": "@fluentui/api-docs", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-codemods-b3d59667-a8d0-443e-ac85-72d2ea2e72a8.json b/change/@fluentui-codemods-b3d59667-a8d0-443e-ac85-72d2ea2e72a8.json new file mode 100644 index 0000000000000..0c8c34eb2ccec --- /dev/null +++ b/change/@fluentui-codemods-b3d59667-a8d0-443e-ac85-72d2ea2e72a8.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "style: fix lint errors", + "packageName": "@fluentui/codemods", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-eslint-plugin-54a8dcfd-724c-4111-a35e-1320a6dd6cae.json b/change/@fluentui-eslint-plugin-54a8dcfd-724c-4111-a35e-1320a6dd6cae.json new file mode 100644 index 0000000000000..c0fb69e56368a --- /dev/null +++ b/change/@fluentui-eslint-plugin-54a8dcfd-724c-4111-a35e-1320a6dd6cae.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "feat: create core base for react/node/legacy lint configs", + "packageName": "@fluentui/eslint-plugin", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/package.json b/package.json index b5ef95734ca48..f22070464ae9e 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "check:change": "beachball check --scope \"!packages/fluentui/*\"", "check:modified-files": "yarn workspace @fluentui/scripts just check-for-modified-files", "check:affected-package": "node ./scripts/monorepo/checkIfPackagesAffected.js", - "check:installed-dependencies-versions": "satisfied --skip-invalid --ignore \"prettier|angular|lit|sass|@storybook/web-components|@storybook/html|svelte|@testing-library|vue\"", + "check:installed-dependencies-versions": "satisfied --skip-invalid --ignore \"prettier|angular|lit|sass|@storybook/web-components|@storybook/html|svelte|@testing-library|vue|eslint\"", "clean": "lage clean --verbose", "code-style": "lage code-style --verbose", "codepen": "cd packages/react && node ../../scripts/local-codepen.js", @@ -174,8 +174,8 @@ "eslint-config-airbnb": "18.2.1", "eslint-config-prettier": "8.3.0", "eslint-import-resolver-typescript": "2.5.0", - "eslint-plugin-deprecation": "1.2.1", "eslint-plugin-es": "4.1.0", + "eslint-plugin-etc": "2.0.2", "eslint-plugin-import": "2.25.4", "eslint-plugin-jest": "23.20.0", "eslint-plugin-jsdoc": "^36.0.7", @@ -320,7 +320,7 @@ "eslint-config-airbnb", "eslint-config-prettier", "eslint-import-resolver-typescript", - "eslint-plugin-deprecation", + "eslint-plugin-etc", "eslint-plugin-import", "eslint-plugin-jest", "eslint-plugin-jsx-a11y", diff --git a/packages/api-docs/src/generatePageJsonFiles.ts b/packages/api-docs/src/generatePageJsonFiles.ts index b2993750b050b..fb1c2a91625de 100644 --- a/packages/api-docs/src/generatePageJsonFiles.ts +++ b/packages/api-docs/src/generatePageJsonFiles.ts @@ -25,6 +25,7 @@ export function generatePageJsonFiles(options: IPageJsonOptions): void { // Load api-extractor output from packages into a model const apiModel = new ApiModel(); for (const apiJsonPath of apiJsonPaths) { + // eslint-disable-next-line no-console console.log('Loading ' + apiJsonPath); // If the file belongs to the compat layer. @@ -53,6 +54,7 @@ export function generatePageJsonFiles(options: IPageJsonOptions): void { const requestedPages = ([] as string[]).concat(...Object.values(pageGroups)); for (const pageName of requestedPages) { if (!pageJsonByName.has(pageName)) { + // eslint-disable-next-line no-console console.warn('Warning: no API items found for expected @docCategory ' + pageName); } } @@ -61,6 +63,7 @@ export function generatePageJsonFiles(options: IPageJsonOptions): void { for (const [pageName, pageJson] of pageJsonByName.entries()) { const pageJsonPath = path.join(outputRoot, pageJson.group || '', pageName + '.page.json'); + // eslint-disable-next-line no-console console.log('Writing ' + pageJsonPath); const json = min ? JSON.stringify(pageJson) : JSON.stringify(pageJson, null, 2); fse.writeFileSync(pageJsonPath, json); diff --git a/packages/codemods/.eslintrc.json b/packages/codemods/.eslintrc.json index 05f2e3df0405e..981d53914320b 100644 --- a/packages/codemods/.eslintrc.json +++ b/packages/codemods/.eslintrc.json @@ -1,5 +1,5 @@ { - "extends": ["plugin:@fluentui/eslint-plugin/node"], + "extends": ["plugin:@fluentui/eslint-plugin/node", "plugin:@fluentui/eslint-plugin/react"], "root": true, "overrides": [ { @@ -9,7 +9,7 @@ "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/naming-convention": "off", "import/no-extraneous-dependencies": "off", - "deprecation/deprecation": "off" + "etc/no-deprecated": "off" } } ] diff --git a/packages/codemods/src/command.ts b/packages/codemods/src/command.ts index a93b37bc2f3b5..d8bb4c3f9ac50 100644 --- a/packages/codemods/src/command.ts +++ b/packages/codemods/src/command.ts @@ -73,8 +73,10 @@ export class CommandParser { } if (parsed.list) { const mods = getEnabledMods(console, getModsPaths); + // eslint-disable-next-line no-console console.log('Here are the enabled code mod names:\n'); mods.forEach(mod => { + // eslint-disable-next-line no-console console.log(mod.name); }); return { shouldExit: true, modsFilter: () => true }; @@ -86,6 +88,7 @@ export class CommandParser { if (configResult.ok) { configObj = configResult.value; } else { + // eslint-disable-next-line no-console console.log(configResult.value); return { shouldExit: true, modsFilter: () => true }; } @@ -115,6 +118,7 @@ function getModRunnerConfig(): Result { sync: true, }); let configObj: ModRunnerConfigType = { stringFilters: [], regexFilters: [], includeMods: false }; + // eslint-disable-next-line no-console console.log('Configuration detected. Attempting to run mods from config...'); if (!foundJsonFile.found || foundJsonFile.found.length !== 1) { return Err({ error: new Error('Error, could not locate correct config file.') }); diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index 4feecd7fe5264..71aac12a6f9d5 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -6,11 +6,12 @@ Usage: in your [ESLint config file](https://eslint.org/docs/user-guide/configuring), add `{ "extends": ["plugin:@fluentui/"] }` or `{ "extends": ["plugin:@fluentui/eslint-plugin/"] }` (the two are equivalent). -- `react`: For `@fluentui/react` and related packages - - `react--legacy`: Like `react` but requiring an `I` prefix for interfaces - - `node`: Like `react` but for packages which run in a Node environment (not the browser) - - `node--legacy`: Like `node` but requiring an `I` prefix for interfaces +- `react`: react specific configuration for fluentui vNext +- `node`: node specific configuration for fluentui vNext +- `react--legacy`: react specific configuration for fluentui v7,8 +- `node--legacy`: node specific configuration for fluentui v7,8 - `react-northstar`: For `@fluentui/react-northstar` and related packages +- `imports`: auto import statements sorting configuration Helpers for customizing configuration are exported under a `configHelpers` object. diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 7d14c3097c58c..0f1de885d5823 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -19,7 +19,7 @@ "eslint-config-airbnb": "^18.2.1", "eslint-config-prettier": "^8.3.0", "eslint-import-resolver-typescript": "^2.4.0", - "eslint-plugin-deprecation": "^1.2.1", + "eslint-plugin-etc": "^2.0.2", "eslint-plugin-import": "^2.22.1", "eslint-plugin-jest": "^23.13.2", "eslint-plugin-jsdoc": "^36.0.7", diff --git a/packages/eslint-plugin/src/configs/base-legacy.js b/packages/eslint-plugin/src/configs/base-legacy.js new file mode 100644 index 0000000000000..24b6140a3eb2f --- /dev/null +++ b/packages/eslint-plugin/src/configs/base-legacy.js @@ -0,0 +1,18 @@ +// @ts-check + +const path = require('path'); + +const { getNamingConventionRule } = require('../utils/configHelpers'); + +/** @type {import("eslint").Linter.Config} */ +module.exports = { + extends: [path.join(__dirname, 'core')], + rules: { + /** + * `@typescript-eslint`plugin eslint rules + * @see https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin + */ + ...getNamingConventionRule({ prefixInterface: true }), + }, + overrides: [], +}; diff --git a/packages/eslint-plugin/src/configs/base.js b/packages/eslint-plugin/src/configs/base.js new file mode 100644 index 0000000000000..d5de005e17200 --- /dev/null +++ b/packages/eslint-plugin/src/configs/base.js @@ -0,0 +1,26 @@ +// @ts-check + +const path = require('path'); + +const { getNamingConventionRule } = require('../utils/configHelpers'); + +/** @type {import("eslint").Linter.Config} */ +module.exports = { + extends: [path.join(__dirname, 'core')], + rules: { + /** + * `@typescript-eslint`plugin eslint rules + * @see https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin + */ + ...getNamingConventionRule(), + }, + overrides: [ + { + files: '**/src/index.{ts,tsx,js}', + rules: { + // TODO: propagate to `error` once all packages barrel files have been fixed + '@rnx-kit/no-export-all': ['warn', { expand: 'all' }], + }, + }, + ], +}; diff --git a/packages/eslint-plugin/src/configs/core.js b/packages/eslint-plugin/src/configs/core.js new file mode 100644 index 0000000000000..25757ce0623de --- /dev/null +++ b/packages/eslint-plugin/src/configs/core.js @@ -0,0 +1,357 @@ +// @ts-check +const configHelpers = require('../utils/configHelpers'); + +/** @type {import("eslint").Linter.Config} */ +const config = { + root: true, + extends: [ + // Provides both rules and some parser options and other settings + 'airbnb/base', + // add typescript support for import plugin - https://github.com/import-js/eslint-plugin-import/blob/main/config/typescript.js + 'plugin:import/typescript', + // Extended configs are applied in order, so these configs that turn other rules off should come last + 'prettier', + ], + parser: '@typescript-eslint/parser', + plugins: ['import', '@fluentui', '@rnx-kit', '@typescript-eslint', 'jest', 'jsdoc', 'etc'], + settings: { + 'import/resolver': { + // @see https://github.com/alexgorbatchev/eslint-import-resolver-typescript#configuration + typescript: { + alwaysTryTypes: true, + project: './tsconfig.json', + }, + }, + jsdoc: { + ignoreInternal: true, + tagNamePreference: { + // Allow any of @default, @defaultvalue, @defaultValue until we settle on a preferred one + default: 'default', + defaultvalue: 'defaultvalue', + defaultValue: 'defaultValue', + // Allow either @return or @returns until we settle on a preferred one + return: 'return', + returns: 'returns', + }, + }, + }, + env: { + browser: true, + 'jest/globals': true, + }, + // We have to disable this when running lint-staged, or it will incorrectly flag eslint-disable + // directives for rules which are disabled only in that context. + reportUnusedDisableDirectives: !configHelpers.isLintStaged, + // matched relative to cwd + ignorePatterns: [ + 'coverage', + 'dist', + 'dist-storybook', + 'etc', + 'lib', + 'lib-amd', + 'lib-commonjs', + 'node_modules', + 'temp', + '**/__snapshots__', + '**/*.scss.ts', + ], + rules: { + /** + * core eslint rules + * @see https://eslint.org/docs/rules + */ + curly: ['error', 'all'], + 'dot-notation': 'error', + eqeqeq: ['error', 'always'], + 'guard-for-in': 'error', + 'no-alert': 'error', + 'no-bitwise': 'error', + 'no-caller': 'error', + 'no-console': 'error', + 'no-constant-condition': 'error', + 'no-debugger': 'error', + 'no-duplicate-case': 'error', + 'no-empty': 'error', + 'no-eval': 'error', + 'no-new-wrappers': 'error', + 'no-restricted-globals': [ + 'error', + ...['blur', 'close', 'focus', 'length', 'name', 'parent', 'self', 'stop'].map(name => ({ + name, + message: `"${name}" refers to a DOM global. Did you mean to reference a local value instead?`, + })), + ], + 'no-restricted-properties': [ + 'error', + { object: 'describe', property: 'only', message: 'describe.only should only be used during test development' }, + { object: 'it', property: 'only', message: 'it.only should only be used during test development' }, + { + object: 'React', + property: 'useLayoutEffect', + message: '`useLayoutEffect` causes a warning in SSR. Use `useIsomorphicLayoutEffect`', + }, + ], + 'no-shadow': ['error', { hoist: 'all' }], + 'no-var': 'error', + 'prefer-const': 'error', + 'prefer-arrow-callback': 'error', // tslint: no-function-expression + radix: ['error', 'always'], + 'lines-between-class-members': 'off', + 'max-classes-per-file': 'off', + 'no-case-declarations': 'off', + 'no-cond-assign': 'off', + 'no-continue': 'off', + 'no-control-regex': 'off', + 'no-else-return': 'off', + 'no-lonely-if': 'off', + 'no-loop-func': 'off', + 'no-multi-assign': 'off', + 'no-nested-ternary': 'off', + 'no-param-reassign': 'off', + 'no-plusplus': 'off', + 'no-prototype-builtins': 'off', + 'no-return-assign': 'off', + 'no-template-curly-in-string': 'off', + 'no-undef-init': 'off', + 'no-underscore-dangle': 'off', + 'no-unneeded-ternary': 'off', + 'no-unused-expressions': 'off', + 'no-use-before-define': 'off', + 'no-useless-computed-key': 'off', + 'no-useless-concat': 'off', + 'no-useless-constructor': 'off', + 'no-useless-escape': 'off', + 'no-useless-rename': 'off', + 'no-useless-return': 'off', + 'object-shorthand': 'off', + 'operator-assignment': 'off', + 'prefer-destructuring': 'off', + 'prefer-template': 'off', + // airbnb or other config overrides (some temporary) + // TODO: determine which rules we want to enable, and make needed changes (separate PR) + 'arrow-body-style': 'off', + 'class-methods-use-this': 'off', + 'consistent-return': 'off', + 'default-case': 'off', + 'func-names': 'off', + 'global-require': 'off', + 'spaced-comment': 'off', + // airbnb options ban for-of which is unnecessary for TS and modern node (https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js#L334) + // but this is a very powerful rule we may want to use in other ways + 'no-restricted-syntax': 'off', + // permanently disable because we disagree with these rules + 'no-await-in-loop': 'off', // contrary to rule docs, awaited things often are NOT parallelizable + // permanently disable due to performance issues (using custom rule `@fluentui/max-len` instead) + 'max-len': 'off', + // permanently disable due to perf problems and limited benefit + // see here for perf testing (note that you must run eslint directly) + // https://eslint.org/docs/developer-guide/working-with-rules#per-rule-performance + 'no-empty-character-class': 'off', + + /** + * `@typescript-eslint`plugin eslint rules + * @see https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin + */ + '@typescript-eslint/no-empty-function': 'error', + '@typescript-eslint/no-explicit-any': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', + + /** + * `@rnx-kit` eslint rules + * @see https://github.com/microsoft/rnx-kit/tree/main/packages/eslint-plugin + */ + '@rnx-kit/no-export-all': ['error', { expand: 'external-only' }], + + /** + * `@fluentui` eslint rules / This package + * @see https://www.npmjs.com/package/@fluentui/eslint-plugin + */ + '@fluentui/ban-imports': [ + 'error', + { + path: 'react', + names: ['useLayoutEffect'], + message: '`useLayoutEffect` causes a warning in SSR. Use `useIsomorphicLayoutEffect`', + }, + ], + '@fluentui/no-global-react': 'error', + '@fluentui/max-len': [ + 'error', + { + ignorePatterns: [ + 'require(<.*?>)?\\(', + 'https?:\\/\\/', + '^(import|export) ', + '^\\s+( [ + // Enable rules requiring type info only for appropriate files/circumstances + ...configHelpers.getTypeInfoRuleOverrides(typeAwareRules), + { + files: '**/*.{ts,tsx}', + // This turns off a few rules that don't work or are unnecessary for TS, and enables a few + // that make sense for TS: no-var, prefer-const, prefer-rest-params, prefer-spread + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/src/configs/eslint-recommended.ts + extends: ['plugin:@typescript-eslint/eslint-recommended'], + // and manually enable rules that only work on TS + rules: { + '@typescript-eslint/ban-ts-comment': 'error', + '@typescript-eslint/explicit-member-accessibility': [ + 'error', + { + accessibility: 'explicit', + overrides: { constructors: 'off' }, + }, + ], + '@typescript-eslint/member-ordering': [ + 'error', + { + default: [ + 'public-static-field', + 'protected-static-field', + 'private-static-field', + 'public-instance-field', + 'protected-instance-field', + 'private-instance-field', + 'public-static-method', + 'protected-static-method', + 'private-static-method', + 'public-constructor', + 'public-instance-method', + 'protected-constructor', + 'protected-instance-method', + 'private-constructor', + 'private-instance-method', + ], + }, + ], + '@typescript-eslint/no-shadow': 'error', + + // permanently disable due to using other rules which do the same thing + camelcase: 'off', // redundant with @typescript-eslint/naming-convention + + // permanently disable due to improper TS handling or unnecessary for TS + // (and not covered by plugin:@typescript-eslint/eslint-recommended) + 'no-empty-function': 'off', + 'no-shadow': 'off', + 'no-unused-vars': 'off', + }, + }, + { + // Test overrides + files: [...configHelpers.testFiles], + rules: { + 'no-console': 'off', + }, + }, + { + files: 'src/**/*.deprecated.test.{ts,tsx}', + rules: { + 'deprecation/deprecation': 'off', // the purpose of these tests + }, + }, + { + // Example overrides + files: '**/*.{Example,stories}.tsx', + rules: { + 'no-alert': 'off', + 'no-console': 'off', + }, + }, + { + // Docs overrides (excluding examples) + files: [...configHelpers.docsFiles], + rules: { + 'import/no-webpack-loader-syntax': 'off', // this is ok in docs + }, + }, + { + files: [...configHelpers.configFiles], + rules: { + 'no-console': 'off', + }, + }, + { + files: [...configHelpers.devDependenciesFiles], + rules: { + // TODO: https://github.com/microsoft/fluentui/issues/21999 + 'import/no-extraneous-dependencies': 'off', + }, + }, +]; + +// Why use `defineProperty` for `overrides`? +// +// By default, any logic in this file will be run every time the plugin is loaded (even if this +// config is not used) due to it being included by necessity in the package index file. +// These overrides include some more complex logic which should only run when requested, since it's +// more costly and can cause build errors if run in a package it wasn't designed for. +// If ESLint supported exporting a function from a config file, that would be an easy solution. +// Since that's not supported, we work around it by defining overrides as a property with getter. +// @ts-ignore -- `overrides?` is declared in `eslint.Linter.Config` but our `config` object doesn't define it until now +Object.defineProperty(config, 'overrides', { + enumerable: true, + get: getOverrides, +}); + +module.exports = config; diff --git a/packages/eslint-plugin/src/configs/imports.js b/packages/eslint-plugin/src/configs/imports.js new file mode 100644 index 0000000000000..78bf2faedba87 --- /dev/null +++ b/packages/eslint-plugin/src/configs/imports.js @@ -0,0 +1,27 @@ +module.exports = { + rules: { + /** + * core eslint rules + * @see https://eslint.org/docs/rules + */ + // handles only member sort, rest is handled via import/order + 'sort-imports': ['warn', { ignoreDeclarationSort: true }], + + /** + * import plugin rules + * @see https://github.com/import-js/eslint-plugin-import + */ + 'import/no-duplicates': 'warn', + 'import/first': 'warn', + 'import/order': [ + 'warn', + { + 'newlines-between': 'always', + alphabetize: { + order: 'asc', + caseInsensitive: false, + }, + }, + ], + }, +}; diff --git a/packages/eslint-plugin/src/configs/node-legacy.js b/packages/eslint-plugin/src/configs/node-legacy.js index 5636a1c802bc4..8e36520c72c33 100644 --- a/packages/eslint-plugin/src/configs/node-legacy.js +++ b/packages/eslint-plugin/src/configs/node-legacy.js @@ -1,12 +1,9 @@ // @ts-check const path = require('path'); -const configHelpers = require('../utils/configHelpers'); /** @type {import("eslint").Linter.Config} */ module.exports = { - extends: [path.join(__dirname, 'node')], - rules: { - ...configHelpers.getNamingConventionRule(true /* prefixWithI */), - }, + extends: [path.join(__dirname, 'base-legacy')], + rules: {}, }; diff --git a/packages/eslint-plugin/src/configs/node.js b/packages/eslint-plugin/src/configs/node.js index c321742fd5f47..91146bd8764dd 100644 --- a/packages/eslint-plugin/src/configs/node.js +++ b/packages/eslint-plugin/src/configs/node.js @@ -4,7 +4,7 @@ const path = require('path'); /** @type {import("eslint").Linter.Config} */ module.exports = { - extends: [path.join(__dirname, 'react')], + extends: [path.join(__dirname, 'base')], rules: { 'no-console': 'off', }, diff --git a/packages/eslint-plugin/src/configs/react-config.js b/packages/eslint-plugin/src/configs/react-config.js new file mode 100644 index 0000000000000..db5e5f22dbb15 --- /dev/null +++ b/packages/eslint-plugin/src/configs/react-config.js @@ -0,0 +1,131 @@ +const configHelpers = require('../utils/configHelpers'); + +/** @type {import("eslint").Linter.Config} */ +module.exports = { + plugins: ['jsx-a11y', 'react', 'react-hooks'], + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + settings: { + react: { + pragma: 'React', + version: 'detect', + }, + // copied from https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb/rules/react.js#L575 + propWrapperFunctions: [ + 'forbidExtraProps', // https://www.npmjs.com/package/airbnb-prop-types + 'exact', // https://www.npmjs.com/package/prop-types-exact + 'Object.freeze', // https://tc39.github.io/ecma262/#sec-object.freeze + ], + }, + rules: { + /** + * react eslint rules + * @see https://github.com/yannickcr/eslint-plugin-react + */ + 'react/jsx-key': 'error', + 'react/jsx-no-bind': [ + 'error', + { + allowArrowFunctions: false, // tslint: jsx-no-lambda + allowFunctions: false, + allowBind: false, + ignoreDOMComponents: true, + ignoreRefs: true, + }, + ], + 'react/no-string-refs': 'error', + 'react/self-closing-comp': 'error', + 'react/no-danger': 'warn', + // NOTE: following rules has been turned off to override `airbnb/rules/react`, which we don't use anymore + // TODO: needs to be checked against core react eslint plugin if we need those turn off explicitly + // @see https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb/rules/react.js + 'react/button-has-type': 'off', + 'react/destructuring-assignment': 'off', + 'react/forbid-prop-types': 'off', + 'react/jsx-boolean-value': 'off', + 'react/jsx-curly-brace-presence': 'off', + 'react/jsx-no-target-blank': 'off', + 'react/jsx-pascal-case': 'off', // Doesn't handle lowercase slot names + 'react/no-access-state-in-setstate': 'off', + 'react/no-array-index-key': 'off', + 'react/no-did-update-set-state': 'off', + 'react/no-find-dom-node': 'off', + 'react/no-render-return-value': 'off', + 'react/no-unescaped-entities': 'off', + 'react/no-will-update-set-state': 'off', + 'react/prefer-stateless-function': 'off', + 'react/sort-comp': 'off', + 'react/state-in-constructor': 'off', + 'react/static-property-placement': 'off', + 'react/require-default-props': 'off', + 'react/no-unknown-property': 'off', // expensive, limited benefit with TS + // these ones have minor negative perf impact and are unnecessary + 'react/default-props-match-prop-types': 'off', + 'react/no-unused-prop-types': 'off', + 'react/prefer-es6-class': 'off', + // permanently disable because we disagree with these rules + 'react/jsx-props-no-spreading': 'off', + 'react/prop-types': 'off', + 'react/jsx-filename-extension': 'off', + + /** + * react-hooks rules + * @see https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks + */ + 'react-hooks/exhaustive-deps': [ + 'error', + { + additionalHooks: 'useIsomorphicLayoutEffect', + }, + ], + 'react-hooks/rules-of-hooks': 'error', + + /** + * jsx-a11y rules + * @see https://github.com/jsx-eslint/eslint-plugin-jsx-a11y + */ + 'jsx-a11y/tabindex-no-positive': 'error', + // NOTE: following rules has been turned off to override `airbnb/rules/react-a11y` + // TODO: needs to be checked against core jsx-a11y eslint plugin if we need those turn off explicitly + // @see https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb/rules/react-a11y.js + 'jsx-a11y/alt-text': 'off', + 'jsx-a11y/anchor-is-valid': 'off', + 'jsx-a11y/aria-activedescendant-has-tabindex': 'off', + 'jsx-a11y/aria-role': 'off', + 'jsx-a11y/click-events-have-key-events': 'off', + 'jsx-a11y/control-has-associated-label': 'off', + 'jsx-a11y/role-has-required-aria-props': 'off', + 'jsx-a11y/interactive-supports-focus': 'off', + 'jsx-a11y/label-has-associated-control': 'off', + 'jsx-a11y/media-has-caption': 'off', + 'jsx-a11y/mouse-events-have-key-events': 'off', + 'jsx-a11y/no-interactive-element-to-noninteractive-role': 'off', + 'jsx-a11y/no-noninteractive-element-interactions': 'off', + 'jsx-a11y/no-noninteractive-tabindex': 'off', + 'jsx-a11y/no-redundant-roles': 'off', + 'jsx-a11y/no-static-element-interactions': 'off', + 'jsx-a11y/role-supports-aria-props': 'off', + }, + overrides: [ + { + // Test overrides + files: [...configHelpers.testFiles], + rules: { + 'react/jsx-no-bind': 'off', + }, + }, + { + files: '**/*.stories.tsx', + rules: { + // allow arrow functions in stories for now (may want to change this later since using + // constantly-mutating functions can be an anti-pattern which we may not want to demonstrate + // in our converged components docs; it happened to be allowed starting out because .stories + // files were being linted as tests) + 'react/jsx-no-bind': 'off', + }, + }, + ], +}; diff --git a/packages/eslint-plugin/src/configs/react-legacy.js b/packages/eslint-plugin/src/configs/react-legacy.js index 1c469a2e1ba34..a57ab3338e7bf 100644 --- a/packages/eslint-plugin/src/configs/react-legacy.js +++ b/packages/eslint-plugin/src/configs/react-legacy.js @@ -1,14 +1,12 @@ // @ts-check const path = require('path'); -const configHelpers = require('../utils/configHelpers'); /** @type {import("eslint").Linter.Config} */ module.exports = { - extends: [path.join(__dirname, 'react')], + extends: [path.join(__dirname, 'base-legacy'), path.join(__dirname, 'react-config')], rules: { - ...configHelpers.getNamingConventionRule(true /* prefixWithI */), 'jsdoc/check-tag-names': 'off', }, }; diff --git a/packages/eslint-plugin/src/configs/react.js b/packages/eslint-plugin/src/configs/react.js index b816184207e28..a50553f839002 100644 --- a/packages/eslint-plugin/src/configs/react.js +++ b/packages/eslint-plugin/src/configs/react.js @@ -1,440 +1,9 @@ // @ts-check -const configHelpers = require('../utils/configHelpers'); -/** @type {import("eslint").Linter.Config} */ -const config = { - root: true, - extends: [ - // Provides both rules and some parser options and other settings - 'airbnb', - // add typescript support for import plugin - https://github.com/import-js/eslint-plugin-import/blob/main/config/typescript.js - 'plugin:import/typescript', - // Extended configs are applied in order, so these configs that turn other rules off should come last - 'prettier', - ], - parser: '@typescript-eslint/parser', - plugins: [ - 'import', - '@fluentui', - '@rnx-kit', - '@typescript-eslint', - 'deprecation', - 'jest', - 'jsdoc', - 'jsx-a11y', - 'react', - 'react-hooks', - ], - settings: { - 'import/resolver': { - // @see https://github.com/alexgorbatchev/eslint-import-resolver-typescript#configuration - typescript: { - alwaysTryTypes: true, - project: './tsconfig.json', - }, - }, - jsdoc: { - ignoreInternal: true, - tagNamePreference: { - // Allow any of @default, @defaultvalue, @defaultValue until we settle on a preferred one - default: 'default', - defaultvalue: 'defaultvalue', - defaultValue: 'defaultValue', - // Allow either @return or @returns until we settle on a preferred one - return: 'return', - returns: 'returns', - }, - }, - }, - env: { - browser: true, - 'jest/globals': true, - }, - // We have to disable this when running lint-staged, or it will incorrectly flag eslint-disable - // directives for rules which are disabled only in that context. - reportUnusedDisableDirectives: !configHelpers.isLintStaged, - // matched relative to cwd - ignorePatterns: [ - 'coverage', - 'dist', - 'dist-storybook', - 'etc', - 'lib', - 'lib-amd', - 'lib-commonjs', - 'node_modules', - 'temp', - '**/__snapshots__', - '**/*.scss.ts', - ], - rules: { - '@rnx-kit/no-export-all': ['error', { expand: 'external-only' }], - '@fluentui/no-global-react': 'error', - '@fluentui/max-len': [ - 'error', - { - ignorePatterns: [ - 'require(<.*?>)?\\(', - 'https?:\\/\\/', - '^(import|export) ', - '^\\s+( ({ - name, - message: `"${name}" refers to a DOM global. Did you mean to reference a local value instead?`, - })), - ], - '@fluentui/ban-imports': [ - 'error', - { - path: 'react', - names: ['useLayoutEffect'], - message: '`useLayoutEffect` causes a warning in SSR. Use `useIsomorphicLayoutEffect`', - }, - ], - 'no-restricted-properties': [ - 'error', - { object: 'describe', property: 'only', message: 'describe.only should only be used during test development' }, - { object: 'it', property: 'only', message: 'it.only should only be used during test development' }, - { - object: 'React', - property: 'useLayoutEffect', - message: '`useLayoutEffect` causes a warning in SSR. Use `useIsomorphicLayoutEffect`', - }, - ], - 'no-shadow': ['error', { hoist: 'all' }], - 'no-var': 'error', - 'prefer-const': 'error', - 'prefer-arrow-callback': 'error', // tslint: no-function-expression - radix: ['error', 'always'], - 'react/jsx-key': 'error', - 'react/jsx-no-bind': [ - 'error', - { - allowArrowFunctions: false, // tslint: jsx-no-lambda - allowFunctions: false, - allowBind: false, - ignoreDOMComponents: true, - ignoreRefs: true, - }, - ], - 'react/no-string-refs': 'error', - 'react/self-closing-comp': 'error', - 'react-hooks/exhaustive-deps': [ - 'error', - { - additionalHooks: 'useIsomorphicLayoutEffect', - }, - ], - 'react-hooks/rules-of-hooks': 'error', - - // airbnb or other config overrides (some temporary) - // TODO: determine which rules we want to enable, and make needed changes (separate PR) - 'arrow-body-style': 'off', - 'class-methods-use-this': 'off', - 'consistent-return': 'off', - 'default-case': 'off', - 'func-names': 'off', - 'global-require': 'off', - - 'jsx-a11y/alt-text': 'off', - 'jsx-a11y/anchor-is-valid': 'off', - 'jsx-a11y/aria-activedescendant-has-tabindex': 'off', - 'jsx-a11y/aria-role': 'off', - 'jsx-a11y/click-events-have-key-events': 'off', - 'jsx-a11y/control-has-associated-label': 'off', - 'jsx-a11y/role-has-required-aria-props': 'off', - 'jsx-a11y/interactive-supports-focus': 'off', - 'jsx-a11y/label-has-associated-control': 'off', - 'jsx-a11y/media-has-caption': 'off', - 'jsx-a11y/mouse-events-have-key-events': 'off', - 'jsx-a11y/no-interactive-element-to-noninteractive-role': 'off', - 'jsx-a11y/no-noninteractive-element-interactions': 'off', - 'jsx-a11y/no-noninteractive-tabindex': 'off', - 'jsx-a11y/no-redundant-roles': 'off', - 'jsx-a11y/no-static-element-interactions': 'off', - 'jsx-a11y/role-supports-aria-props': 'off', - 'lines-between-class-members': 'off', - 'max-classes-per-file': 'off', - 'no-case-declarations': 'off', - 'no-cond-assign': 'off', - 'no-continue': 'off', - 'no-control-regex': 'off', - 'no-else-return': 'off', - 'no-lonely-if': 'off', - 'no-loop-func': 'off', - 'no-multi-assign': 'off', - 'no-nested-ternary': 'off', - 'no-param-reassign': 'off', - 'no-plusplus': 'off', - 'no-prototype-builtins': 'off', - 'no-return-assign': 'off', - 'no-template-curly-in-string': 'off', - 'no-undef-init': 'off', - 'no-underscore-dangle': 'off', - 'no-unneeded-ternary': 'off', - 'no-unused-expressions': 'off', - 'no-use-before-define': 'off', - 'no-useless-computed-key': 'off', - 'no-useless-concat': 'off', - 'no-useless-constructor': 'off', - 'no-useless-escape': 'off', - 'no-useless-rename': 'off', - 'no-useless-return': 'off', - 'object-shorthand': 'off', - 'operator-assignment': 'off', - 'prefer-destructuring': 'off', - 'prefer-template': 'off', - 'react/button-has-type': 'off', - 'react/destructuring-assignment': 'off', - 'react/forbid-prop-types': 'off', - 'react/jsx-boolean-value': 'off', - 'react/jsx-curly-brace-presence': 'off', - 'react/jsx-no-target-blank': 'off', - 'react/jsx-pascal-case': 'off', // Doesn't handle lowercase slot names - 'react/no-access-state-in-setstate': 'off', - 'react/no-array-index-key': 'off', - 'react/no-did-update-set-state': 'off', - 'react/no-find-dom-node': 'off', - 'react/no-render-return-value': 'off', - 'react/no-unescaped-entities': 'off', - 'react/no-will-update-set-state': 'off', - 'react/prefer-stateless-function': 'off', - 'react/sort-comp': 'off', - 'react/state-in-constructor': 'off', - 'react/static-property-placement': 'off', - 'react/require-default-props': 'off', - 'spaced-comment': 'off', - - // airbnb options ban for-of which is unnecessary for TS and modern node (https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js#L334) - // but this is a very powerful rule we may want to use in other ways - 'no-restricted-syntax': 'off', - - // permanently disable because we disagree with these rules - 'no-await-in-loop': 'off', // contrary to rule docs, awaited things often are NOT parallelizable - 'react/jsx-props-no-spreading': 'off', - 'react/prop-types': 'off', - - // permanently disable due to performance issues (using custom rule `@fluentui/max-len` instead) - 'max-len': 'off', - - // permanently disable due to perf problems and limited benefit - // see here for perf testing (note that you must run eslint directly) - // https://eslint.org/docs/developer-guide/working-with-rules#per-rule-performance - 'no-empty-character-class': 'off', - 'react/no-unknown-property': 'off', // expensive, limited benefit with TS - // these ones have minor negative perf impact and are unnecessary - 'react/default-props-match-prop-types': 'off', - 'react/no-unused-prop-types': 'off', - 'react/prefer-es6-class': 'off', +const path = require('path'); - 'jsdoc/check-tag-names': [ - 'error', - { - // Allow TSDoc tags @remarks and @defaultValue - definedTags: ['remarks', 'defaultValue'], - }, - ], - - /** - * - * import plugin rules - * @see https://github.com/import-js/eslint-plugin-import - */ - 'import/no-extraneous-dependencies': ['error', { devDependencies: false }], - 'import/extensions': 'off', - 'import/first': 'off', - 'import/newline-after-import': 'off', - 'import/no-duplicates': 'off', // mostly redundant with no-duplicate-imports - 'import/no-dynamic-require': 'off', - 'import/no-mutable-exports': 'off', - 'import/no-unresolved': 'off', - 'import/no-useless-path-segments': 'off', - 'import/order': 'off', - 'import/prefer-default-export': 'off', - // may cause perf problems per https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#eslint-plugin-import - 'import/no-cycle': 'off', - 'import/no-deprecated': 'off', - 'import/no-named-as-default': 'off', - 'import/no-unused-modules': 'off', - // these ones aren't needed for TS and may cause perf problems - 'import/default': 'off', - 'import/namespace': 'off', - 'import/no-named-as-default-member': 'off', - 'import/export': 'off', - }, -}; - -/** @type {import("eslint").Linter.RulesRecord} */ -const typeAwareRules = { - /** - * plugin: https://github.com/gund/eslint-plugin-deprecation - */ - 'deprecation/deprecation': 'error', +/** @type {import("eslint").Linter.Config} */ +module.exports = { + extends: [path.join(__dirname, 'base'), path.join(__dirname, 'react-config')], + rules: {}, }; - -/** - * Override definitions for `config`. See explanation at bottom of file for why/how this function is used. - * @returns {import("eslint").Linter.ConfigOverride[]} - */ -const getOverrides = () => [ - // Enable rules requiring type info only for appropriate files/circumstances - ...configHelpers.getTypeInfoRuleOverrides(typeAwareRules), - { - files: '**/src/index.{ts,tsx,js}', - rules: { - // TODO: propagate to `error` once all packages barrel files have been fixed - '@rnx-kit/no-export-all': ['warn', { expand: 'all' }], - }, - }, - { - files: '**/*.{ts,tsx}', - // This turns off a few rules that don't work or are unnecessary for TS, and enables a few - // that make sense for TS: no-var, prefer-const, prefer-rest-params, prefer-spread - // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/src/configs/eslint-recommended.ts - extends: ['plugin:@typescript-eslint/eslint-recommended'], - // and manually enable rules that only work on TS - rules: { - '@typescript-eslint/ban-ts-comment': 'error', - '@typescript-eslint/explicit-member-accessibility': [ - 'error', - { - accessibility: 'explicit', - overrides: { constructors: 'off' }, - }, - ], - '@typescript-eslint/member-ordering': [ - 'error', - { - default: [ - 'public-static-field', - 'protected-static-field', - 'private-static-field', - 'public-instance-field', - 'protected-instance-field', - 'private-instance-field', - 'public-static-method', - 'protected-static-method', - 'private-static-method', - 'public-constructor', - 'public-instance-method', - 'protected-constructor', - 'protected-instance-method', - 'private-constructor', - 'private-instance-method', - ], - }, - ], - '@typescript-eslint/no-shadow': 'error', - - // permanently disable due to using other rules which do the same thing - camelcase: 'off', // redundant with @typescript-eslint/naming-convention - - // permanently disable due to improper TS handling or unnecessary for TS - // (and not covered by plugin:@typescript-eslint/eslint-recommended) - 'no-empty-function': 'off', - 'no-shadow': 'off', - 'no-unused-vars': 'off', - 'react/jsx-filename-extension': 'off', - }, - }, - { - // Test overrides - files: [...configHelpers.testFiles], - rules: { - 'no-console': 'off', - 'react/jsx-no-bind': 'off', - }, - }, - { - files: 'src/**/*.deprecated.test.{ts,tsx}', - rules: { - 'deprecation/deprecation': 'off', // the purpose of these tests - }, - }, - { - // Example overrides - files: '**/*.{Example,stories}.tsx', - rules: { - 'no-alert': 'off', - 'no-console': 'off', - }, - }, - { - files: '**/*.stories.tsx', - rules: { - // allow arrow functions in stories for now (may want to change this later since using - // constantly-mutating functions can be an anti-pattern which we may not want to demonstrate - // in our converged components docs; it happened to be allowed starting out because .stories - // files were being linted as tests) - 'react/jsx-no-bind': 'off', - }, - }, - { - // Docs overrides (excluding examples) - files: [...configHelpers.docsFiles], - rules: { - 'import/no-webpack-loader-syntax': 'off', // this is ok in docs - }, - }, - { - files: [...configHelpers.configFiles], - rules: { - 'no-console': 'off', - }, - }, - { - files: [...configHelpers.devDependenciesFiles], - rules: { - // TODO: https://github.com/microsoft/fluentui/issues/21999 - 'import/no-extraneous-dependencies': 'off', - }, - }, -]; - -// Why use `defineProperty` for `overrides`? -// -// By default, any logic in this file will be run every time the plugin is loaded (even if this -// config is not used) due to it being included by necessity in the package index file. -// These overrides include some more complex logic which should only run when requested, since it's -// more costly and can cause build errors if run in a package it wasn't designed for. -// If ESLint supported exporting a function from a config file, that would be an easy solution. -// Since that's not supported, we work around it by defining overrides as a property with getter. -// @ts-ignore -- `overrides?` is declared in `eslint.Linter.Config` but our `config` object doesn't define it until now -Object.defineProperty(config, 'overrides', { - enumerable: true, - get: getOverrides, -}); - -module.exports = config; diff --git a/packages/eslint-plugin/src/index.js b/packages/eslint-plugin/src/index.js index 925e6aa5645f2..033c21c969dc3 100644 --- a/packages/eslint-plugin/src/index.js +++ b/packages/eslint-plugin/src/index.js @@ -3,6 +3,7 @@ module.exports = { node: require('./configs/node'), 'node--legacy': require('./configs/node-legacy'), react: require('./configs/react'), + imports: require('./configs/imports'), 'react--legacy': require('./configs/react-legacy'), 'react-northstar': require('./configs/react-northstar'), }, diff --git a/packages/eslint-plugin/src/utils/configHelpers.js b/packages/eslint-plugin/src/utils/configHelpers.js index 95f7ca39cdd87..b287bc7ab95e0 100644 --- a/packages/eslint-plugin/src/utils/configHelpers.js +++ b/packages/eslint-plugin/src/utils/configHelpers.js @@ -69,10 +69,10 @@ module.exports = { * Returns a rule configuration for [`@typescript-eslint/naming-convention`](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md). * This provides the ability to override *only* the interface rule without having to repeat or * lose the rest of the (very complicated) config. - * @param {boolean} prefixWithI - Whether to prefix interfaces with I + * @param {{prefixInterface: boolean}} config - Whether to prefix interfaces with I * @returns {import("eslint").Linter.RulesRecord} */ - getNamingConventionRule: prefixWithI => ({ + getNamingConventionRule: (config = { prefixInterface: false }) => ({ '@typescript-eslint/naming-convention': [ 'error', { selector: 'function', format: ['camelCase'], leadingUnderscore: 'allow' }, @@ -98,7 +98,7 @@ module.exports = { { selector: 'interface', format: ['PascalCase'], - ...(prefixWithI ? { prefix: ['I'] } : { custom: { regex: '^I[A-Z]', match: false } }), + ...(config.prefixInterface ? { prefix: ['I'] } : { custom: { regex: '^I[A-Z]', match: false } }), }, { selector: 'default', diff --git a/packages/font-icons-mdl2/src/IconNames.ts b/packages/font-icons-mdl2/src/IconNames.ts index 3041a5bc2ca61..e438844817f2c 100644 --- a/packages/font-icons-mdl2/src/IconNames.ts +++ b/packages/font-icons-mdl2/src/IconNames.ts @@ -1805,5 +1805,5 @@ export const enum IconNames { SizeLegacy = 'SizeLegacy', } -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated export type IconNamesInput = keyof typeof IconNames; diff --git a/packages/font-icons-mdl2/src/iconNames.test.ts b/packages/font-icons-mdl2/src/iconNames.test.ts index 022c8aeddd4f5..680b23f74824c 100644 --- a/packages/font-icons-mdl2/src/iconNames.test.ts +++ b/packages/font-icons-mdl2/src/iconNames.test.ts @@ -1,6 +1,6 @@ import { IconNames, IconNamesInput } from './IconNames'; -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated declare const allIconNamesValues: IconNames; function validateIconNamesValues(allowedIconNamesValues: IconNamesInput): void { diff --git a/packages/font-icons-mdl2/src/index.ts b/packages/font-icons-mdl2/src/index.ts index a545ab1bc52c5..1755342851877 100644 --- a/packages/font-icons-mdl2/src/index.ts +++ b/packages/font-icons-mdl2/src/index.ts @@ -48,7 +48,7 @@ export function initializeIcons(baseUrl: string = DEFAULT_BASE_URL, options?: II registerIconAliases(); } -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated export { IconNames } from './IconNames'; import './version'; diff --git a/packages/keyboard-key/src/index.ts b/packages/keyboard-key/src/index.ts index 8120aad882e9f..3326279e11890 100644 --- a/packages/keyboard-key/src/index.ts +++ b/packages/keyboard-key/src/index.ts @@ -182,7 +182,7 @@ const isObject = (val: any): val is KeyboardEventLike => { */ export function getCode(eventOrKey: Partial | string): number | undefined { if (isObject(eventOrKey)) { - // eslint-disable-next-line deprecation/deprecation, @typescript-eslint/no-explicit-any + // eslint-disable-next-line etc/no-deprecated, @typescript-eslint/no-explicit-any return eventOrKey.keyCode || eventOrKey.which || (keyboardKey as any)[eventOrKey.key as string]; } // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -204,7 +204,7 @@ export function getKey(eventOrCode: Partial | number): string return event.key; } - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated let name = codes[(isEvent ? event.keyCode || event.which : eventOrCode) as number]; if (Array.isArray(name)) { diff --git a/packages/merge-styles/src/IStyleSet.ts b/packages/merge-styles/src/IStyleSet.ts index becc374122d03..ba710590ba4cd 100644 --- a/packages/merge-styles/src/IStyleSet.ts +++ b/packages/merge-styles/src/IStyleSet.ts @@ -10,7 +10,7 @@ export type Diff = ({ [P in T]: P } & /** * @deprecated Use the version provided by TypeScript instead. */ -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated export type Omit = Pick>; /** @@ -28,7 +28,7 @@ export type __MapToFunctionType = Extract extends never * property. */ export type IStyleSet = { [key: string]: any }> = { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated [P in keyof Omit]: IStyle; } & { subComponentStyles?: { [P in keyof TStyleSet['subComponentStyles']]: IStyleFunctionOrObject }; @@ -38,7 +38,7 @@ export type IStyleSet = { [key: string]: * A concatenated style set differs from `IStyleSet` in that subComponentStyles will always be a style function. */ export type IConcatenatedStyleSet> = { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated [P in keyof Omit]: IStyle; } & { subComponentStyles?: { [P in keyof TStyleSet['subComponentStyles']]: IStyleFunction }; @@ -49,7 +49,7 @@ export type IConcatenatedStyleSet> = { * into a class name. Additionally, all subComponentStyles are style functions. */ export type IProcessedStyleSet> = { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated [P in keyof Omit]: string; } & { subComponentStyles: { diff --git a/packages/merge-styles/src/Stylesheet.ts b/packages/merge-styles/src/Stylesheet.ts index aa536ccb80598..b42a0aca6a167 100644 --- a/packages/merge-styles/src/Stylesheet.ts +++ b/packages/merge-styles/src/Stylesheet.ts @@ -309,9 +309,9 @@ export class Stylesheet { this._rules.push(rule); } - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (this._config.onInsertRule) { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated this._config.onInsertRule(rule); } diff --git a/packages/merge-styles/src/index.ts b/packages/merge-styles/src/index.ts index 4fa86b8c3048e..915da1eecc5c3 100644 --- a/packages/merge-styles/src/index.ts +++ b/packages/merge-styles/src/index.ts @@ -8,7 +8,7 @@ export { IStyleFunction, IStyleFunctionOrObject } from './IStyleFunction'; export { DeepPartial } from './DeepPartial'; -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated export { IConcatenatedStyleSet, IProcessedStyleSet, IStyleSet, Omit } from './IStyleSet'; export { ICSSRule, ICSSPixelUnitRule, IFontFace, IFontWeight, IRawFontStyle, IRawStyleBase } from './IRawStyleBase'; diff --git a/packages/react-avatar/src/index.ts b/packages/react-avatar/src/index.ts index 3b60a82f2b89d..7bde754c05459 100644 --- a/packages/react-avatar/src/index.ts +++ b/packages/react-avatar/src/index.ts @@ -1,6 +1,6 @@ export { Avatar, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated avatarClassName, avatarClassNames, renderAvatar_unstable, diff --git a/packages/react-badge/src/index.ts b/packages/react-badge/src/index.ts index 5ea9d1ebf6f57..8756d98e8a35f 100644 --- a/packages/react-badge/src/index.ts +++ b/packages/react-badge/src/index.ts @@ -1,6 +1,6 @@ export { Badge, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated badgeClassName, badgeClassNames, renderBadge_unstable, @@ -10,7 +10,7 @@ export { export type { BadgeProps, BadgeSlots, BadgeState } from './Badge'; export { PresenceBadge, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated presenceBadgeClassName, presenceBadgeClassNames, usePresenceBadgeStyles_unstable, @@ -19,7 +19,7 @@ export { export type { PresenceBadgeProps, PresenceBadgeState, PresenceBadgeStatus } from './PresenceBadge'; export { CounterBadge, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated counterBadgeClassName, counterBadgeClassNames, useCounterBadgeStyles_unstable, diff --git a/packages/react-button/src/index.ts b/packages/react-button/src/index.ts index 22d19402a8705..3b74bd1d6c27c 100644 --- a/packages/react-button/src/index.ts +++ b/packages/react-button/src/index.ts @@ -1,6 +1,6 @@ export { Button, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated buttonClassName, buttonClassNames, renderButton_unstable, @@ -10,7 +10,7 @@ export { export type { ButtonProps, ButtonSlots, ButtonState } from './Button'; export { CompoundButton, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated compoundButtonClassName, compoundButtonClassNames, renderCompoundButton_unstable, @@ -20,7 +20,7 @@ export { export type { CompoundButtonProps, CompoundButtonSlots, CompoundButtonState } from './CompoundButton'; export { MenuButton, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated menuButtonClassName, menuButtonClassNames, renderMenuButton_unstable, @@ -31,7 +31,7 @@ export type { MenuButtonProps, MenuButtonSlots, MenuButtonState } from './MenuBu export { SplitButton, renderSplitButton_unstable, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated splitButtonClassName, splitButtonClassNames, useSplitButtonStyles_unstable, @@ -41,7 +41,7 @@ export type { SplitButtonProps, SplitButtonSlots, SplitButtonState } from './Spl export { ToggleButton, renderToggleButton_unstable, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated toggleButtonClassName, toggleButtonClassNames, useToggleButtonStyles_unstable, diff --git a/packages/react-cards/.eslintrc.json b/packages/react-cards/.eslintrc.json index fcffc3d29ca9e..330ee102c08d7 100644 --- a/packages/react-cards/.eslintrc.json +++ b/packages/react-cards/.eslintrc.json @@ -9,7 +9,7 @@ "files": "**/*.{ts,tsx}", "rules": { // The components in this package are all deprecated - "deprecation/deprecation": "off" + "etc/no-deprecated": "off" } } ] diff --git a/packages/react-charting/src/Styling.ts b/packages/react-charting/src/Styling.ts index 111832e8c1e5e..b1d27e4d3bc8e 100644 --- a/packages/react-charting/src/Styling.ts +++ b/packages/react-charting/src/Styling.ts @@ -38,11 +38,11 @@ export { createTheme, focusClear, fontFace, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated getEdgeChromiumNoHighContrastAdjustSelector, getFadedOverflowStyle, getFocusOutlineStyle, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated getFocusStyle, getGlobalClassNames, getHighContrastNoAdjustStyle, diff --git a/packages/react-charting/src/Utilities.ts b/packages/react-charting/src/Utilities.ts index 24bf528b1bb7b..da9560d1a4a7f 100644 --- a/packages/react-charting/src/Utilities.ts +++ b/packages/react-charting/src/Utilities.ts @@ -1,10 +1,10 @@ export { Async, AutoScroll, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated BaseComponent, Customizations, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated Customizer, CustomizerContext, DATA_IS_SCROLLABLE_ATTRIBUTE, @@ -86,7 +86,7 @@ export { getRTL, getRTLSafeKeyCode, getRect, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated getResourceUrl, getScrollbarWidth, getVirtualParent, @@ -98,11 +98,11 @@ export { hoistStatics, htmlElementProperties, iframeProperties, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated imageProperties, imgProperties, initializeComponentRef, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated initializeFocusRects, inputProperties, isControlled, @@ -134,7 +134,7 @@ export { optionProperties, portalContainsElement, precisionRound, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated raiseClick, removeIndex, replaceElement, @@ -144,10 +144,10 @@ export { safeRequestAnimationFrame, safeSetTimeout, selectProperties, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated setBaseUrl, setFocusVisibility, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated setLanguage, setMemoizeWeakMap, setPortalAttribute, @@ -182,7 +182,7 @@ export type { ICancelable, IChangeDescription, IChangeEventCallback, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated IClassNames, IClassNamesFunctionOptions, IComponentAs, @@ -205,7 +205,7 @@ export type { IPerfData, IPerfMeasurement, IPerfSummary, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated IPoint, IPropsWithStyles, IRectangle, @@ -224,13 +224,13 @@ export type { IStyleFunctionOrObject, IVirtualElement, IWarnControlledUsageParams, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated Omit, Point, RefObject, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated Settings, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated SettingsFunction, StyleFunction, } from '@fluentui/react/lib/Utilities'; diff --git a/packages/react-charting/src/components/VerticalStackedBarChart/VerticalStackedBarChart.base.tsx b/packages/react-charting/src/components/VerticalStackedBarChart/VerticalStackedBarChart.base.tsx index e51ec297f9a33..f13a1e85bb21c 100644 --- a/packages/react-charting/src/components/VerticalStackedBarChart/VerticalStackedBarChart.base.tsx +++ b/packages/react-charting/src/components/VerticalStackedBarChart/VerticalStackedBarChart.base.tsx @@ -371,7 +371,7 @@ export class VerticalStackedBarChartBase extends React.Component< this._additionalSpace = 0.5 * this._barWidth; const { theme } = this.props; const { palette } = theme!; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated this._colors = this.props.colors || [palette.blueLight, palette.blue, palette.blueMid, palette.red, palette.black]; this._xAxisType = getTypeOfAxis(this.props.data[0].xAxisPoint, true) as XAxisTypes; this._lineObject = this._getFormattedLineData(this.props.data); diff --git a/packages/react-checkbox/src/index.ts b/packages/react-checkbox/src/index.ts index ccff4e2208938..5d98138391c98 100644 --- a/packages/react-checkbox/src/index.ts +++ b/packages/react-checkbox/src/index.ts @@ -1,6 +1,6 @@ export { Checkbox, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated checkboxClassName, checkboxClassNames, renderCheckbox_unstable, diff --git a/packages/react-components/src/DocsComponents/FluentDocsContainer.stories.tsx b/packages/react-components/src/DocsComponents/FluentDocsContainer.stories.tsx index e552e087f799e..7192640ee0160 100644 --- a/packages/react-components/src/DocsComponents/FluentDocsContainer.stories.tsx +++ b/packages/react-components/src/DocsComponents/FluentDocsContainer.stories.tsx @@ -13,7 +13,7 @@ interface FluentDocsContainerProps { * A container that wraps storybook's native docs container to add extra components to the docs experience */ export const FluentDocsContainer: React.FC = ({ children, context }) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const selectedTheme = themes.find(theme => theme.id === context.globals[THEME_ID]); const hosted = isHosted(); return ( @@ -21,7 +21,7 @@ export const FluentDocsContainer: React.FC = ({ childr {!hosted && ( diff --git a/packages/react-components/src/index.ts b/packages/react-components/src/index.ts index 8bcf94e411b0c..e4f35a3ca77d6 100644 --- a/packages/react-components/src/index.ts +++ b/packages/react-components/src/index.ts @@ -11,7 +11,6 @@ export { } from '@griffel/react'; export { FluentProvider, - /* eslint-disable-next-line deprecation/deprecation */ fluentProviderClassName, fluentProviderClassNames, renderFluentProvider_unstable, @@ -65,13 +64,9 @@ export { AccordionItem, AccordionItemContext, AccordionPanel, - /* eslint-disable-next-line deprecation/deprecation */ accordionClassName, - /* eslint-disable-next-line deprecation/deprecation */ accordionHeaderClassName, - /* eslint-disable-next-line deprecation/deprecation */ accordionItemClassName, - /* eslint-disable-next-line deprecation/deprecation */ accordionPanelClassName, accordionClassNames, accordionHeaderClassNames, @@ -123,7 +118,6 @@ export type { } from '@fluentui/react-accordion'; export { Avatar, - /* eslint-disable-next-line deprecation/deprecation */ avatarClassName, avatarClassNames, renderAvatar_unstable, @@ -135,11 +129,8 @@ export { Badge, CounterBadge, PresenceBadge, - /* eslint-disable-next-line deprecation/deprecation */ badgeClassName, - /* eslint-disable-next-line deprecation/deprecation */ counterBadgeClassName, - /* eslint-disable-next-line deprecation/deprecation */ presenceBadgeClassName, badgeClassNames, counterBadgeClassNames, @@ -167,11 +158,8 @@ export { MenuButton, SplitButton, ToggleButton, - /* eslint-disable-next-line deprecation/deprecation */ buttonClassName, - /* eslint-disable-next-line deprecation/deprecation */ compoundButtonClassName, - /* eslint-disable-next-line deprecation/deprecation */ menuButtonClassName, buttonClassNames, compoundButtonClassNames, @@ -181,9 +169,7 @@ export { renderMenuButton_unstable, renderSplitButton_unstable, renderToggleButton_unstable, - /* eslint-disable-next-line deprecation/deprecation */ splitButtonClassName, - /* eslint-disable-next-line deprecation/deprecation */ toggleButtonClassName, splitButtonClassNames, toggleButtonClassNames, @@ -216,7 +202,6 @@ export type { } from '@fluentui/react-button'; export { Divider, - /* eslint-disable-next-line deprecation/deprecation */ dividerClassName, dividerClassNames, renderDivider_unstable, @@ -226,7 +211,6 @@ export { export type { DividerProps, DividerSlots, DividerState } from '@fluentui/react-divider'; export { Image, - /* eslint-disable-next-line deprecation/deprecation */ imageClassName, imageClassNames, renderImage_unstable, @@ -236,7 +220,6 @@ export { export type { ImageProps, ImageSlots, ImageState } from '@fluentui/react-image'; export { Link, - /* eslint-disable-next-line deprecation/deprecation */ linkClassName, linkClassNames, renderLink_unstable, @@ -263,23 +246,14 @@ export { MenuSplitGroup, MenuTrigger, MenuTriggerContextProvider, - /* eslint-disable-next-line deprecation/deprecation */ menuDividerClassName, - /* eslint-disable-next-line deprecation/deprecation */ menuGroupClassName, - /* eslint-disable-next-line deprecation/deprecation */ menuGroupHeaderClassName, - /* eslint-disable-next-line deprecation/deprecation */ menuItemCheckboxClassName, - /* eslint-disable-next-line deprecation/deprecation */ menuItemClassName, - /* eslint-disable-next-line deprecation/deprecation */ menuItemRadioClassName, - /* eslint-disable-next-line deprecation/deprecation */ menuListClassName, - /* eslint-disable-next-line deprecation/deprecation */ menuPopoverClassName, - /* eslint-disable-next-line deprecation/deprecation */ menuSplitGroupClassName, menuDividerClassNames, menuGroupClassNames, @@ -383,7 +357,6 @@ export { PopoverSurface, PopoverTrigger, arrowHeights, - /* eslint-disable-next-line deprecation/deprecation */ popoverSurfaceClassName, popoverSurfaceClassNames, renderPopover_unstable, @@ -427,15 +400,10 @@ export { Title1, Title2, Title3, - /* eslint-disable-next-line deprecation/deprecation */ bodyClassName, - /* eslint-disable-next-line deprecation/deprecation */ captionClassName, - /* eslint-disable-next-line deprecation/deprecation */ displayClassName, - /* eslint-disable-next-line deprecation/deprecation */ headlineClassName, - /* eslint-disable-next-line deprecation/deprecation */ largeTitleClassName, bodyClassNames, captionClassNames, @@ -443,15 +411,10 @@ export { headlineClassNames, largeTitleClassNames, renderText_unstable, - /* eslint-disable-next-line deprecation/deprecation */ subheadlineClassName, - /* eslint-disable-next-line deprecation/deprecation */ textClassName, - /* eslint-disable-next-line deprecation/deprecation */ title1ClassName, - /* eslint-disable-next-line deprecation/deprecation */ title2ClassName, - /* eslint-disable-next-line deprecation/deprecation */ title3ClassName, subheadlineClassNames, textClassNames, @@ -465,7 +428,6 @@ export type { TextProps, TextSlots, TextState } from '@fluentui/react-text'; export { Tooltip, renderTooltip_unstable, - /* eslint-disable-next-line deprecation/deprecation */ tooltipClassName, tooltipClassNames, useTooltip_unstable, diff --git a/packages/react-components/src/unstable/index.ts b/packages/react-components/src/unstable/index.ts index 7d5ac475137f4..a978a46a34d03 100644 --- a/packages/react-components/src/unstable/index.ts +++ b/packages/react-components/src/unstable/index.ts @@ -5,13 +5,9 @@ export { CardFooter, CardHeader, CardPreview, - /* eslint-disable-next-line deprecation/deprecation */ cardClassName, - /* eslint-disable-next-line deprecation/deprecation */ cardFooterClassName, - /* eslint-disable-next-line deprecation/deprecation */ cardHeaderClassName, - /* eslint-disable-next-line deprecation/deprecation */ cardPreviewClassName, cardClassNames, cardFooterClassNames, @@ -47,7 +43,6 @@ export type { export { Checkbox, - /* eslint-disable-next-line deprecation/deprecation */ checkboxClassName, checkboxClassNames, renderCheckbox_unstable, @@ -58,7 +53,6 @@ export type { CheckboxOnChangeData, CheckboxProps, CheckboxSlots, CheckboxState export { Input, - /* eslint-disable-next-line deprecation/deprecation */ inputClassName, inputClassNames, renderInput_unstable, @@ -69,7 +63,6 @@ export type { InputOnChangeData, InputProps, InputSlots, InputState } from '@flu export { Label, - /* eslint-disable-next-line deprecation/deprecation */ labelClassName, labelClassNames, renderLabel_unstable, @@ -80,11 +73,9 @@ export type { LabelProps, LabelSlots, LabelState } from '@fluentui/react-label'; export { Radio, - /* eslint-disable-next-line deprecation/deprecation */ radioClassName, radioClassNames, RadioGroup, - /* eslint-disable-next-line deprecation/deprecation */ radioGroupClassName, radioGroupClassNames, renderRadio_unstable, @@ -125,14 +116,12 @@ export type { SwitchOnChangeData, SwitchProps, SwitchSlots, SwitchState } from ' export { Tab, - /* eslint-disable-next-line deprecation/deprecation */ tabClassName, tabClassNames, useTab_unstable, useTabStyles_unstable, renderTab_unstable, TabList, - /* eslint-disable-next-line deprecation/deprecation */ tabListClassName, tabListClassNames, useTabList_unstable, diff --git a/packages/react-date-time/src/Calendar.ts b/packages/react-date-time/src/Calendar.ts index c324c90de538b..e34994492fadc 100644 --- a/packages/react-date-time/src/Calendar.ts +++ b/packages/react-date-time/src/Calendar.ts @@ -6,7 +6,7 @@ export { FirstWeekOfYear, defaultCalendarNavigationIcons, defaultCalendarStrings, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated defaultDayPickerStrings, } from '@fluentui/react/lib/Calendar'; export type { @@ -19,9 +19,9 @@ export type { ICalendarDayProps, ICalendarDayStyleProps, ICalendarDayStyles, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated ICalendarFormatDateCallbacks, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated ICalendarIconStrings, ICalendarMonth, ICalendarMonthProps, diff --git a/packages/react-date-time/src/DatePicker.ts b/packages/react-date-time/src/DatePicker.ts index 6fe5758c453b6..5f08e46c64372 100644 --- a/packages/react-date-time/src/DatePicker.ts +++ b/packages/react-date-time/src/DatePicker.ts @@ -6,9 +6,9 @@ export { } from '@fluentui/react/lib/DatePicker'; export type { ICalendar, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated ICalendarFormatDateCallbacks, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated ICalendarIconStrings, ICalendarNavigationIcons, ICalendarProps, diff --git a/packages/react-dialog/src/index.ts b/packages/react-dialog/src/index.ts index 3e7b255db1a1d..1bbcea5c78e6c 100644 --- a/packages/react-dialog/src/index.ts +++ b/packages/react-dialog/src/index.ts @@ -1,6 +1,6 @@ export { Dialog, - // eslint-disable-next-line deprecation/deprecation -- https://github.com/microsoft/fluentui/pull/21960#issuecomment-1068991851 + // eslint-disable-next-line etc/no-deprecated -- https://github.com/microsoft/fluentui/pull/21960#issuecomment-1068991851 dialogClassName, dialogClassNames, renderDialog_unstable, diff --git a/packages/react-divider/src/index.ts b/packages/react-divider/src/index.ts index 4a41da90d3526..0620623cd47ba 100644 --- a/packages/react-divider/src/index.ts +++ b/packages/react-divider/src/index.ts @@ -1,6 +1,6 @@ export { Divider, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated dividerClassName, dividerClassNames, renderDivider_unstable, diff --git a/packages/react-docsite-components/.eslintrc.json b/packages/react-docsite-components/.eslintrc.json index a6ecfa7038e6b..f98eab7d170a1 100644 --- a/packages/react-docsite-components/.eslintrc.json +++ b/packages/react-docsite-components/.eslintrc.json @@ -2,6 +2,6 @@ "extends": ["plugin:@fluentui/eslint-plugin/react--legacy"], "root": true, "rules": { - "deprecation/deprecation": "off" + "etc/no-deprecated": "off" } } diff --git a/packages/react-examples/src/react-experiments/Chiclet/Chiclet.Footer.Example.tsx b/packages/react-examples/src/react-experiments/Chiclet/Chiclet.Footer.Example.tsx index cd65ecd17f25f..180b346287ec7 100644 --- a/packages/react-examples/src/react-experiments/Chiclet/Chiclet.Footer.Example.tsx +++ b/packages/react-examples/src/react-experiments/Chiclet/Chiclet.Footer.Example.tsx @@ -63,7 +63,7 @@ export const ChicletFooterExample: React.FunctionComponent<{}> = () => { ); }; -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated export interface IFooterComponent extends React.Props { buttonProps: IButtonProps[]; activities: string; diff --git a/packages/react-examples/src/react-experiments/Chiclet/Chiclet.Xsmall.Footer.Example.tsx b/packages/react-examples/src/react-experiments/Chiclet/Chiclet.Xsmall.Footer.Example.tsx index 708ee73230c30..7c135c0bc00f2 100644 --- a/packages/react-examples/src/react-experiments/Chiclet/Chiclet.Xsmall.Footer.Example.tsx +++ b/packages/react-examples/src/react-experiments/Chiclet/Chiclet.Xsmall.Footer.Example.tsx @@ -65,7 +65,7 @@ class FooterComponent extends React.Component { } } -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated interface IFooterComponent extends React.Props { buttonProps: IButtonProps[]; attachProps: IIconProps; diff --git a/packages/react-examples/src/react-experiments/CollapsibleSection/CollapsibleSection.Styled.Example.tsx b/packages/react-examples/src/react-experiments/CollapsibleSection/CollapsibleSection.Styled.Example.tsx index 3dceaeca9974f..552c38e2a68f4 100644 --- a/packages/react-examples/src/react-experiments/CollapsibleSection/CollapsibleSection.Styled.Example.tsx +++ b/packages/react-examples/src/react-experiments/CollapsibleSection/CollapsibleSection.Styled.Example.tsx @@ -12,7 +12,7 @@ import { } from '@fluentui/react-experiments/lib/CollapsibleSection'; // Workaround to prevent errors on usage of Customizer in this file, without disabling all deprecation checks -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated const Customizer = DeprecatedCustomizer; const getPropStyles: ICollapsibleSectionComponent['styles'] = (props, theme): ICollapsibleSectionStylesReturnType => ({ diff --git a/packages/react-examples/src/react-experiments/FloatingPeopleSuggestions/FloatingPeopleSuggestions.HeaderFooter.Example.tsx b/packages/react-examples/src/react-experiments/FloatingPeopleSuggestions/FloatingPeopleSuggestions.HeaderFooter.Example.tsx index 6706413884d65..76e15a3d5d570 100644 --- a/packages/react-examples/src/react-experiments/FloatingPeopleSuggestions/FloatingPeopleSuggestions.HeaderFooter.Example.tsx +++ b/packages/react-examples/src/react-experiments/FloatingPeopleSuggestions/FloatingPeopleSuggestions.HeaderFooter.Example.tsx @@ -186,7 +186,7 @@ export const FloatingPeopleSuggestionsHeaderFooterExample = (): JSX.Element => { }; const _onInputKeyDown = (ev: React.KeyboardEvent) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const keyCode = ev.which; switch (keyCode) { case KeyCodes.enter: diff --git a/packages/react-examples/src/react-experiments/Slider/Slider.Example.tsx b/packages/react-examples/src/react-experiments/Slider/Slider.Example.tsx index c21925e3cd828..9f636288b8fbd 100644 --- a/packages/react-examples/src/react-experiments/Slider/Slider.Example.tsx +++ b/packages/react-examples/src/react-experiments/Slider/Slider.Example.tsx @@ -3,7 +3,7 @@ import { Slider as DeprecatedSlider } from '@fluentui/react-experiments'; import { IStackTokens, Stack } from '@fluentui/react'; // Workaround to prevent errors on usage of Slider, without disabling all deprecation checks -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated const Slider = DeprecatedSlider; export interface ISliderBasicExampleState { diff --git a/packages/react-examples/src/react-experiments/Slider/Slider.Vertical.Example.tsx b/packages/react-examples/src/react-experiments/Slider/Slider.Vertical.Example.tsx index 0bad5853589d4..2427d2a45b4e7 100644 --- a/packages/react-examples/src/react-experiments/Slider/Slider.Vertical.Example.tsx +++ b/packages/react-examples/src/react-experiments/Slider/Slider.Vertical.Example.tsx @@ -3,7 +3,7 @@ import { Slider as DeprecatedSlider } from '@fluentui/react-experiments'; import { IStackTokens, Stack } from '@fluentui/react/lib/Stack'; // Workaround to prevent errors on usage of Slider, without disabling all deprecation checks -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated const Slider = DeprecatedSlider; export interface ISliderVerticalExampleState { diff --git a/packages/react-examples/src/react-experiments/Theming/Theming.Schemes.Custom.Example.tsx b/packages/react-examples/src/react-experiments/Theming/Theming.Schemes.Custom.Example.tsx index 841b24ed2754e..4b2d115b09709 100644 --- a/packages/react-examples/src/react-experiments/Theming/Theming.Schemes.Custom.Example.tsx +++ b/packages/react-examples/src/react-experiments/Theming/Theming.Schemes.Custom.Example.tsx @@ -26,7 +26,7 @@ import { CollapsibleSectionRecursiveExample } from '@fluentui/react-examples/lib import { ThemeProvider as DeprecatedThemeProvider } from '@fluentui/foundation-legacy'; // Workaround to prevent errors on usage of ThemeProvider, without disabling all deprecation checks -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated const ThemeProvider = DeprecatedThemeProvider; const regionStyles: IStackComponent['styles'] = (props, theme): IStackStylesReturnType => ({ @@ -186,7 +186,7 @@ export class ThemingSchemesCustomExample extends React.Component<{}, IThemingExa }; public render(): JSX.Element { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated return {this._renderSchemedComponents()}; } @@ -270,7 +270,7 @@ export class ThemingSchemesCustomExample extends React.Component<{}, IThemingExa }; } -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated const onCommandClick = (ev: any, item?: ICommandBarItemProps) => console.log(item && (item.text || item.name)); const items: ICommandBarItemProps[] = [ { diff --git a/packages/react-examples/src/react-experiments/Theming/Theming.Schemes.Variant.Example.tsx b/packages/react-examples/src/react-experiments/Theming/Theming.Schemes.Variant.Example.tsx index bb9dff394be38..9891fcad7cae5 100644 --- a/packages/react-examples/src/react-experiments/Theming/Theming.Schemes.Variant.Example.tsx +++ b/packages/react-examples/src/react-experiments/Theming/Theming.Schemes.Variant.Example.tsx @@ -25,7 +25,7 @@ import { CollapsibleSectionRecursiveExample } from '@fluentui/react-examples/lib import { ThemeProvider as DeprecatedThemeProvider } from '@fluentui/foundation-legacy'; // Workaround to prevent errors on usage of ThemeProvider, without disabling all deprecation checks -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated const ThemeProvider = DeprecatedThemeProvider; const regionStyles: IStackComponent['styles'] = (props, theme): IStackStylesReturnType => ({ @@ -65,7 +65,7 @@ export class ThemingSchemesVariantExample extends React.Component<{}, IThemingEx }; public render(): JSX.Element { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated return {this._renderSchemedComponents()}; } @@ -149,7 +149,7 @@ export class ThemingSchemesVariantExample extends React.Component<{}, IThemingEx }; } -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated const onCommandClick = (ev: any, item?: ICommandBarItemProps) => console.log(item && (item.text || item.name)); const items: ICommandBarItemProps[] = [ { diff --git a/packages/react-examples/src/react-experiments/UnifiedPeoplePicker/UnifiedPeoplePicker.WithEdit.Example.tsx b/packages/react-examples/src/react-experiments/UnifiedPeoplePicker/UnifiedPeoplePicker.WithEdit.Example.tsx index c7222cbccc2ab..fdee14bc27748 100644 --- a/packages/react-examples/src/react-experiments/UnifiedPeoplePicker/UnifiedPeoplePicker.WithEdit.Example.tsx +++ b/packages/react-examples/src/react-experiments/UnifiedPeoplePicker/UnifiedPeoplePicker.WithEdit.Example.tsx @@ -339,7 +339,7 @@ export const UnifiedPeoplePickerWithEditExample = (): JSX.Element => { const _onKeyDown = React.useCallback( (ev: React.KeyboardEvent) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.ctrlKey && ev.which === KeyCodes.k) { ev.preventDefault(); // If the input has text, resolve that diff --git a/packages/react-examples/src/react-focus/FocusZone/FocusZone.List.Example.tsx b/packages/react-examples/src/react-focus/FocusZone/FocusZone.List.Example.tsx index 9db97e849c0e3..92b82a7d69cb2 100644 --- a/packages/react-examples/src/react-focus/FocusZone/FocusZone.List.Example.tsx +++ b/packages/react-examples/src/react-focus/FocusZone/FocusZone.List.Example.tsx @@ -75,6 +75,6 @@ export const FocusZoneListExample: React.FunctionComponent = () => { }; function _shouldEnterInnerZone(ev: React.KeyboardEvent): boolean { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated return ev.which === getRTLSafeKeyCode(KeyCodes.right); } diff --git a/packages/react-examples/src/react/Modal/Modal.Basic.Example.tsx b/packages/react-examples/src/react/Modal/Modal.Basic.Example.tsx index 9c75e1a109520..73015e1c64d6d 100644 --- a/packages/react-examples/src/react/Modal/Modal.Basic.Example.tsx +++ b/packages/react-examples/src/react/Modal/Modal.Basic.Example.tsx @@ -121,7 +121,7 @@ const contentStyles = mergeStyleSets({ alignItems: 'stretch', }, header: [ - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated theme.fonts.xLargePlus, { flex: '1 1 auto', diff --git a/packages/react-examples/src/react/Modal/Modal.Modeless.Example.tsx b/packages/react-examples/src/react/Modal/Modal.Modeless.Example.tsx index aa5f7c68f53b2..4879ed678d9d7 100644 --- a/packages/react-examples/src/react/Modal/Modal.Modeless.Example.tsx +++ b/packages/react-examples/src/react/Modal/Modal.Modeless.Example.tsx @@ -81,7 +81,7 @@ const contentStyles = mergeStyleSets({ alignItems: 'stretch', }, header: [ - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated theme.fonts.xLargePlus, { flex: '1 1 auto', diff --git a/packages/react-examples/src/react/Panel/Panel.HandleDismissTarget.Example.tsx b/packages/react-examples/src/react/Panel/Panel.HandleDismissTarget.Example.tsx index c831c39c66c85..b12831f187cd9 100644 --- a/packages/react-examples/src/react/Panel/Panel.HandleDismissTarget.Example.tsx +++ b/packages/react-examples/src/react/Panel/Panel.HandleDismissTarget.Example.tsx @@ -19,7 +19,7 @@ export const PanelHandleDismissTargetExample: React.FunctionComponent = () => { // Demonstrates how to do different things depending on how which element dismissed the panel console.log('Close button clicked or light dismissed.'); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const srcElement = ev.nativeEvent.srcElement as Element | null; if (srcElement && srcElement.className.indexOf('ms-Button-icon') !== -1) { console.log('Close button clicked.'); diff --git a/packages/react-experiments/src/Foundation.ts b/packages/react-experiments/src/Foundation.ts index dfe2afe37e74a..2bb3b9c9ca7ba 100644 --- a/packages/react-experiments/src/Foundation.ts +++ b/packages/react-experiments/src/Foundation.ts @@ -1,5 +1,5 @@ export { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated ThemeProvider, createComponent, createFactory, @@ -22,7 +22,7 @@ export type { IHTMLElementSlot, IHTMLSlot, IProcessedSlotProps, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated IPropsWithChildren, ISlot, ISlotCreator, diff --git a/packages/react-experiments/src/Styling.ts b/packages/react-experiments/src/Styling.ts index 111832e8c1e5e..b1d27e4d3bc8e 100644 --- a/packages/react-experiments/src/Styling.ts +++ b/packages/react-experiments/src/Styling.ts @@ -38,11 +38,11 @@ export { createTheme, focusClear, fontFace, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated getEdgeChromiumNoHighContrastAdjustSelector, getFadedOverflowStyle, getFocusOutlineStyle, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated getFocusStyle, getGlobalClassNames, getHighContrastNoAdjustStyle, diff --git a/packages/react-experiments/src/Utilities.ts b/packages/react-experiments/src/Utilities.ts index 24bf528b1bb7b..da9560d1a4a7f 100644 --- a/packages/react-experiments/src/Utilities.ts +++ b/packages/react-experiments/src/Utilities.ts @@ -1,10 +1,10 @@ export { Async, AutoScroll, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated BaseComponent, Customizations, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated Customizer, CustomizerContext, DATA_IS_SCROLLABLE_ATTRIBUTE, @@ -86,7 +86,7 @@ export { getRTL, getRTLSafeKeyCode, getRect, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated getResourceUrl, getScrollbarWidth, getVirtualParent, @@ -98,11 +98,11 @@ export { hoistStatics, htmlElementProperties, iframeProperties, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated imageProperties, imgProperties, initializeComponentRef, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated initializeFocusRects, inputProperties, isControlled, @@ -134,7 +134,7 @@ export { optionProperties, portalContainsElement, precisionRound, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated raiseClick, removeIndex, replaceElement, @@ -144,10 +144,10 @@ export { safeRequestAnimationFrame, safeSetTimeout, selectProperties, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated setBaseUrl, setFocusVisibility, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated setLanguage, setMemoizeWeakMap, setPortalAttribute, @@ -182,7 +182,7 @@ export type { ICancelable, IChangeDescription, IChangeEventCallback, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated IClassNames, IClassNamesFunctionOptions, IComponentAs, @@ -205,7 +205,7 @@ export type { IPerfData, IPerfMeasurement, IPerfSummary, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated IPoint, IPropsWithStyles, IRectangle, @@ -224,13 +224,13 @@ export type { IStyleFunctionOrObject, IVirtualElement, IWarnControlledUsageParams, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated Omit, Point, RefObject, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated Settings, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated SettingsFunction, StyleFunction, } from '@fluentui/react/lib/Utilities'; diff --git a/packages/react-experiments/src/components/BAFAccordion/Accordion.tsx b/packages/react-experiments/src/components/BAFAccordion/Accordion.tsx index 5b06a20205cf0..8d0e4482d15d9 100644 --- a/packages/react-experiments/src/components/BAFAccordion/Accordion.tsx +++ b/packages/react-experiments/src/components/BAFAccordion/Accordion.tsx @@ -33,7 +33,7 @@ export class Accordion extends React.Component } public render(): JSX.Element { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { onRenderMenu, className, buttonAs, onClick, ...other } = this.props; let { menuIconProps } = this.props; diff --git a/packages/react-experiments/src/components/CollapsibleSection/CollapsibleSection.state.tsx b/packages/react-experiments/src/components/CollapsibleSection/CollapsibleSection.state.tsx index cab2749647b46..838175a911f70 100644 --- a/packages/react-experiments/src/components/CollapsibleSection/CollapsibleSection.state.tsx +++ b/packages/react-experiments/src/components/CollapsibleSection/CollapsibleSection.state.tsx @@ -38,12 +38,12 @@ export const useCollapsibleSectionState: ICollapsibleSectionComponent['state'] = const collapseKey = getRTL() ? KeyCodes.right : KeyCodes.left; const expandKey = getRTL() ? KeyCodes.left : KeyCodes.right; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which === collapseKey && !collapsed) { setCollapsed(true); ev.preventDefault(); ev.stopPropagation(); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated } else if (ev.which === expandKey && collapsed) { setCollapsed(false); ev.preventDefault(); @@ -59,7 +59,7 @@ export const useCollapsibleSectionState: ICollapsibleSectionComponent['state'] = // If left/right keypress originates from text input or text area inside collapsible section, // ignore the event. if ( - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated ev.which === rootKey && ev.target !== titleElementRef.current && titleElementRef.current && diff --git a/packages/react-experiments/src/components/FloatingSuggestions/FloatingSuggestions.tsx b/packages/react-experiments/src/components/FloatingSuggestions/FloatingSuggestions.tsx index 5a2a8750aa869..f5400c86492f2 100644 --- a/packages/react-experiments/src/components/FloatingSuggestions/FloatingSuggestions.tsx +++ b/packages/react-experiments/src/components/FloatingSuggestions/FloatingSuggestions.tsx @@ -249,7 +249,7 @@ export class FloatingSuggestions ) { return; } - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const keyCode = ev.which; switch (keyCode) { case KeyCodes.escape: diff --git a/packages/react-experiments/src/components/FolderCover/FolderCover.types.ts b/packages/react-experiments/src/components/FolderCover/FolderCover.types.ts index a93109a9ccf97..559ae5a1e3aec 100644 --- a/packages/react-experiments/src/components/FolderCover/FolderCover.types.ts +++ b/packages/react-experiments/src/components/FolderCover/FolderCover.types.ts @@ -38,6 +38,6 @@ export interface IFolderCoverProps extends IBaseProps, React.HTMLAttributes['children'] | ((childrenProps: IFolderCoverChildrenProps) => JSX.Element | null); } diff --git a/packages/react-experiments/src/components/SelectedItemsList/Items/subcomponents/DefaultEditingItem.tsx b/packages/react-experiments/src/components/SelectedItemsList/Items/subcomponents/DefaultEditingItem.tsx index b922843485eac..a33dda4016cdd 100644 --- a/packages/react-experiments/src/components/SelectedItemsList/Items/subcomponents/DefaultEditingItem.tsx +++ b/packages/react-experiments/src/components/SelectedItemsList/Items/subcomponents/DefaultEditingItem.tsx @@ -195,7 +195,7 @@ export const DefaultEditingItemInner = ( const _onInputKeyDown = React.useCallback( (ev: React.KeyboardEvent): void => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const keyCode = ev.which; switch (keyCode) { case KeyCodes.backspace: diff --git a/packages/react-experiments/src/components/Sidebar/Sidebar.tsx b/packages/react-experiments/src/components/Sidebar/Sidebar.tsx index cd1a2ac140945..27631f6781378 100644 --- a/packages/react-experiments/src/components/Sidebar/Sidebar.tsx +++ b/packages/react-experiments/src/components/Sidebar/Sidebar.tsx @@ -162,7 +162,7 @@ export class Sidebar extends React.Component imple } const ButtonAs = this._getButtonAs(item); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const name = item.text || item.name; return ( @@ -212,7 +212,7 @@ export class Sidebar extends React.Component imple } const ButtonAs = this._getButtonAs(item); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const name = item.text || item.name; return ( @@ -276,7 +276,7 @@ export class Sidebar extends React.Component imple return child; }); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const name = item.text || item.name; if (name) { diff --git a/packages/react-experiments/src/components/UnifiedPicker/UnifiedPicker.tsx b/packages/react-experiments/src/components/UnifiedPicker/UnifiedPicker.tsx index 383ffa43be53c..06327de85eb6a 100644 --- a/packages/react-experiments/src/components/UnifiedPicker/UnifiedPicker.tsx +++ b/packages/react-experiments/src/components/UnifiedPicker/UnifiedPicker.tsx @@ -332,7 +332,7 @@ export const UnifiedPicker = (props: IUnifiedPickerProps): JSX. // Allow the caller to handle the key down onKeyDown?.(ev); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.ctrlKey && ev.which === KeyCodes.a) { selectAll(); } @@ -421,7 +421,7 @@ export const UnifiedPicker = (props: IUnifiedPickerProps): JSX. const _onInputKeyDown = React.useCallback( (ev: React.KeyboardEvent) => { if (isSuggestionsShown) { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const keyCode = ev.which; switch (keyCode) { case KeyCodes.escape: diff --git a/packages/react-focus/src/components/FocusZone/FocusZone.tsx b/packages/react-focus/src/components/FocusZone/FocusZone.tsx index 63d49c4c96710..b2768c0ec9521 100644 --- a/packages/react-focus/src/components/FocusZone/FocusZone.tsx +++ b/packages/react-focus/src/components/FocusZone/FocusZone.tsx @@ -160,7 +160,7 @@ export class FocusZone extends React.Component implements IFocu * for ref counting to work correctly! */ private static _onKeyDownCapture(ev: KeyboardEvent): void { - // eslint-disable-next-line deprecation/deprecation, @fluentui/deprecated-keyboard-event-props + // eslint-disable-next-line etc/no-deprecated, @fluentui/deprecated-keyboard-event-props if (ev.which === KeyCodes.tab) { _outerZones.forEach((zone: FocusZone) => zone._updateTabIndexes()); } @@ -227,9 +227,9 @@ export class FocusZone extends React.Component implements IFocu if (this.props.defaultTabbableElement && typeof this.props.defaultTabbableElement === 'string') { this._activeElement = this._getDocument().querySelector(this.props.defaultTabbableElement) as HTMLElement; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated } else if (this.props.defaultActiveElement) { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated this._activeElement = this._getDocument().querySelector(this.props.defaultActiveElement) as HTMLElement; } @@ -285,7 +285,7 @@ export class FocusZone extends React.Component implements IFocu } public render(): React.ReactNode { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { as: tag, elementType, rootProps, ariaDescribedBy, ariaLabelledBy, className } = this.props; const divProps = getNativeProps(this.props, htmlElementProperties); @@ -317,7 +317,7 @@ export class FocusZone extends React.Component implements IFocu // be replaced so that className is passed to getRootClass and is included there so // the class names will always be in the same order. className={css(getRootClass(), className)} - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated ref={this._mergedRef(this.props.elementRef, this._root)} data-focuszone-id={this._id} // eslint-disable-next-line react/jsx-no-bind @@ -392,7 +392,7 @@ export class FocusZone extends React.Component implements IFocu * @returns True if focus could be set to an active element, false if no operation was taken. */ public focusElement(element: HTMLElement, forceAlignment?: boolean): boolean { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { onBeforeFocus, shouldReceiveFocus } = this.props; if ((shouldReceiveFocus && !shouldReceiveFocus(element)) || (onBeforeFocus && !onBeforeFocus(element))) { @@ -444,10 +444,10 @@ export class FocusZone extends React.Component implements IFocu const { onActiveElementChanged, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated doNotAllowFocusEventToPropagate, stopFocusPropagation, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated onFocusNotification, onFocus, shouldFocusInnerElementWhenReceivedFocus, @@ -625,7 +625,7 @@ export class FocusZone extends React.Component implements IFocu return; } - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { direction, disabled, isInnerZoneKeystroke, pagingSupportDisabled, shouldEnterInnerZone } = this.props; if (disabled) { @@ -732,7 +732,7 @@ export class FocusZone extends React.Component implements IFocu case KeyCodes.tab: if ( - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated this.props.allowTabKey || this.props.handleTabKey === FocusZoneTabbableElements.all || (this.props.handleTabKey === FocusZoneTabbableElements.inputOnly && @@ -956,7 +956,7 @@ export class FocusZone extends React.Component implements IFocu private _moveFocusDown(): boolean { let targetTop = -1; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const leftAlignment = this._focusAlignment.left || this._focusAlignment.x || 0; if ( @@ -998,7 +998,7 @@ export class FocusZone extends React.Component implements IFocu private _moveFocusUp(): boolean { let targetTop = -1; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const leftAlignment = this._focusAlignment.left || this._focusAlignment.x || 0; if ( @@ -1127,7 +1127,7 @@ export class FocusZone extends React.Component implements IFocu activeRect: ClientRect, targetRect: ClientRect, ): number => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const leftAlignment = this._focusAlignment.left || this._focusAlignment.x || 0; // ClientRect values can be floats that differ by very small fractions of a decimal. // If the difference between top and bottom are within a pixel then we should treat diff --git a/packages/react-hooks/src/useMountSync.test.tsx b/packages/react-hooks/src/useMountSync.test.tsx index f7142f14a84fa..b2ed285425a09 100644 --- a/packages/react-hooks/src/useMountSync.test.tsx +++ b/packages/react-hooks/src/useMountSync.test.tsx @@ -7,7 +7,7 @@ describe('useMountSync', () => { const onMount = jest.fn(); const TestComponent: React.FunctionComponent = () => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated useMountSync(() => { onMount(); }); diff --git a/packages/react-image/src/index.ts b/packages/react-image/src/index.ts index 10ce1dbbc7503..c775e107d1979 100644 --- a/packages/react-image/src/index.ts +++ b/packages/react-image/src/index.ts @@ -1,6 +1,6 @@ export { Image, - // eslint-disable-next-line deprecation/deprecation -- https://github.com/microsoft/fluentui/pull/21960#issuecomment-1068991851 + // eslint-disable-next-line etc/no-deprecated -- https://github.com/microsoft/fluentui/pull/21960#issuecomment-1068991851 imageClassName, imageClassNames, renderImage_unstable, diff --git a/packages/react-input/src/index.ts b/packages/react-input/src/index.ts index c589cdad568f9..de4f9f2ee5c99 100644 --- a/packages/react-input/src/index.ts +++ b/packages/react-input/src/index.ts @@ -1,6 +1,6 @@ export { Input, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated inputClassName, inputClassNames, renderInput_unstable, diff --git a/packages/react-label/src/index.ts b/packages/react-label/src/index.ts index eb87fb37c8351..2f30d2e17d11c 100644 --- a/packages/react-label/src/index.ts +++ b/packages/react-label/src/index.ts @@ -1,6 +1,6 @@ export { Label, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated labelClassName, labelClassNames, renderLabel_unstable, diff --git a/packages/react-link/src/index.ts b/packages/react-link/src/index.ts index fdd9539f55213..fa84ea53061b1 100644 --- a/packages/react-link/src/index.ts +++ b/packages/react-link/src/index.ts @@ -1,6 +1,6 @@ export { Link, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated linkClassName, linkClassNames, renderLink_unstable, diff --git a/packages/react-storybook-addon/src/demos.stories.tsx b/packages/react-storybook-addon/src/demos.stories.tsx index 0bde1e4d3a4f3..7b62dc482980f 100644 --- a/packages/react-storybook-addon/src/demos.stories.tsx +++ b/packages/react-storybook-addon/src/demos.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { Button } from '@fluentui/react-button'; -import { Headline, Text } from '@fluentui/react-text'; +import { Headline, Text, hello } from '@fluentui/react-text'; import { action } from '@storybook/addon-actions'; export const Demos = () => { @@ -10,6 +10,7 @@ export const Demos = () => {
diff --git a/packages/react-text/src/index.ts b/packages/react-text/src/index.ts index 689b51c6a6a79..93ac537177c0f 100644 --- a/packages/react-text/src/index.ts +++ b/packages/react-text/src/index.ts @@ -1,4 +1,3 @@ -/* eslint-disable deprecation/deprecation -- https://github.com/microsoft/fluentui/pull/21960#issuecomment-1068991851 */ export { Text, renderText_unstable, diff --git a/packages/react-utilities/src/hooks/useOnClickOutside.ts b/packages/react-utilities/src/hooks/useOnClickOutside.ts index e3818236fb983..4b5303fb07867 100644 --- a/packages/react-utilities/src/hooks/useOnClickOutside.ts +++ b/packages/react-utilities/src/hooks/useOnClickOutside.ts @@ -89,11 +89,11 @@ export const useOnClickOutside = (options: UseOnClickOrScrollOutsideOptions) => const getWindowEvent = (target: Node | Window): Event | undefined => { if (target) { if (typeof (target as Window).window === 'object' && (target as Window).window === target) { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated return target.event; } - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated return (target as Node).ownerDocument?.defaultView?.event ?? undefined; } diff --git a/packages/react-utilities/src/ssr/canUseDOM.ts b/packages/react-utilities/src/ssr/canUseDOM.ts index 01520b98ccc7a..1bee765588c07 100644 --- a/packages/react-utilities/src/ssr/canUseDOM.ts +++ b/packages/react-utilities/src/ssr/canUseDOM.ts @@ -6,7 +6,7 @@ export function canUseDOM(): boolean { typeof window !== 'undefined' && !!( window.document && - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated window.document.createElement ) ); diff --git a/packages/react/src/Icons.ts b/packages/react/src/Icons.ts index 599092ba2b673..1d6750dd7e8f7 100644 --- a/packages/react/src/Icons.ts +++ b/packages/react/src/Icons.ts @@ -1,6 +1,6 @@ export { initializeIcons } from '@fluentui/font-icons-mdl2'; export type { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated IconNames, } from '@fluentui/font-icons-mdl2'; diff --git a/packages/react/src/Styling.ts b/packages/react/src/Styling.ts index 1df6046db8103..96be38db0d437 100644 --- a/packages/react/src/Styling.ts +++ b/packages/react/src/Styling.ts @@ -38,11 +38,11 @@ export { createFontStyles, focusClear, fontFace, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated getEdgeChromiumNoHighContrastAdjustSelector, getFadedOverflowStyle, getFocusOutlineStyle, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated getFocusStyle, getGlobalClassNames, getHighContrastNoAdjustStyle, diff --git a/packages/react/src/Utilities.ts b/packages/react/src/Utilities.ts index b621f8d0db30e..6346ac18eb4ca 100644 --- a/packages/react/src/Utilities.ts +++ b/packages/react/src/Utilities.ts @@ -2,10 +2,10 @@ import './version'; export { Async, AutoScroll, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated BaseComponent, Customizations, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated Customizer, CustomizerContext, DATA_IS_SCROLLABLE_ATTRIBUTE, @@ -87,7 +87,7 @@ export { getRTL, getRTLSafeKeyCode, getRect, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated getResourceUrl, getScrollbarWidth, getVirtualParent, @@ -99,11 +99,11 @@ export { hoistStatics, htmlElementProperties, iframeProperties, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated imageProperties, imgProperties, initializeComponentRef, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated initializeFocusRects, inputProperties, isControlled, @@ -135,7 +135,7 @@ export { optionProperties, portalContainsElement, precisionRound, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated raiseClick, removeIndex, replaceElement, @@ -145,10 +145,10 @@ export { safeRequestAnimationFrame, safeSetTimeout, selectProperties, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated setBaseUrl, setFocusVisibility, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated setLanguage, setMemoizeWeakMap, setPortalAttribute, @@ -183,7 +183,7 @@ export type { ICancelable, IChangeDescription, IChangeEventCallback, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated IClassNames, IClassNamesFunctionOptions, IComponentAs, @@ -206,7 +206,7 @@ export type { IPerfData, IPerfMeasurement, IPerfSummary, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated IPoint, IPropsWithStyles, IRectangle, @@ -225,13 +225,13 @@ export type { IStyleFunctionOrObject, IVirtualElement, IWarnControlledUsageParams, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated Omit, Point, RefObject, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated Settings, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated SettingsFunction, StyleFunction, } from '@fluentui/utilities'; diff --git a/packages/react/src/components/ActivityItem/ActivityItem.tsx b/packages/react/src/components/ActivityItem/ActivityItem.tsx index be14dc3200093..0ca6ad2f03655 100644 --- a/packages/react/src/components/ActivityItem/ActivityItem.tsx +++ b/packages/react/src/components/ActivityItem/ActivityItem.tsx @@ -57,7 +57,7 @@ export class ActivityItem extends React.Component { private _onRenderActivityDescription = (props: IActivityItemProps): JSX.Element | null => { const classNames = this._getClassNames(props); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const activityDescription = props.activityDescription || props.activityDescriptionText; if (activityDescription) { @@ -70,7 +70,7 @@ export class ActivityItem extends React.Component { private _onRenderComments = (props: IActivityItemProps): JSX.Element | null => { const classNames = this._getClassNames(props); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const comments = props.comments || props.commentText; if (!props.isCompact && comments) { @@ -117,7 +117,7 @@ export class ActivityItem extends React.Component { {...person} key={person.key || index} className={classNames.activityPersona} - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated size={showSize16Personas ? PersonaSize.size16 : PersonaSize.size32} style={style} />, diff --git a/packages/react/src/components/Announced/Announced.types.ts b/packages/react/src/components/Announced/Announced.types.ts index 77d6b7f9c487a..50b7d59f0ce58 100644 --- a/packages/react/src/components/Announced/Announced.types.ts +++ b/packages/react/src/components/Announced/Announced.types.ts @@ -6,7 +6,7 @@ import type { IStyleFunctionOrObject } from '../../Utilities'; /** * {@docCategory Announced} */ -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated export interface IAnnouncedProps extends React.Props, React.HTMLAttributes { /** * The status message the screen reader should announce. diff --git a/packages/react/src/components/Autofill/Autofill.tsx b/packages/react/src/components/Autofill/Autofill.tsx index 6638857287cd9..69e77737d38fe 100644 --- a/packages/react/src/components/Autofill/Autofill.tsx +++ b/packages/react/src/components/Autofill/Autofill.tsx @@ -29,9 +29,9 @@ export class Autofill extends React.Component im private _async: Async; public static getDerivedStateFromProps(props: IAutofillProps, state: IAutofillState): IAutofillState | null { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (props.updateValueInWillReceiveProps) { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const updatedInputValue = props.updateValueInWillReceiveProps(); // Don't update if we have a null value or the value isn't changing // the value should still update if an empty string is passed in @@ -232,7 +232,7 @@ export class Autofill extends React.Component im // Right now typing does not have isComposing, once that has been fixed any should be removed. if (!(ev.nativeEvent as any).isComposing) { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated switch (ev.which) { case KeyCodes.backspace: this._autoFillEnabled = false; @@ -246,7 +246,7 @@ export class Autofill extends React.Component im break; default: if (!this._autoFillEnabled) { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (this.props.enableAutofillOnKeyPress!.indexOf(ev.which) !== -1) { this._autoFillEnabled = true; } @@ -322,7 +322,7 @@ export class Autofill extends React.Component im return; } - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { onInputChange, onInputValueChange } = this.props; if (onInputChange) { newValue = onInputChange?.(newValue, composing) || ''; diff --git a/packages/react/src/components/Button/BaseButton.tsx b/packages/react/src/components/Button/BaseButton.tsx index 5360efebc128a..373947ddb9bb3 100644 --- a/packages/react/src/components/Button/BaseButton.tsx +++ b/packages/react/src/components/Button/BaseButton.tsx @@ -122,7 +122,7 @@ export class BaseButton extends React.Component { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { secondaryText = this.props.description } = props; // ms-Button-description is only shown when the button type is compound. @@ -739,7 +739,7 @@ export class BaseButton extends React.Component) => { // explicity cancelling event so click won't fire after this - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (this.props.disabled && (ev.which === KeyCodes.enter || ev.which === KeyCodes.space)) { ev.preventDefault(); ev.stopPropagation(); @@ -797,7 +797,7 @@ export class BaseButton extends React.Component) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which === KeyCodes.enter || ev.which === KeyCodes.space) { if (this._buttonElement.current) { this._buttonElement.current.click(); @@ -818,9 +818,9 @@ export class BaseButton extends React.Component, ): boolean { if (this.props.menuTriggerKeyCode) { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated return ev.which === this.props.menuTriggerKeyCode; } else if (this.props.menuProps) { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated return ev.which === KeyCodes.down && (ev.altKey || ev.metaKey); } diff --git a/packages/react/src/components/Button/Button.tsx b/packages/react/src/components/Button/Button.tsx index 0d5d40b7e22f4..3ee5ff35af8ae 100644 --- a/packages/react/src/components/Button/Button.tsx +++ b/packages/react/src/components/Button/Button.tsx @@ -27,7 +27,7 @@ export class Button extends React.Component { public render(): JSX.Element { const props = this.props; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated switch (props.buttonType) { case ButtonType.command: return ; diff --git a/packages/react/src/components/Calendar/Calendar.base.tsx b/packages/react/src/components/Calendar/Calendar.base.tsx index 73e66520c4e17..025847bb2926a 100644 --- a/packages/react/src/components/Calendar/Calendar.base.tsx +++ b/packages/react/src/components/Calendar/Calendar.base.tsx @@ -220,7 +220,7 @@ export const CalendarBase: React.FunctionComponent = React.forwa const onButtonKeyDown = (callback: () => void): ((ev: React.KeyboardEvent) => void) => { return (ev: React.KeyboardEvent) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated switch (ev.which) { case KeyCodes.enter: case KeyCodes.space: @@ -231,7 +231,7 @@ export const CalendarBase: React.FunctionComponent = React.forwa }; const onDatePickerPopupKeyDown = (ev: React.KeyboardEvent): void => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated switch (ev.which) { case KeyCodes.enter: ev.preventDefault(); diff --git a/packages/react/src/components/Calendar/CalendarDay/CalendarDay.base.tsx b/packages/react/src/components/Calendar/CalendarDay/CalendarDay.base.tsx index d3c4927ed9b0e..a3ecc096af356 100644 --- a/packages/react/src/components/Calendar/CalendarDay/CalendarDay.base.tsx +++ b/packages/react/src/components/Calendar/CalendarDay/CalendarDay.base.tsx @@ -188,7 +188,7 @@ const onButtonKeyDown = ( ): ((ev: React.KeyboardEvent) => void) => ( ev: React.KeyboardEvent, ) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated switch (ev.which) { case KeyCodes.enter: callback?.(); diff --git a/packages/react/src/components/Calendar/CalendarMonth/CalendarMonth.base.tsx b/packages/react/src/components/Calendar/CalendarMonth/CalendarMonth.base.tsx index 83414013d3146..7fc860479733e 100644 --- a/packages/react/src/components/Calendar/CalendarMonth/CalendarMonth.base.tsx +++ b/packages/react/src/components/Calendar/CalendarMonth/CalendarMonth.base.tsx @@ -347,7 +347,7 @@ function isCurrentMonth(month: number, year: number, today: Date): boolean { function onButtonKeyDown(callback: () => void): (ev: React.KeyboardEvent) => void { return (ev: React.KeyboardEvent) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated switch (ev.which) { case KeyCodes.enter: callback(); diff --git a/packages/react/src/components/Calendar/CalendarYear/CalendarYear.base.tsx b/packages/react/src/components/Calendar/CalendarYear/CalendarYear.base.tsx index 10eb5880f2f26..e8e7b07c70281 100644 --- a/packages/react/src/components/Calendar/CalendarYear/CalendarYear.base.tsx +++ b/packages/react/src/components/Calendar/CalendarYear/CalendarYear.base.tsx @@ -78,7 +78,7 @@ const CalendarYearGridCell: React.FunctionComponent }; const onKeyDown = (ev: React.KeyboardEvent) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which === KeyCodes.enter) { onSelectYear?.(year); } @@ -246,7 +246,7 @@ const CalendarYearNavArrow: React.FunctionComponent }; const onKeyDown = (ev: React.KeyboardEvent) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which === KeyCodes.enter) { onNavigate(); } @@ -308,7 +308,7 @@ const CalendarYearTitle: React.FunctionComponent = pro }; const onHeaderKeyDown = (ev: React.KeyboardEvent) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which === KeyCodes.enter || ev.which === KeyCodes.space) { onHeaderSelect(); } diff --git a/packages/react/src/components/CalendarDayGrid/CalendarGridDayCell.tsx b/packages/react/src/components/CalendarDayGrid/CalendarGridDayCell.tsx index 17298ea7b291b..50f2003d5049a 100644 --- a/packages/react/src/components/CalendarDayGrid/CalendarGridDayCell.tsx +++ b/packages/react/src/components/CalendarDayGrid/CalendarGridDayCell.tsx @@ -44,18 +44,18 @@ export const CalendarGridDayCell: React.FunctionComponent): void => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which === KeyCodes.enter) { onSelectDate?.(day.originalDate); } else { diff --git a/packages/react/src/components/Callout/CalloutContent.base.tsx b/packages/react/src/components/Callout/CalloutContent.base.tsx index 7e54f24121bcb..abeb9fe815287 100644 --- a/packages/react/src/components/Callout/CalloutContent.base.tsx +++ b/packages/react/src/components/Callout/CalloutContent.base.tsx @@ -258,11 +258,11 @@ function useDismissHandlers( { hidden, onDismiss, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated preventDismissOnScroll, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated preventDismissOnResize, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated preventDismissOnLostFocus, dismissOnTargetClick, shouldDismissOnWindowFocus, @@ -416,7 +416,7 @@ export const CalloutContentBase: React.FunctionComponent = React. backgroundColor, calloutMaxHeight, onScroll, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated shouldRestoreFocus = true, target, hidden, diff --git a/packages/react/src/components/Check/Check.styles.ts b/packages/react/src/components/Check/Check.styles.ts index 97640716acc9d..19f06eca9e2ce 100644 --- a/packages/react/src/components/Check/Check.styles.ts +++ b/packages/react/src/components/Check/Check.styles.ts @@ -12,7 +12,7 @@ export const CheckGlobalClassNames = { }; export const getStyles = (props: ICheckStyleProps): ICheckStyles => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { height = props.checkBoxHeight || '18px', checked, className, theme } = props; const { palette, semanticColors, fonts } = theme; diff --git a/packages/react/src/components/Coachmark/Coachmark.base.tsx b/packages/react/src/components/Coachmark/Coachmark.base.tsx index 5c80cc3b81516..0788b73243586 100644 --- a/packages/react/src/components/Coachmark/Coachmark.base.tsx +++ b/packages/react/src/components/Coachmark/Coachmark.base.tsx @@ -213,9 +213,9 @@ function useListeners( (e: KeyboardEvent) => { // Open coachmark if user presses ALT + C (arbitrary keypress for now) if ( - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated (e.altKey && e.which === KeyCodes.c) || - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated (e.which === KeyCodes.enter && translateAnimationContainer.current?.contains?.(e.target as Node)) ) { openCoachmark(); diff --git a/packages/react/src/components/ColorPicker/ColorPicker.base.tsx b/packages/react/src/components/ColorPicker/ColorPicker.base.tsx index ed3d7b33538e8..bf30904c49cf6 100644 --- a/packages/react/src/components/ColorPicker/ColorPicker.base.tsx +++ b/packages/react/src/components/ColorPicker/ColorPicker.base.tsx @@ -120,7 +120,7 @@ export class ColorPickerBase extends React.Component { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { theme, className, type = 'hue', isAlpha: useAlphaBackground = type !== 'hue' } = props; const { palette, effects } = theme; diff --git a/packages/react/src/components/ComboBox/ComboBox.tsx b/packages/react/src/components/ComboBox/ComboBox.tsx index 651f56f1d866c..6e291487035a5 100644 --- a/packages/react/src/components/ComboBox/ComboBox.tsx +++ b/packages/react/src/components/ComboBox/ComboBox.tsx @@ -1109,7 +1109,7 @@ class ComboBoxInternal extends React.Component): void => { // Do nothing if the blur is coming from something // inside the comboBox root or the comboBox menu since @@ -1946,7 +1946,7 @@ class ComboBoxInternal extends React.Component= 112 /* F1 */ && ev.which <= 123 /* F12 */) { return; } // If we get here and we got either and ALT key // or meta key, let the event propagate - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.keyCode === KeyCodes.alt || ev.key === 'Meta' /* && isOpen */) { return; } @@ -2140,7 +2140,7 @@ class ComboBoxInternal extends React.Component 123) /* F12 */ ) { ev.stopPropagation(); @@ -2457,6 +2457,6 @@ function getPreviewText(item: IComboBoxOption): string { * Returns true if the key for the event is alt (Mac option) or meta (Mac command). */ function isAltOrMeta(ev: React.KeyboardEvent): boolean { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated return ev.which === KeyCodes.alt || ev.key === 'Meta'; } diff --git a/packages/react/src/components/CommandBar/CommandBar.base.tsx b/packages/react/src/components/CommandBar/CommandBar.base.tsx index b4505275d48cc..576b56a8f7738 100644 --- a/packages/react/src/components/CommandBar/CommandBar.base.tsx +++ b/packages/react/src/components/CommandBar/CommandBar.base.tsx @@ -165,7 +165,7 @@ export class CommandBarBase extends React.Component implem return item.onRender(item, () => undefined); } - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const itemText = item.text || item.name; const commandButtonProps: ICommandBarItemProps = { allowDisabledFocus: true, @@ -212,7 +212,7 @@ export class CommandBarBase extends React.Component implem private _onButtonClick(item: ICommandBarItemProps): (ev: React.MouseEvent) => void { return ev => { // inactive is deprecated. remove check in 7.0 - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (item.inactive) { return; } diff --git a/packages/react/src/components/ContextualMenu/ContextualMenu.base.tsx b/packages/react/src/components/ContextualMenu/ContextualMenu.base.tsx index c91d6a946bdfc..a300caa511b10 100644 --- a/packages/react/src/components/ContextualMenu/ContextualMenu.base.tsx +++ b/packages/react/src/components/ContextualMenu/ContextualMenu.base.tsx @@ -78,7 +78,7 @@ export function getSubmenuItems( ): IContextualMenuItem[] | undefined { const target = options?.target; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const items = item.subMenuProps ? item.subMenuProps.items : item.items; if (items) { @@ -325,7 +325,7 @@ function useKeyHandlers( const shouldCloseSubMenu = (ev: React.KeyboardEvent): boolean => { const submenuCloseKey = getRTL(theme) ? KeyCodes.right : KeyCodes.left; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which !== submenuCloseKey || !isSubMenu) { return false; } @@ -338,10 +338,10 @@ function useKeyHandlers( const shouldHandleKeyDown = (ev: React.KeyboardEvent) => { return ( - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated ev.which === KeyCodes.escape || shouldCloseSubMenu(ev) || - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated (ev.which === KeyCodes.up && (ev.altKey || ev.metaKey)) ); }; @@ -352,7 +352,7 @@ function useKeyHandlers( lastKeyDownWasAltOrMeta.current = isAltOrMeta(ev); // On Mac, pressing escape dismisses all levels of native context menus - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const dismissAllMenus = ev.which === KeyCodes.escape && (isMac() || isIOS()); return keyHandler(ev, shouldHandleKeyDown, dismissAllMenus); @@ -390,9 +390,9 @@ function useKeyHandlers( // If we have a modifier key being pressed, we do not want to move focus. // Otherwise, handle up and down keys. const hasModifier = !!(ev.altKey || ev.metaKey); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const isUp = ev.which === KeyCodes.up; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const isDown = ev.which === KeyCodes.down; if (!hasModifier && (isUp || isDown)) { const elementToFocus = isUp @@ -412,7 +412,7 @@ function useKeyHandlers( if ( !item.disabled && - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated (ev.which === openKey || ev.which === KeyCodes.enter || (ev.which === KeyCodes.down && (ev.altKey || ev.metaKey))) ) { openSubMenu(item, ev.currentTarget as HTMLElement); @@ -742,7 +742,7 @@ export const ContextualMenuBase: React.FunctionComponent = const onDefaultRenderMenuList = ( menuListProps: IContextualMenuListProps, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated menuClassNames: IProcessedStyleSet | IContextualMenuClassNames, defaultRender?: IRenderFunction, ): JSX.Element => { @@ -787,7 +787,7 @@ export const ContextualMenuBase: React.FunctionComponent = totalItemCount: number, hasCheckmarks: boolean, hasIcons: boolean, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated menuClassNames: IProcessedStyleSet | IContextualMenuClassNames, ): JSX.Element => { const renderedItems: React.ReactNode[] = []; @@ -803,7 +803,7 @@ export const ContextualMenuBase: React.FunctionComponent = const dividerClassName = item.itemType === ContextualMenuItemType.Divider ? item.className : undefined; const subMenuIconClassName = item.submenuIconProps ? item.submenuIconProps.className : ''; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated let itemClassNames: IMenuItemClassNames; // IContextualMenuItem#getItemClassNames for backwards compatibility @@ -845,7 +845,7 @@ export const ContextualMenuBase: React.FunctionComponent = ); } - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (item.text === '-' || item.name === '-') { item.itemType = ContextualMenuItemType.Divider; } @@ -887,7 +887,7 @@ export const ContextualMenuBase: React.FunctionComponent = const defaultMenuItemRenderer = ( item: IContextualMenuItemRenderProps, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated menuClassNames: IProcessedStyleSet | IContextualMenuClassNames, ): React.ReactNode => { const { index, focusableElementIndex, totalItemCount, hasCheckmarks, hasIcons } = item; @@ -904,9 +904,9 @@ export const ContextualMenuBase: React.FunctionComponent = const renderSectionItem = ( sectionItem: IContextualMenuItem, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated itemClassNames: IMenuItemClassNames, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated menuClassNames: IProcessedStyleSet | IContextualMenuClassNames, index: number, hasCheckmarks: boolean, @@ -1072,9 +1072,9 @@ export const ContextualMenuBase: React.FunctionComponent = const renderHeaderMenuItem = ( item: IContextualMenuItem, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated itemClassNames: IMenuItemClassNames, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated menuClassNames: IProcessedStyleSet | IContextualMenuClassNames, index: number, hasCheckmarks: boolean, @@ -1085,7 +1085,7 @@ export const ContextualMenuBase: React.FunctionComponent = const divHtmlProperties = itemProps && getNativeProps>(itemProps, divProperties); return ( - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated
= defaultRender?: IRenderFunction, ) => onDefaultRenderMenuList(menuListProps, classNames, defaultRender), focusZoneProps, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated getMenuClassNames, } = props; @@ -1299,7 +1299,7 @@ ContextualMenuBase.displayName = 'ContextualMenuBase'; * Returns true if the key for the event is alt (Mac option) or meta (Mac command). */ function isAltOrMeta(ev: React.KeyboardEvent): boolean { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated return ev.which === KeyCodes.alt || ev.key === 'Meta'; } diff --git a/packages/react/src/components/ContextualMenu/ContextualMenu.classNames.ts b/packages/react/src/components/ContextualMenu/ContextualMenu.classNames.ts index 8f50a29ad0774..147734fb17f2b 100644 --- a/packages/react/src/components/ContextualMenu/ContextualMenu.classNames.ts +++ b/packages/react/src/components/ContextualMenu/ContextualMenu.classNames.ts @@ -253,7 +253,7 @@ export const getItemStyles = (props: IContextualMenuItemStyleProps): IContextual className, } = props; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated return getItemClassNames( theme, disabled, diff --git a/packages/react/src/components/ContextualMenu/ContextualMenu.types.ts b/packages/react/src/components/ContextualMenu/ContextualMenu.types.ts index 64221c69c4f86..daae628fb57d5 100644 --- a/packages/react/src/components/ContextualMenu/ContextualMenu.types.ts +++ b/packages/react/src/components/ContextualMenu/ContextualMenu.types.ts @@ -42,7 +42,7 @@ export interface IContextualMenu {} export interface IContextualMenuProps extends IBaseProps, React.RefAttributes, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated IWithResponsiveModeState { /** * Optional callback to access the IContextualMenu interface. Use this instead of ref for accessing @@ -223,7 +223,7 @@ export interface IContextualMenuProps * Method to provide the classnames to style the contextual menu. * @deprecated Use `styles` instead to leverage mergeStyles API. */ - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated getMenuClassNames?: (theme: ITheme, className?: string) => IContextualMenuClassNames; /** Custom render function for a submenu. */ @@ -459,7 +459,7 @@ export interface IContextualMenuItem { iconClassName?: string, subMenuClassName?: string, primaryDisabled?: boolean, - ) => // eslint-disable-next-line deprecation/deprecation + ) => // eslint-disable-next-line etc/no-deprecated IMenuItemClassNames; /** @@ -472,7 +472,7 @@ export interface IContextualMenuItem { * Default value is the `getSplitButtonVerticalDividerClassNames` func defined in `ContextualMenu.classnames.ts`. * @defaultvalue getSplitButtonVerticalDividerClassNames */ - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated getSplitButtonVerticalDividerClassNames?: (theme: ITheme) => IVerticalDividerClassNames; /** diff --git a/packages/react/src/components/ContextualMenu/ContextualMenuItem.test.tsx b/packages/react/src/components/ContextualMenu/ContextualMenuItem.test.tsx index 96e327c93c531..77aa15b36ce46 100644 --- a/packages/react/src/components/ContextualMenu/ContextualMenuItem.test.tsx +++ b/packages/react/src/components/ContextualMenu/ContextualMenuItem.test.tsx @@ -12,7 +12,7 @@ describe('ContextMenuItemChildren', () => { describe('when a checkmark icon', () => { let onCheckmarkClick: jest.Mock; let menuItem: IContextualMenuItem; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated let menuClassNames: IMenuItemClassNames; let wrapper: ShallowWrapper; @@ -52,7 +52,7 @@ describe('ContextMenuItemChildren', () => { describe('when hide checkmark icon for toggle command', () => { let onCheckmarkClick: jest.Mock; let menuItem: IContextualMenuItem; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated let menuClassNames: IMenuItemClassNames; let wrapper: ShallowWrapper; @@ -96,7 +96,7 @@ describe('ContextMenuItemChildren', () => { describe('when it has icons', () => { describe('when it has iconProps', () => { let menuItem: IContextualMenuItem; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated let menuClassNames: IMenuItemClassNames; let wrapper: ShallowWrapper; @@ -116,7 +116,7 @@ describe('ContextMenuItemChildren', () => { describe('when it doesnt have iconProps', () => { let menuItem: IContextualMenuItem; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated let menuClassNames: IMenuItemClassNames; let wrapper: ShallowWrapper; @@ -137,7 +137,7 @@ describe('ContextMenuItemChildren', () => { describe('when it has a sub menu', () => { let menuItem: IContextualMenuItem; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated let menuClassNames: IMenuItemClassNames; let wrapper: ShallowWrapper; @@ -157,7 +157,7 @@ describe('ContextMenuItemChildren', () => { }); }); -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated function getMenuItemClassNames(): IMenuItemClassNames { return { item: 'item', diff --git a/packages/react/src/components/ContextualMenu/ContextualMenuItem.types.ts b/packages/react/src/components/ContextualMenu/ContextualMenuItem.types.ts index 7a282139185ef..ccc4384f0b318 100644 --- a/packages/react/src/components/ContextualMenu/ContextualMenuItem.types.ts +++ b/packages/react/src/components/ContextualMenu/ContextualMenuItem.types.ts @@ -59,7 +59,7 @@ export interface IContextualMenuItemProps extends React.HTMLAttributes { describe('creates a normal button', () => { let menuItem: IContextualMenuItem; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated let menuClassNames: IMenuItemClassNames; beforeEach(() => { @@ -77,7 +77,7 @@ describe('ContextualMenuButton', () => { }); }); -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated function getMenuItemClassNames(): IMenuItemClassNames { return { item: 'item', diff --git a/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuAnchor.tsx b/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuAnchor.tsx index e675e735ff8ff..27b7021654bae 100644 --- a/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuAnchor.tsx +++ b/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuAnchor.tsx @@ -84,7 +84,7 @@ export class ContextualMenuAnchor extends ContextualMenuItemWrapper { aria-posinset={focusableElementIndex + 1} aria-setsize={totalItemCount} aria-disabled={isItemDisabled(item)} - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated style={item.style} onClick={this._onItemClick} onMouseEnter={this._onItemMouseEnter} diff --git a/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuButton.test.tsx b/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuButton.test.tsx index 144c2b8f121ac..623a25bcc7720 100644 --- a/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuButton.test.tsx +++ b/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuButton.test.tsx @@ -8,7 +8,7 @@ import type { IMenuItemClassNames } from '../ContextualMenu.classNames'; describe('ContextualMenuButton', () => { describe('creates a normal button', () => { let menuItem: IContextualMenuItem; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated let menuClassNames: IMenuItemClassNames; beforeEach(() => { @@ -89,7 +89,7 @@ describe('ContextualMenuButton', () => { }); }); -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated function getMenuItemClassNames(): IMenuItemClassNames { return { item: 'item', diff --git a/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuButton.tsx b/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuButton.tsx index 23a3a4b77d6ee..48e41663798a5 100644 --- a/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuButton.tsx +++ b/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuButton.tsx @@ -84,7 +84,7 @@ export class ContextualMenuButton extends ContextualMenuItemWrapper { (itemRole === 'menuitemcheckbox' || itemRole === 'menuitemradio') && canCheck ? !!isChecked : undefined, 'aria-selected': itemRole === 'menuitem' && canCheck ? !!isChecked : undefined, role: itemRole, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated style: item.style, }; diff --git a/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuItemWrapper.types.ts b/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuItemWrapper.types.ts index 515890159efc5..053976e203cba 100644 --- a/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuItemWrapper.types.ts +++ b/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuItemWrapper.types.ts @@ -19,7 +19,7 @@ export interface IContextualMenuItemWrapperProps extends React.ClassAttributes { describe('creates a normal split button', () => { let menuItem: IContextualMenuItem; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated let menuClassNames: IMenuItemClassNames; beforeEach(() => { @@ -53,7 +53,7 @@ describe('ContextualMenuSplitButton', () => { }); }); -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated function getMenuItemClassNames(): IMenuItemClassNames { return { item: 'item', diff --git a/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuSplitButton.tsx b/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuSplitButton.tsx index 32053d792f0cb..dd6e5532d9f14 100644 --- a/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuSplitButton.tsx +++ b/packages/react/src/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuSplitButton.tsx @@ -129,7 +129,7 @@ export class ContextualMenuSplitButton extends ContextualMenuItemWrapper { protected _onItemKeyDown = (ev: React.KeyboardEvent): void => { const { item, onItemKeyDown } = this.props; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which === KeyCodes.enter) { this._executeItemClick(ev); ev.preventDefault(); @@ -154,7 +154,7 @@ export class ContextualMenuSplitButton extends ContextualMenuItemWrapper { private _renderSplitPrimaryButton( item: IContextualMenuItem, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated classNames: IMenuItemClassNames, index: number, hasCheckmarks: boolean, diff --git a/packages/react/src/components/ContextualMenu/index.ts b/packages/react/src/components/ContextualMenu/index.ts index 3b0c6d543a37f..8eeaf8ac64971 100644 --- a/packages/react/src/components/ContextualMenu/index.ts +++ b/packages/react/src/components/ContextualMenu/index.ts @@ -5,5 +5,5 @@ export * from './ContextualMenuItem'; export * from './ContextualMenuItem.base'; export * from './ContextualMenuItem.types'; export { getMenuItemStyles } from './ContextualMenu.cnstyles'; -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated export type { IContextualMenuClassNames, IMenuItemClassNames } from './ContextualMenu.classNames'; diff --git a/packages/react/src/components/DatePicker/DatePicker.base.tsx b/packages/react/src/components/DatePicker/DatePicker.base.tsx index 58b40b249014c..587b3abdca990 100644 --- a/packages/react/src/components/DatePicker/DatePicker.base.tsx +++ b/packages/react/src/components/DatePicker/DatePicker.base.tsx @@ -325,7 +325,7 @@ export const DatePickerBase: React.FunctionComponent = React.f }; const onTextFieldKeyDown = (ev: React.KeyboardEvent): void => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated switch (ev.which) { case KeyCodes.enter: ev.preventDefault(); diff --git a/packages/react/src/components/DetailsList/DetailsHeader.base.tsx b/packages/react/src/components/DetailsList/DetailsHeader.base.tsx index eb50bb32f5aea..ab307fcc5782a 100644 --- a/packages/react/src/components/DetailsList/DetailsHeader.base.tsx +++ b/packages/react/src/components/DetailsList/DetailsHeader.base.tsx @@ -748,7 +748,7 @@ export class DetailsHeaderBase const columnIndex = Number(columnIndexAttr); if (!columnResizeDetails) { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which === KeyCodes.enter) { this.setState({ columnResizeDetails: { @@ -763,7 +763,7 @@ export class DetailsHeaderBase } else { let increment: number | undefined; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which === KeyCodes.enter) { this.setState({ columnResizeDetails: undefined, @@ -771,10 +771,10 @@ export class DetailsHeaderBase ev.preventDefault(); ev.stopPropagation(); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated } else if (ev.which === KeyCodes.left) { increment = getRTL(this.props.theme) ? 1 : -1; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated } else if (ev.which === KeyCodes.right) { increment = getRTL(this.props.theme) ? -1 : 1; } diff --git a/packages/react/src/components/DetailsList/DetailsList.base.tsx b/packages/react/src/components/DetailsList/DetailsList.base.tsx index 168fdf5d62c52..094f923c3fc4b 100644 --- a/packages/react/src/components/DetailsList/DetailsList.base.tsx +++ b/packages/react/src/components/DetailsList/DetailsList.base.tsx @@ -567,7 +567,7 @@ const DetailsListInner: React.ComponentType = ( const isRightArrow = React.useCallback( (event: React.KeyboardEvent) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated return event.which === getRTLSafeKeyCode(KeyCodes.right, theme); }, [theme], @@ -625,7 +625,7 @@ const DetailsListInner: React.ComponentType = ( const onHeaderKeyDown = React.useCallback( (ev: React.KeyboardEvent): void => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which === KeyCodes.down) { if (focusZoneRef.current && focusZoneRef.current.focus()) { // select the first item in list after down arrow key event @@ -644,7 +644,7 @@ const DetailsListInner: React.ComponentType = ( const onContentKeyDown = React.useCallback( (ev: React.KeyboardEvent): void => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which === KeyCodes.up && !ev.altKey) { if (headerRef.current && headerRef.current.focus()) { ev.preventDefault(); @@ -1304,7 +1304,7 @@ export class DetailsListBase extends React.Component= overflowWidth || !(column.isCollapsible || column.isCollapsable)) { const originalWidth = column.calculatedWidth!; column.calculatedWidth = Math.max(column.calculatedWidth! - overflowWidth, minWidth); diff --git a/packages/react/src/components/DetailsList/DetailsRowCheck.tsx b/packages/react/src/components/DetailsList/DetailsRowCheck.tsx index a966caf238775..1a83dbd5f5179 100644 --- a/packages/react/src/components/DetailsList/DetailsRowCheck.tsx +++ b/packages/react/src/components/DetailsList/DetailsRowCheck.tsx @@ -60,7 +60,7 @@ const DetailsRowCheckBase: React.FunctionComponent = prop
= prop {onRenderCheckbox(detailsCheckboxProps)}
) : ( - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated
); }; diff --git a/packages/react/src/components/Dialog/Dialog.base.tsx b/packages/react/src/components/Dialog/Dialog.base.tsx index 36f9ef0e468c9..adc87fea1aa85 100644 --- a/packages/react/src/components/Dialog/Dialog.base.tsx +++ b/packages/react/src/components/Dialog/Dialog.base.tsx @@ -27,7 +27,7 @@ const DefaultDialogContentProps: IDialogContentProps = { topButtonsProps: [], }; -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated @withResponsiveMode export class DialogBase extends React.Component { public static defaultProps: IDialogProps = { @@ -140,7 +140,7 @@ export class DialogBase extends React.Component { ...props.dialogContentProps, draggableHeaderClassName: dialogDraggableClassName, titleProps: { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated id: props.dialogContentProps?.titleId || this._defaultTitleTextId, ...props.dialogContentProps?.titleProps, }, @@ -177,7 +177,7 @@ export class DialogBase extends React.Component { } private _getSubTextId = (): string | undefined => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { ariaDescribedById, modalProps, dialogContentProps, subText } = this.props; let id = (modalProps && modalProps.subtitleAriaId) || ariaDescribedById; @@ -189,7 +189,7 @@ export class DialogBase extends React.Component { }; private _getTitleTextId = (): string | undefined => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { ariaLabelledById, modalProps, dialogContentProps, title } = this.props; let id = (modalProps && modalProps.titleAriaId) || ariaLabelledById; diff --git a/packages/react/src/components/Dialog/Dialog.types.ts b/packages/react/src/components/Dialog/Dialog.types.ts index e54448b98d37c..bb738a0832c69 100644 --- a/packages/react/src/components/Dialog/Dialog.types.ts +++ b/packages/react/src/components/Dialog/Dialog.types.ts @@ -20,7 +20,7 @@ export interface IDialog {} */ export interface IDialogProps extends React.ClassAttributes, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated IWithResponsiveModeState, IAccessiblePopupProps { /** diff --git a/packages/react/src/components/Dialog/DialogContent.base.tsx b/packages/react/src/components/Dialog/DialogContent.base.tsx index 4f3eabbe3f906..2af3a9251bb88 100644 --- a/packages/react/src/components/Dialog/DialogContent.base.tsx +++ b/packages/react/src/components/Dialog/DialogContent.base.tsx @@ -13,7 +13,7 @@ const DialogFooterType = (() as React.ReactElement { public static defaultProps: IDialogContentProps = { @@ -41,7 +41,7 @@ export class DialogContentBase extends React.Component subTextId, subText, titleProps = {}, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated titleId, title, type, diff --git a/packages/react/src/components/Dialog/DialogFooter.types.ts b/packages/react/src/components/Dialog/DialogFooter.types.ts index ec10cd2465000..5503cc1ff16f4 100644 --- a/packages/react/src/components/Dialog/DialogFooter.types.ts +++ b/packages/react/src/components/Dialog/DialogFooter.types.ts @@ -11,7 +11,7 @@ export interface IDialogFooter {} /** * {@docCategory Dialog} */ -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated export interface IDialogFooterProps extends React.Props { /** * Gets the component ref. diff --git a/packages/react/src/components/Divider/VerticalDivider.base.tsx b/packages/react/src/components/Divider/VerticalDivider.base.tsx index 0bfb0e552409a..023901b162268 100644 --- a/packages/react/src/components/Divider/VerticalDivider.base.tsx +++ b/packages/react/src/components/Divider/VerticalDivider.base.tsx @@ -12,7 +12,7 @@ export const VerticalDividerBase: React.FunctionComponent HTMLDivElement, IVerticalDividerProps >((props, ref) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { styles, theme, getClassNames: deprecatedGetClassNames, className } = props; const classNames = getClassNames(styles, { theme: theme, getClassNames: deprecatedGetClassNames, className }); return ( diff --git a/packages/react/src/components/Divider/VerticalDivider.classNames.ts b/packages/react/src/components/Divider/VerticalDivider.classNames.ts index 03e0b7eb32193..f291ecc9fc1ac 100644 --- a/packages/react/src/components/Divider/VerticalDivider.classNames.ts +++ b/packages/react/src/components/Divider/VerticalDivider.classNames.ts @@ -7,7 +7,7 @@ import type { IVerticalDividerClassNames } from './VerticalDivider.types'; * @deprecated use getStyles exported from VerticalDivider.styles.ts */ export const getDividerClassNames = memoizeFunction( - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated (theme: ITheme): IVerticalDividerClassNames => { return mergeStyleSets({ wrapper: { diff --git a/packages/react/src/components/Divider/VerticalDivider.styles.ts b/packages/react/src/components/Divider/VerticalDivider.styles.ts index 166a0fa3a97cd..80d67b6bd986d 100644 --- a/packages/react/src/components/Divider/VerticalDivider.styles.ts +++ b/packages/react/src/components/Divider/VerticalDivider.styles.ts @@ -4,7 +4,7 @@ import type { IStyleFunction } from '../../Utilities'; export const getStyles: IStyleFunction = ( props: IVerticalDividerPropsStyles, ): IVerticalDividerStyles => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { theme, getClassNames, className } = props; if (!theme) { diff --git a/packages/react/src/components/Divider/VerticalDivider.types.ts b/packages/react/src/components/Divider/VerticalDivider.types.ts index 44ea500f5c450..2717112e57b56 100644 --- a/packages/react/src/components/Divider/VerticalDivider.types.ts +++ b/packages/react/src/components/Divider/VerticalDivider.types.ts @@ -11,7 +11,7 @@ export interface IVerticalDividerProps extends React.HTMLAttributes * Optional function to generate the class names for the divider for custom styling * @deprecated Use `styles` instead. */ - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated getClassNames?: (theme: ITheme) => IVerticalDividerClassNames; /** * The theme that should be used to render the vertical divider. diff --git a/packages/react/src/components/DocumentCard/DocumentCard.base.tsx b/packages/react/src/components/DocumentCard/DocumentCard.base.tsx index 051a983faa7bc..972bcc6f6da93 100644 --- a/packages/react/src/components/DocumentCard/DocumentCard.base.tsx +++ b/packages/react/src/components/DocumentCard/DocumentCard.base.tsx @@ -41,7 +41,7 @@ export class DocumentCardBase extends React.Component i } public render(): JSX.Element { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { onClick, onClickHref, children, type, accentColor, styles, theme, className } = this.props; const nativeProps = getNativeProps>(this.props, divProperties, [ 'className', @@ -98,7 +98,7 @@ export class DocumentCardBase extends React.Component i }; private _onKeyDown = (ev: React.KeyboardEvent): void => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which === KeyCodes.enter || ev.which === KeyCodes.space) { this._onAction(ev); } diff --git a/packages/react/src/components/DocumentCard/DocumentCardDetails.types.ts b/packages/react/src/components/DocumentCard/DocumentCardDetails.types.ts index 4a2ed8618e686..c480ccf8b8bb8 100644 --- a/packages/react/src/components/DocumentCard/DocumentCardDetails.types.ts +++ b/packages/react/src/components/DocumentCard/DocumentCardDetails.types.ts @@ -11,7 +11,7 @@ export interface IDocumentCardDetails {} /** * {@docCategory DocumentCard} */ -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated export interface IDocumentCardDetailsProps extends React.Props { /** * Gets the component ref. diff --git a/packages/react/src/components/DocumentCard/DocumentCardLogo.styles.ts b/packages/react/src/components/DocumentCard/DocumentCardLogo.styles.ts index 68e00221a5f5e..71ec0e573a41f 100644 --- a/packages/react/src/components/DocumentCard/DocumentCardLogo.styles.ts +++ b/packages/react/src/components/DocumentCard/DocumentCardLogo.styles.ts @@ -15,7 +15,7 @@ export const getStyles = (props: IDocumentCardLogoStyleProps): IDocumentCardLogo root: [ classNames.root, { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated fontSize: fonts.xxLargePlus.fontSize, color: palette.themePrimary, display: 'block', diff --git a/packages/react/src/components/DocumentCard/DocumentCardPreview.base.tsx b/packages/react/src/components/DocumentCard/DocumentCardPreview.base.tsx index 48342a12c29bc..165c9282384bc 100644 --- a/packages/react/src/components/DocumentCard/DocumentCardPreview.base.tsx +++ b/packages/react/src/components/DocumentCard/DocumentCardPreview.base.tsx @@ -130,7 +130,7 @@ export class DocumentCardPreviewBase extends React.Component diff --git a/packages/react/src/components/DocumentCard/DocumentCardStatus.types.ts b/packages/react/src/components/DocumentCard/DocumentCardStatus.types.ts index 9aa8d2263b926..d069ccaac4e04 100644 --- a/packages/react/src/components/DocumentCard/DocumentCardStatus.types.ts +++ b/packages/react/src/components/DocumentCard/DocumentCardStatus.types.ts @@ -11,7 +11,7 @@ export interface IDocumentCardStatus {} /** * {@docCategory DocumentCard} */ -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated export interface IDocumentCardStatusProps extends React.Props { /** * Gets the component ref. diff --git a/packages/react/src/components/Dropdown/Dropdown.base.tsx b/packages/react/src/components/Dropdown/Dropdown.base.tsx index 8f991311eb727..059c5ef96b86c 100644 --- a/packages/react/src/components/Dropdown/Dropdown.base.tsx +++ b/packages/react/src/components/Dropdown/Dropdown.base.tsx @@ -53,7 +53,7 @@ const COMPONENT_NAME = 'Dropdown'; const getClassNames = classNamesFunction(); /** Internal only props interface to support mixing in responsive mode */ -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated interface IDropdownInternalProps extends Omit, IWithResponsiveModeState { hoisted: { rootRef: React.Ref; @@ -142,7 +142,7 @@ function useSelectedItemsState({ if (searchKey != null) { return option.key === searchKey; } else { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated return !!option.selected || !!option.isSelected; } }); @@ -317,7 +317,7 @@ class DropdownInternal extends React.Component { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { onChange, onChanged } = this.props; if (onChange || onChanged) { // for single-select, option passed in will always be selected. @@ -489,7 +489,7 @@ class DropdownInternal extends React.Component { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated return this.props.placeholder || this.props.placeHolder; }; @@ -1009,7 +1009,7 @@ class DropdownInternal extends React.Component): boolean { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated return ev.which === KeyCodes.alt || ev.key === 'Meta'; } @@ -1148,7 +1148,7 @@ class DropdownInternal extends React.Component boolean | undefined = () => { let { disabled } = this.props; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { isDisabled } = this.props; // Remove this deprecation workaround at 1.0.0 diff --git a/packages/react/src/components/ExtendedPicker/BaseExtendedPicker.tsx b/packages/react/src/components/ExtendedPicker/BaseExtendedPicker.tsx index 9e2f4bee28175..c4215271575c7 100644 --- a/packages/react/src/components/ExtendedPicker/BaseExtendedPicker.tsx +++ b/packages/react/src/components/ExtendedPicker/BaseExtendedPicker.tsx @@ -192,7 +192,7 @@ export class BaseExtendedPicker> // This is protected because we may expect the backspace key to work differently in a different kind of picker. // This lets the subclass override it and provide it's own onBackspace. For an example see the BasePickerListBelow protected onBackspace = (ev: React.KeyboardEvent): void => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which !== KeyCodes.backspace) { return; } diff --git a/packages/react/src/components/Fabric/Fabric.base.tsx b/packages/react/src/components/Fabric/Fabric.base.tsx index eba221168594d..19036ca0ac39c 100644 --- a/packages/react/src/components/Fabric/Fabric.base.tsx +++ b/packages/react/src/components/Fabric/Fabric.base.tsx @@ -69,7 +69,7 @@ function useRenderedContent( if (needsTheme) { // Disabling ThemeProvider here because theme doesn't need to be re-provided by ThemeProvider if dir has changed. renderedContent = ( - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated {renderedContent} ); } diff --git a/packages/react/src/components/FloatingPicker/BaseFloatingPicker.tsx b/packages/react/src/components/FloatingPicker/BaseFloatingPicker.tsx index 3c969a4698e23..f0738751bfb20 100644 --- a/packages/react/src/components/FloatingPicker/BaseFloatingPicker.tsx +++ b/packages/react/src/components/FloatingPicker/BaseFloatingPicker.tsx @@ -253,7 +253,7 @@ export class BaseFloatingPicker> ) { return; } - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const keyCode = ev.which; switch (keyCode) { case KeyCodes.escape: diff --git a/packages/react/src/components/FloatingPicker/PeoplePicker/PeoplePickerItems/SelectedItemDefault.tsx b/packages/react/src/components/FloatingPicker/PeoplePicker/PeoplePickerItems/SelectedItemDefault.tsx index 7941c82a0c237..ba9aee6b5b88d 100644 --- a/packages/react/src/components/FloatingPicker/PeoplePicker/PeoplePickerItems/SelectedItemDefault.tsx +++ b/packages/react/src/components/FloatingPicker/PeoplePicker/PeoplePickerItems/SelectedItemDefault.tsx @@ -39,7 +39,7 @@ export const SelectedItemDefault: (props: IPeoplePickerItemProps) => JSX.Element
diff --git a/packages/react/src/components/FloatingPicker/Suggestions/SuggestionsStore.ts b/packages/react/src/components/FloatingPicker/Suggestions/SuggestionsStore.ts index b7294f123d390..cb0a6f11b6373 100644 --- a/packages/react/src/components/FloatingPicker/Suggestions/SuggestionsStore.ts +++ b/packages/react/src/components/FloatingPicker/Suggestions/SuggestionsStore.ts @@ -54,7 +54,7 @@ export class SuggestionsStore { ? this.getAriaLabel(suggestion) : ((suggestion as any) as ITag).name || (suggestion).text || - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated (suggestion).primaryText, }; } diff --git a/packages/react/src/components/FocusTrapZone/FocusTrapZone.tsx b/packages/react/src/components/FocusTrapZone/FocusTrapZone.tsx index cfc920354fc03..399866bff7006 100644 --- a/packages/react/src/components/FocusTrapZone/FocusTrapZone.tsx +++ b/packages/react/src/components/FocusTrapZone/FocusTrapZone.tsx @@ -74,7 +74,7 @@ export const FocusTrapZone: React.FunctionComponent & { elementToFocusOnDismiss, forceFocusInsideTrap = true, focusPreviouslyFocusedInnerElement, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated firstFocusableSelector, firstFocusableTarget, ignoreExternalFocusing, diff --git a/packages/react/src/components/GroupedList/GroupHeader.base.tsx b/packages/react/src/components/GroupedList/GroupHeader.base.tsx index 477a3be1cf3a4..38f2b75f0c512 100644 --- a/packages/react/src/components/GroupedList/GroupHeader.base.tsx +++ b/packages/react/src/components/GroupedList/GroupHeader.base.tsx @@ -66,7 +66,7 @@ export class GroupHeaderBase extends React.Component= 7.0 */ - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated styles?: IStyleFunctionOrObject; /** Count of spacer(s) */ diff --git a/packages/react/src/components/GroupedList/GroupedList.base.tsx b/packages/react/src/components/GroupedList/GroupedList.base.tsx index faef5130a9993..408773c33b92a 100644 --- a/packages/react/src/components/GroupedList/GroupedList.base.tsx +++ b/packages/react/src/components/GroupedList/GroupedList.base.tsx @@ -358,7 +358,7 @@ export class GroupedListBase extends React.Component): boolean => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated return ev.which === getRTLSafeKeyCode(KeyCodes.right); }; diff --git a/packages/react/src/components/HoverCard/ExpandingCard.base.tsx b/packages/react/src/components/HoverCard/ExpandingCard.base.tsx index b51d2ecf49832..d728418ef248f 100644 --- a/packages/react/src/components/HoverCard/ExpandingCard.base.tsx +++ b/packages/react/src/components/HoverCard/ExpandingCard.base.tsx @@ -70,7 +70,7 @@ export class ExpandingCardBase extends React.Component): void => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which === KeyCodes.escape) { this.props.onLeave && this.props.onLeave(ev); } diff --git a/packages/react/src/components/HoverCard/HoverCard.base.tsx b/packages/react/src/components/HoverCard/HoverCard.base.tsx index 7f93ef0c5283e..b051fd4ea6ed2 100644 --- a/packages/react/src/components/HoverCard/HoverCard.base.tsx +++ b/packages/react/src/components/HoverCard/HoverCard.base.tsx @@ -193,7 +193,7 @@ export class HoverCardBase extends React.Component { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (this._shouldBlockHoverCard() || (ev.type === 'keydown' && !(ev.which === this.props.openHotKey))) { return; } @@ -239,13 +239,13 @@ export class HoverCardBase extends React.Component { } private _onKeyDown = (ev: React.KeyboardEvent): void => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which === KeyCodes.escape) { this.props.onLeave && this.props.onLeave(ev); } diff --git a/packages/react/src/components/Icon/Icon.base.tsx b/packages/react/src/components/Icon/Icon.base.tsx index 2010c04597829..6edbfb3cd80cb 100644 --- a/packages/react/src/components/Icon/Icon.base.tsx +++ b/packages/react/src/components/Icon/Icon.base.tsx @@ -31,7 +31,7 @@ export class IconBase extends React.Component { const { children, className, styles, iconName, imageErrorAs, theme } = this.props; const isPlaceholder = typeof iconName === 'string' && iconName.length === 0; const isImage = - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated !!this.props.imageProps || this.props.iconType === IconType.image || this.props.iconType === IconType.Image; const iconContent = getIconContent(iconName) || {}; const { iconClassName, children: iconContentChildren, mergeImageProps } = iconContent; @@ -55,7 +55,7 @@ export class IconBase extends React.Component { }; const ImageType = (imageLoadError && imageErrorAs) || Image; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const ariaLabel = this.props['aria-label'] || this.props.ariaLabel; const accessibleName = imageProps.alt || ariaLabel || this.props.title; const hasName = !!( diff --git a/packages/react/src/components/Icon/Icon.styles.ts b/packages/react/src/components/Icon/Icon.styles.ts index e24b4b0d19e4d..e0bef751f2d70 100644 --- a/packages/react/src/components/Icon/Icon.styles.ts +++ b/packages/react/src/components/Icon/Icon.styles.ts @@ -33,7 +33,7 @@ export const getStyles = (props: IIconStyleProps): IIconStyles => { iconClassName, className, styles && styles.root, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated styles && styles.imageContainer, ], }; diff --git a/packages/react/src/components/Icon/Icon.types.ts b/packages/react/src/components/Icon/Icon.types.ts index c06b7133f2019..2e50f404af6fd 100644 --- a/packages/react/src/components/Icon/Icon.types.ts +++ b/packages/react/src/components/Icon/Icon.types.ts @@ -51,7 +51,7 @@ export interface IIconProps extends IBaseProps, React.HTMLAttributes = React.forwardRef< children, hostId, onLayerDidMount = () => undefined, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated onLayerMounted = () => undefined, onLayerWillUnmount, insertFirst, diff --git a/packages/react/src/components/Link/Link.test.tsx b/packages/react/src/components/Link/Link.test.tsx index adf03efb72f1a..547116c086b83 100644 --- a/packages/react/src/components/Link/Link.test.tsx +++ b/packages/react/src/components/Link/Link.test.tsx @@ -96,7 +96,7 @@ describe('Link', () => { expect( /ms-Link($| )/.test( ReactDOM.renderToStaticMarkup( - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated My Link , diff --git a/packages/react/src/components/MessageBar/MessageBar.base.tsx b/packages/react/src/components/MessageBar/MessageBar.base.tsx index cad678ec3cec9..6ca4cead81d1a 100644 --- a/packages/react/src/components/MessageBar/MessageBar.base.tsx +++ b/packages/react/src/components/MessageBar/MessageBar.base.tsx @@ -50,7 +50,7 @@ export const MessageBarBase: React.FunctionComponent = React.f actions, className, children, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated overflowButtonAriaLabel, dismissIconProps, styles, diff --git a/packages/react/src/components/MessageBar/MessageBar.types.ts b/packages/react/src/components/MessageBar/MessageBar.types.ts index 346157fe6edd1..8b420279f700f 100644 --- a/packages/react/src/components/MessageBar/MessageBar.types.ts +++ b/packages/react/src/components/MessageBar/MessageBar.types.ts @@ -41,7 +41,7 @@ export interface IMessageBarProps extends React.HTMLAttributes, Rea * If null, we don't show a dismiss button. * @defaultvalue null */ - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated onDismiss?: (ev?: React.MouseEvent) => any; /** diff --git a/packages/react/src/components/Modal/Modal.base.tsx b/packages/react/src/components/Modal/Modal.base.tsx index b155f83820e7c..7ee3228c95d6a 100644 --- a/packages/react/src/components/Modal/Modal.base.tsx +++ b/packages/react/src/components/Modal/Modal.base.tsx @@ -118,12 +118,12 @@ export const ModalBase: React.FunctionComponent = React.forwardRef< theme, topOffsetFixed, responsiveMode, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated onLayerDidMount, isModeless, dragOptions, onDismissed, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated enableAriaHiddenSiblings, } = props; @@ -273,7 +273,7 @@ export const ModalBase: React.FunctionComponent = React.forwardRef< // We need a global handleKeyDown event when we are in the move mode so that we can // handle the key presses and the components inside the modal do not get the events const handleKeyDown = (ev: React.KeyboardEvent): void => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.altKey && ev.ctrlKey && ev.keyCode === KeyCodes.space) { // CTRL + ALT + SPACE is handled during keyUp ev.preventDefault(); @@ -281,13 +281,13 @@ export const ModalBase: React.FunctionComponent = React.forwardRef< return; } - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const newLocal = ev.altKey || ev.keyCode === KeyCodes.escape; if (isModalMenuOpen && newLocal) { setModalMenuClose(); } - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (internalState.isInKeyboardMoveMode && (ev.keyCode === KeyCodes.escape || ev.keyCode === KeyCodes.enter)) { internalState.isInKeyboardMoveMode = false; ev.preventDefault(); @@ -298,7 +298,7 @@ export const ModalBase: React.FunctionComponent = React.forwardRef< let handledEvent = true; const delta = getMoveDelta(ev); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated switch (ev.keyCode) { /* eslint-disable no-fallthrough */ case KeyCodes.escape: @@ -358,7 +358,7 @@ export const ModalBase: React.FunctionComponent = React.forwardRef< const handleKeyUp = (ev: React.KeyboardEvent): void => { // Needs to handle the CTRL + ALT + SPACE key during keyup due to FireFox bug: // https://bugzilla.mozilla.org/show_bug.cgi?id=1220143 - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.altKey && ev.ctrlKey && ev.keyCode === KeyCodes.space) { if (elementContains(internalState.scrollableContent, ev.target as HTMLElement)) { toggleModalMenuOpen(); diff --git a/packages/react/src/components/Modal/Modal.styles.ts b/packages/react/src/components/Modal/Modal.styles.ts index 7439d0de9fb57..44368428c3ac6 100644 --- a/packages/react/src/components/Modal/Modal.styles.ts +++ b/packages/react/src/components/Modal/Modal.styles.ts @@ -117,7 +117,7 @@ export const getStyles = (props: IModalStyleProps): IModalStyles => { padding: '3px 0px', }, keyboardMoveIcon: { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated fontSize: fonts.xLargePlus.fontSize, width: '24px', }, diff --git a/packages/react/src/components/Nav/Nav.base.tsx b/packages/react/src/components/Nav/Nav.base.tsx index 72e1a03346e34..6e1e4c3b028e4 100644 --- a/packages/react/src/components/Nav/Nav.base.tsx +++ b/packages/react/src/components/Nav/Nav.base.tsx @@ -146,7 +146,7 @@ export class NavBase extends React.Component implements IN private _renderCompositeLink(link: INavLink, linkIndex: number, nestingLevel: number): React.ReactElement<{}> { const divProps: React.HTMLProps = { ...getNativeProps(link, divProperties, ['onClick']) }; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { expandButtonAriaLabel, styles, groups, theme } = this.props; const classNames = getClassNames(styles!, { theme: theme!, @@ -249,7 +249,7 @@ export class NavBase extends React.Component implements IN }; private _renderGroupHeader = (group: IRenderGroupHeaderProps): React.ReactElement<{}> => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { styles, groups, theme, expandButtonAriaLabel } = this.props; const { isExpanded } = group; diff --git a/packages/react/src/components/Persona/Persona.base.tsx b/packages/react/src/components/Persona/Persona.base.tsx index 27d5cfa768795..18c17515d1041 100644 --- a/packages/react/src/components/Persona/Persona.base.tsx +++ b/packages/react/src/components/Persona/Persona.base.tsx @@ -44,7 +44,7 @@ export const PersonaBase: React.FunctionComponent = React.forward * Deprecation helper for getting text. */ const getText = (): string => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated return props.text || props.primaryText || ''; }; @@ -129,7 +129,7 @@ export const PersonaBase: React.FunctionComponent = React.forward initialsTextColor, isOutOfOffice, onPhotoLoadingStateChange, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated onRenderCoin, onRenderInitials, presence, diff --git a/packages/react/src/components/Persona/PersonaCoin/PersonaCoin.base.tsx b/packages/react/src/components/Persona/PersonaCoin/PersonaCoin.base.tsx index 91d0e4b451ce7..7bb43530d44d6 100644 --- a/packages/react/src/components/Persona/PersonaCoin/PersonaCoin.base.tsx +++ b/packages/react/src/components/Persona/PersonaCoin/PersonaCoin.base.tsx @@ -106,15 +106,15 @@ export const PersonaCoinBase: React.FunctionComponent = React initialsColor, initialsTextColor, isOutOfOffice, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated onRenderCoin = renderCoin, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated onRenderPersonaCoin = onRenderCoin, onRenderInitials = renderPersonaCoinInitials, presence, presenceTitle, presenceColors, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated primaryText, showInitialsUntilImageLoads, text, @@ -155,7 +155,7 @@ export const PersonaCoinBase: React.FunctionComponent = React
{ // Render PersonaCoin if size is not size8. size10 and tiny need to removed after a deprecation cleanup. - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated size !== PersonaSize.size8 && size !== PersonaSize.size10 && size !== PersonaSize.tiny ? (
{shouldRenderInitials && ( @@ -232,7 +232,7 @@ const renderPersonaCoinInitials = ({ allowPhoneInitials, showUnknownPersonaCoin, text, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated primaryText, theme, }: IPersonaCoinProps): JSX.Element => { diff --git a/packages/react/src/components/Persona/PersonaInitialsColor.ts b/packages/react/src/components/Persona/PersonaInitialsColor.ts index f5fe9c45f8765..a3479c62fff72 100644 --- a/packages/react/src/components/Persona/PersonaInitialsColor.ts +++ b/packages/react/src/components/Persona/PersonaInitialsColor.ts @@ -77,7 +77,7 @@ function personaInitialsColorToHexCode(personaInitialsColor: PersonaInitialsColo return '#5C2E91'; case PersonaInitialsColor.orange: return '#CA5010'; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated case PersonaInitialsColor.red: return '#EE1111'; case PersonaInitialsColor.lightRed: @@ -100,7 +100,7 @@ function personaInitialsColorToHexCode(personaInitialsColor: PersonaInitialsColo return '#8E562E'; case PersonaInitialsColor.coolGray: return '#69797E'; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated case PersonaInitialsColor.black: return '#1D1D1D'; case PersonaInitialsColor.gray: @@ -120,7 +120,7 @@ export function initialsColorPropToColorCode(props: IPersonaProps): string { * @returns Hex color string prefixed with # */ export function getPersonaInitialsColor(props: Pick): string { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { primaryText, text } = props; let { initialsColor } = props; let initialsColorCode: string; diff --git a/packages/react/src/components/Pivot/Pivot.base.tsx b/packages/react/src/components/Pivot/Pivot.base.tsx index ccc5b4568c61c..d36654ba6b03a 100644 --- a/packages/react/src/components/Pivot/Pivot.base.tsx +++ b/packages/react/src/components/Pivot/Pivot.base.tsx @@ -41,7 +41,7 @@ const getLinkItems = (props: IPivotProps, pivotId: string): PivotLinkCollection React.Children.forEach(React.Children.toArray(props.children), (child: React.ReactNode, index: number) => { if (isPivotItem(child)) { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { linkText, ...pivotItemProps } = child.props; const itemKey = child.props.itemKey || index.toString(); result.links.push({ @@ -158,7 +158,7 @@ export const PivotBase: React.FunctionComponent = React.forwardRef< }; const onKeyDown = (itemKey: string, ev: React.KeyboardEvent): void => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which === KeyCodes.enter) { ev.preventDefault(); updateSelectedItem(itemKey); diff --git a/packages/react/src/components/Popup/Popup.tsx b/packages/react/src/components/Popup/Popup.tsx index a55f2e0ab4de3..aebd9211d8a0f 100644 --- a/packages/react/src/components/Popup/Popup.tsx +++ b/packages/react/src/components/Popup/Popup.tsx @@ -123,7 +123,7 @@ function useRestoreFocus(props: IPopupProps, root: React.RefObject) { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const shouldHideSiblings = String(props['aria-modal']).toLowerCase() === 'true' && props.enableAriaHiddenSiblings; React.useEffect(() => { @@ -157,7 +157,7 @@ export const Popup: React.FunctionComponent = React.forwardRef | KeyboardEvent): void => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated switch (ev.which) { case KeyCodes.escape: if (onDismiss) { diff --git a/packages/react/src/components/ProgressIndicator/ProgressIndicator.base.tsx b/packages/react/src/components/ProgressIndicator/ProgressIndicator.base.tsx index 4185f5aae8700..547c0a6cc41cb 100644 --- a/packages/react/src/components/ProgressIndicator/ProgressIndicator.base.tsx +++ b/packages/react/src/components/ProgressIndicator/ProgressIndicator.base.tsx @@ -38,7 +38,7 @@ export class ProgressIndicatorBase extends React.Component = React.forwardRe disabled, getAriaLabel, styles, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated min: minFromProps = props.allowZeroStars ? 0 : 1, max = 5, readOnly, diff --git a/packages/react/src/components/SearchBox/SearchBox.base.tsx b/packages/react/src/components/SearchBox/SearchBox.base.tsx index fec0406b6ae14..cab1f026a24f0 100644 --- a/packages/react/src/components/SearchBox/SearchBox.base.tsx +++ b/packages/react/src/components/SearchBox/SearchBox.base.tsx @@ -40,9 +40,9 @@ export const SearchBoxBase: React.FunctionComponent = React.for disabled, underlined, styles, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated labelText, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated placeholder = labelText, theme, clearButtonProps = defaultClearButtonProps, @@ -56,7 +56,7 @@ export const SearchBoxBase: React.FunctionComponent = React.for iconProps, role, onChange, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated onChanged, } = props; @@ -155,7 +155,7 @@ export const SearchBoxBase: React.FunctionComponent = React.for }; const onKeyDown = (ev: React.KeyboardEvent) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated switch (ev.which) { case KeyCodes.escape: customOnEscape?.(ev); diff --git a/packages/react/src/components/SelectedItemsList/SelectedPeopleList/Items/EditingItem.tsx b/packages/react/src/components/SelectedItemsList/SelectedPeopleList/Items/EditingItem.tsx index 3fa980a1aca38..861786262b7c9 100644 --- a/packages/react/src/components/SelectedItemsList/SelectedPeopleList/Items/EditingItem.tsx +++ b/packages/react/src/components/SelectedItemsList/SelectedPeopleList/Items/EditingItem.tsx @@ -117,7 +117,7 @@ export class EditingItem extends React.Component): void { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which === KeyCodes.backspace || ev.which === KeyCodes.del) { ev.stopPropagation(); } diff --git a/packages/react/src/components/Shimmer/ShimmerCircle/ShimmerCircle.base.tsx b/packages/react/src/components/Shimmer/ShimmerCircle/ShimmerCircle.base.tsx index 1c0185c4bd443..21c00dfff8028 100644 --- a/packages/react/src/components/Shimmer/ShimmerCircle/ShimmerCircle.base.tsx +++ b/packages/react/src/components/Shimmer/ShimmerCircle/ShimmerCircle.base.tsx @@ -5,7 +5,7 @@ import type { IShimmerCircleProps, IShimmerCircleStyleProps, IShimmerCircleStyle const getClassNames = classNamesFunction(); export const ShimmerCircleBase: React.FunctionComponent = props => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { height, styles, borderStyle, theme } = props; const classNames = getClassNames(styles!, { theme: theme!, diff --git a/packages/react/src/components/Shimmer/ShimmerCircle/ShimmerCircle.styles.ts b/packages/react/src/components/Shimmer/ShimmerCircle/ShimmerCircle.styles.ts index 590bbfc3e61ef..a7dbb8f694595 100644 --- a/packages/react/src/components/Shimmer/ShimmerCircle/ShimmerCircle.styles.ts +++ b/packages/react/src/components/Shimmer/ShimmerCircle/ShimmerCircle.styles.ts @@ -8,7 +8,7 @@ const GlobalClassNames = { }; export function getStyles(props: IShimmerCircleStyleProps): IShimmerCircleStyles { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { height, borderStyle, theme } = props; const { semanticColors } = theme; diff --git a/packages/react/src/components/Shimmer/ShimmerGap/ShimmerGap.base.tsx b/packages/react/src/components/Shimmer/ShimmerGap/ShimmerGap.base.tsx index a67ead72f2501..3c8d1ed1f7401 100644 --- a/packages/react/src/components/Shimmer/ShimmerGap/ShimmerGap.base.tsx +++ b/packages/react/src/components/Shimmer/ShimmerGap/ShimmerGap.base.tsx @@ -8,7 +8,7 @@ const getClassNames = classNamesFunction = props => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { height, styles, width = '10px', borderStyle, theme } = props; const classNames = getClassNames(styles!, { diff --git a/packages/react/src/components/Shimmer/ShimmerGap/ShimmerGap.styles.ts b/packages/react/src/components/Shimmer/ShimmerGap/ShimmerGap.styles.ts index d9d1ae91ff1a1..25c41352e4366 100644 --- a/packages/react/src/components/Shimmer/ShimmerGap/ShimmerGap.styles.ts +++ b/packages/react/src/components/Shimmer/ShimmerGap/ShimmerGap.styles.ts @@ -7,7 +7,7 @@ const GlobalClassNames = { }; export function getStyles(props: IShimmerGapStyleProps): IShimmerGapStyles { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { height, borderStyle, theme } = props; const { semanticColors } = theme; diff --git a/packages/react/src/components/Shimmer/ShimmerLine/ShimmerLine.base.tsx b/packages/react/src/components/Shimmer/ShimmerLine/ShimmerLine.base.tsx index 3d8ef09a7f240..c4d83baee1088 100644 --- a/packages/react/src/components/Shimmer/ShimmerLine/ShimmerLine.base.tsx +++ b/packages/react/src/components/Shimmer/ShimmerLine/ShimmerLine.base.tsx @@ -8,7 +8,7 @@ const getClassNames = classNamesFunction = props => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { height, styles, width = '100%', borderStyle, theme } = props; const classNames = getClassNames(styles!, { diff --git a/packages/react/src/components/Shimmer/ShimmerLine/ShimmerLine.styles.ts b/packages/react/src/components/Shimmer/ShimmerLine/ShimmerLine.styles.ts index e4096b4831f66..cf74a9edfc4ac 100644 --- a/packages/react/src/components/Shimmer/ShimmerLine/ShimmerLine.styles.ts +++ b/packages/react/src/components/Shimmer/ShimmerLine/ShimmerLine.styles.ts @@ -11,7 +11,7 @@ const GlobalClassNames = { }; export function getStyles(props: IShimmerLineStyleProps): IShimmerLineStyles { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { height, borderStyle, theme } = props; const { semanticColors } = theme; diff --git a/packages/react/src/components/Slider/useSlider.ts b/packages/react/src/components/Slider/useSlider.ts index 29bd16850ccf0..1504b15fc85ed 100644 --- a/packages/react/src/components/Slider/useSlider.ts +++ b/packages/react/src/components/Slider/useSlider.ts @@ -216,7 +216,7 @@ export const useSlider = (props: ISliderProps, ref: React.Ref) = ? internalState.latestLowerValue : internalState.latestValue; let diff = 0; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated switch (event.which) { case getRTLSafeKeyCode(KeyCodes.left, props.theme): case KeyCodes.down: diff --git a/packages/react/src/components/SpinButton/SpinButton.base.tsx b/packages/react/src/components/SpinButton/SpinButton.base.tsx index c950c3c81fc1d..3c7c4d39273b7 100644 --- a/packages/react/src/components/SpinButton/SpinButton.base.tsx +++ b/packages/react/src/components/SpinButton/SpinButton.base.tsx @@ -345,7 +345,7 @@ export const SpinButtonBase: React.FunctionComponent = React.f const handleKeyDown = (ev: React.KeyboardEvent): void => { // eat the up and down arrow keys to keep focus in the spinButton // (especially when a spinButton is inside of a FocusZone) - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which === KeyCodes.up || ev.which === KeyCodes.down || ev.which === KeyCodes.enter) { ev.preventDefault(); ev.stopPropagation(); @@ -357,7 +357,7 @@ export const SpinButtonBase: React.FunctionComponent = React.f let spinDirection = KeyboardSpinDirection.notSpinning; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated switch (ev.which) { case KeyCodes.up: spinDirection = KeyboardSpinDirection.up; @@ -386,7 +386,7 @@ export const SpinButtonBase: React.FunctionComponent = React.f /** Stop spinning on keyUp if the up or down arrow key fired this event */ const handleKeyUp = React.useCallback( (ev: React.KeyboardEvent): void => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (disabled || ev.which === KeyCodes.up || ev.which === KeyCodes.down) { stop(); return; diff --git a/packages/react/src/components/SpinButton/SpinButton.test.tsx b/packages/react/src/components/SpinButton/SpinButton.test.tsx index 53bca323dc9a8..3862fa91d1e77 100644 --- a/packages/react/src/components/SpinButton/SpinButton.test.tsx +++ b/packages/react/src/components/SpinButton/SpinButton.test.tsx @@ -663,7 +663,7 @@ describe('SpinButton', () => { const onChange = jest.fn(); let keyCode: number | undefined; const onValidate = jest.fn((value: string, event?: React.SyntheticEvent) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated keyCode = (event as React.KeyboardEvent).which; return value; }); diff --git a/packages/react/src/components/Spinner/Spinner.base.tsx b/packages/react/src/components/Spinner/Spinner.base.tsx index 710ddf11a4479..5fb461ec024f9 100644 --- a/packages/react/src/components/Spinner/Spinner.base.tsx +++ b/packages/react/src/components/Spinner/Spinner.base.tsx @@ -13,7 +13,7 @@ export class SpinnerBase extends React.Component { }; public render() { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { type, size, ariaLabel, ariaLive, styles, label, theme, className, labelPosition } = this.props; const statusMessage = ariaLabel; const nativeProps = getNativeProps>(this.props, divProperties, ['size']); @@ -23,7 +23,7 @@ export class SpinnerBase extends React.Component { // finally goes away we should delete this. let styleSize = size; if (styleSize === undefined && type !== undefined) { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated styleSize = type === SpinnerType.large ? SpinnerSize.large : SpinnerSize.medium; } diff --git a/packages/react/src/components/Spinner/Spinner.types.ts b/packages/react/src/components/Spinner/Spinner.types.ts index 14800c32c87b6..157bfd19c2c9c 100644 --- a/packages/react/src/components/Spinner/Spinner.types.ts +++ b/packages/react/src/components/Spinner/Spinner.types.ts @@ -21,7 +21,7 @@ export interface ISpinnerProps extends React.HTMLAttributes { /** * @deprecated Use `size` instead. Will be removed at \>= 2.0.0. */ - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated type?: SpinnerType; /** diff --git a/packages/react/src/components/Stack/Stack.test.tsx b/packages/react/src/components/Stack/Stack.test.tsx index 7f9bc037d34b6..109356dffb85a 100644 --- a/packages/react/src/components/Stack/Stack.test.tsx +++ b/packages/react/src/components/Stack/Stack.test.tsx @@ -200,7 +200,7 @@ describe('Stack', () => { it('renders horizontal Stack with a gap in rtl context correctly', () => { const component = renderer.create( - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated Item 1 diff --git a/packages/react/src/components/Sticky/Sticky.types.ts b/packages/react/src/components/Sticky/Sticky.types.ts index 8e7561733a909..ddae96fa34f2b 100644 --- a/packages/react/src/components/Sticky/Sticky.types.ts +++ b/packages/react/src/components/Sticky/Sticky.types.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { Sticky } from './Sticky'; import type { IRefObject } from '../../Utilities'; -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated export interface IStickyProps extends React.Props { /** * Gets ref to component interface. diff --git a/packages/react/src/components/SwatchColorPicker/ColorPickerGridCell.base.tsx b/packages/react/src/components/SwatchColorPicker/ColorPickerGridCell.base.tsx index ed133b8311e32..4d70d28de5bec 100644 --- a/packages/react/src/components/SwatchColorPicker/ColorPickerGridCell.base.tsx +++ b/packages/react/src/components/SwatchColorPicker/ColorPickerGridCell.base.tsx @@ -67,7 +67,7 @@ const getColorPickerGridCellButtonClassNames = memoizeFunction( export const ColorPickerGridCellBase: React.FunctionComponent = props => { const { item, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated idPrefix = props.id, isRadio, selected = false, diff --git a/packages/react/src/components/SwatchColorPicker/SwatchColorPicker.base.tsx b/packages/react/src/components/SwatchColorPicker/SwatchColorPicker.base.tsx index b731e19670240..45309c36e333e 100644 --- a/packages/react/src/components/SwatchColorPicker/SwatchColorPicker.base.tsx +++ b/packages/react/src/components/SwatchColorPicker/SwatchColorPicker.base.tsx @@ -66,7 +66,7 @@ export const SwatchColorPickerBase: React.FunctionComponent): void => { if ( - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated ev.which === KeyCodes.up || - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated ev.which === KeyCodes.down || - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated ev.which === KeyCodes.left || - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated ev.which === KeyCodes.right ) { setNavigationTimeout(); diff --git a/packages/react/src/components/TeachingBubble/TeachingBubble.base.tsx b/packages/react/src/components/TeachingBubble/TeachingBubble.base.tsx index f50adf04ac197..0a93144d16647 100644 --- a/packages/react/src/components/TeachingBubble/TeachingBubble.base.tsx +++ b/packages/react/src/components/TeachingBubble/TeachingBubble.base.tsx @@ -44,10 +44,10 @@ export const TeachingBubbleBase: React.FunctionComponent = const mergedRootRef = useMergedRefs(rootElementRef, forwardedRef); const { calloutProps: setCalloutProps, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated targetElement, onDismiss, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated hasCloseButton = props.hasCloseIcon, isWide, styles, diff --git a/packages/react/src/components/TeachingBubble/TeachingBubbleContent.base.tsx b/packages/react/src/components/TeachingBubble/TeachingBubbleContent.base.tsx index 6aef5ed7551b1..0b3bb0bf5703b 100644 --- a/packages/react/src/components/TeachingBubble/TeachingBubbleContent.base.tsx +++ b/packages/react/src/components/TeachingBubble/TeachingBubbleContent.base.tsx @@ -48,7 +48,7 @@ export const TeachingBubbleContentBase: React.FunctionComponent | KeyboardEvent): void => { if (onDismiss) { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which === KeyCodes.escape) { onDismiss(ev); } diff --git a/packages/react/src/components/TextField/MaskedTextField/MaskedTextField.tsx b/packages/react/src/components/TextField/MaskedTextField/MaskedTextField.tsx index 674be21115dc9..50486328ee03a 100644 --- a/packages/react/src/components/TextField/MaskedTextField/MaskedTextField.tsx +++ b/packages/react/src/components/TextField/MaskedTextField/MaskedTextField.tsx @@ -289,7 +289,7 @@ export const MaskedTextField: React.FunctionComponent = R internalState.changeSelectionData = null; if (textField.current && textField.current.value) { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const { keyCode, ctrlKey, metaKey } = ev; // Ignore ctrl and meta keydown diff --git a/packages/react/src/components/TextField/TextField.base.tsx b/packages/react/src/components/TextField/TextField.base.tsx index 067b47f647b23..4c46917ad6588 100644 --- a/packages/react/src/components/TextField/TextField.base.tsx +++ b/packages/react/src/components/TextField/TextField.base.tsx @@ -245,7 +245,7 @@ export class TextFieldBase })); return ( - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated
{onRenderLabel(this.props, this._onRenderLabel)} diff --git a/packages/react/src/components/TimePicker/TimePicker.tsx b/packages/react/src/components/TimePicker/TimePicker.tsx index bddc78a92f1ff..aa0f0b1627ffb 100644 --- a/packages/react/src/components/TimePicker/TimePicker.tsx +++ b/packages/react/src/components/TimePicker/TimePicker.tsx @@ -134,7 +134,7 @@ export const TimePicker: React.FunctionComponent = ({ ); const evaluatePressedKey = (event: React.KeyboardEvent) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const charCode = event.charCode; if ( !onFormatDate && diff --git a/packages/react/src/components/Toggle/Toggle.base.tsx b/packages/react/src/components/Toggle/Toggle.base.tsx index d42b9808185f7..6a434b8e1c9c9 100644 --- a/packages/react/src/components/Toggle/Toggle.base.tsx +++ b/packages/react/src/components/Toggle/Toggle.base.tsx @@ -19,13 +19,13 @@ export const ToggleBase: React.FunctionComponent = React.forwardRe disabled, inlineLabel, label, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated offAriaLabel, offText, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated onAriaLabel, onChange, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated onChanged, onClick: onToggleClick, onText, diff --git a/packages/react/src/components/Tooltip/TooltipHost.base.tsx b/packages/react/src/components/Tooltip/TooltipHost.base.tsx index fc37761d7fd90..98ae15dedf8fe 100644 --- a/packages/react/src/components/Tooltip/TooltipHost.base.tsx +++ b/packages/react/src/components/Tooltip/TooltipHost.base.tsx @@ -65,7 +65,7 @@ export class TooltipHostBase extends React.Component): void => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if ((ev.which === KeyCodes.escape || ev.ctrlKey) && this.state.isTooltipVisible) { this._hideTooltip(); ev.stopPropagation(); diff --git a/packages/react/src/components/WeeklyDayPicker/WeeklyDayPicker.base.tsx b/packages/react/src/components/WeeklyDayPicker/WeeklyDayPicker.base.tsx index 7931be393f047..ac82c8605f46e 100644 --- a/packages/react/src/components/WeeklyDayPicker/WeeklyDayPicker.base.tsx +++ b/packages/react/src/components/WeeklyDayPicker/WeeklyDayPicker.base.tsx @@ -280,7 +280,7 @@ export class WeeklyDayPickerBase extends React.Component) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated switch (ev.which) { case KeyCodes.enter: ev.preventDefault(); @@ -297,7 +297,7 @@ export class WeeklyDayPickerBase extends React.Component void): ((ev: React.KeyboardEvent) => void) => { return (ev: React.KeyboardEvent) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated switch (ev.which) { case KeyCodes.enter: callback(); diff --git a/packages/react/src/components/pickers/BasePicker.tsx b/packages/react/src/components/pickers/BasePicker.tsx index 5a1c1fcca5404..a3207e12ba28b 100644 --- a/packages/react/src/components/pickers/BasePicker.tsx +++ b/packages/react/src/components/pickers/BasePicker.tsx @@ -103,7 +103,7 @@ export class BasePicker> protected SuggestionOfProperType = Suggestions as new (props: ISuggestionsProps) => Suggestions; protected currentPromise: PromiseLike | undefined; protected _ariaMap: IPickerAriaIds; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated private _styledSuggestions = getStyledSuggestions(this.SuggestionOfProperType); private _id: string; private _async: Async; @@ -444,7 +444,7 @@ export class BasePicker> protected onEmptyInputFocus() { const emptyResolveSuggestions = this.props.onEmptyResolveSuggestions ? this.props.onEmptyResolveSuggestions - : // eslint-disable-next-line deprecation/deprecation + : // eslint-disable-next-line etc/no-deprecated this.props.onEmptyInputFocus; // Only attempt to resolve suggestions if it exists @@ -621,7 +621,7 @@ export class BasePicker> }; protected onKeyDown = (ev: React.KeyboardEvent): void => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const keyCode = ev.which; switch (keyCode) { case KeyCodes.escape: @@ -863,7 +863,7 @@ export class BasePicker> protected _shouldFocusZoneEnterInnerZone = (ev: React.KeyboardEvent): boolean => { // If suggestions are shown const up/down keys control them, otherwise allow them through to control the focusZone. if (this.state.suggestionsVisible) { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated switch (ev.which) { case KeyCodes.up: case KeyCodes.down: @@ -871,7 +871,7 @@ export class BasePicker> } } - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (ev.which === KeyCodes.enter) { return true; } @@ -932,7 +932,7 @@ export class BasePicker> return (
{ - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated this.getSuggestionsAlert(alertClassName) } {removedItemText} diff --git a/packages/react/src/components/pickers/BasePicker.types.ts b/packages/react/src/components/pickers/BasePicker.types.ts index d9d06d96d86f1..5e8a4ff07d1ca 100644 --- a/packages/react/src/components/pickers/BasePicker.types.ts +++ b/packages/react/src/components/pickers/BasePicker.types.ts @@ -37,7 +37,7 @@ export interface IBasePicker { * displaying persona's then type T could either be of Persona or IPersona props * {@docCategory Pickers} */ -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated export interface IBasePickerProps extends React.Props { /** * Optional callback to access the IBasePicker interface. Use this instead of ref for accessing diff --git a/packages/react/src/components/pickers/PeoplePicker/PeoplePickerItems/PeoplePickerItem.types.ts b/packages/react/src/components/pickers/PeoplePicker/PeoplePickerItems/PeoplePickerItem.types.ts index ef05058274fd0..4ce76aa8d1998 100644 --- a/packages/react/src/components/pickers/PeoplePicker/PeoplePickerItems/PeoplePickerItem.types.ts +++ b/packages/react/src/components/pickers/PeoplePicker/PeoplePickerItems/PeoplePickerItem.types.ts @@ -118,7 +118,7 @@ export interface IPeoplePickerItemSuggestionStyles { * PeoplePickerItemWithMenu props interface. * @deprecated Do not use. Will be removed in \>= 7.0 */ -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated export interface IPeoplePickerItemWithMenuProps extends IPickerItemProps {} /** diff --git a/packages/react/src/components/pickers/Suggestions/Suggestions.types.ts b/packages/react/src/components/pickers/Suggestions/Suggestions.types.ts index f1bda825811de..2f44cd962d3b8 100644 --- a/packages/react/src/components/pickers/Suggestions/Suggestions.types.ts +++ b/packages/react/src/components/pickers/Suggestions/Suggestions.types.ts @@ -39,7 +39,7 @@ export interface ISuggestions { * Type T is the type of the items that are displayed. * {@docCategory Pickers} */ -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated export interface ISuggestionsProps extends React.Props { /** * Optional callback to access the ISuggestions interface. Use this instead of ref for accessing diff --git a/packages/react/src/utilities/ButtonGrid/ButtonGrid.base.tsx b/packages/react/src/utilities/ButtonGrid/ButtonGrid.base.tsx index 287fb5a42a45e..265552314abc6 100644 --- a/packages/react/src/utilities/ButtonGrid/ButtonGrid.base.tsx +++ b/packages/react/src/utilities/ButtonGrid/ButtonGrid.base.tsx @@ -17,9 +17,9 @@ export const ButtonGridBase: React.FunctionComponent = React.f columnCount, onRenderItem, isSemanticRadio, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated ariaPosInSet = props.positionInSet, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated ariaSetSize = props.setSize, styles, doNotContainWithinFocusZone, diff --git a/packages/react/src/utilities/ThemeProvider/makeStyles.test.tsx b/packages/react/src/utilities/ThemeProvider/makeStyles.test.tsx index 1635057f9ed3c..04dfe26090c47 100644 --- a/packages/react/src/utilities/ThemeProvider/makeStyles.test.tsx +++ b/packages/react/src/utilities/ThemeProvider/makeStyles.test.tsx @@ -12,7 +12,7 @@ import { ThemeProvider } from './ThemeProvider'; describe('makeStyles', () => { const stylesheet: Stylesheet = Stylesheet.getInstance(); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const useThemedStyles = makeStyles(theme => ({ root: { background: theme.palette.themePrimary, @@ -27,7 +27,7 @@ describe('makeStyles', () => { const ThemeStyledComponent = () => ; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const useStaticStyles = makeStyles({ root: { background: 'yellow', @@ -48,7 +48,7 @@ describe('makeStyles', () => { }); it('can create basic styles as an object (no type errors)', () => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated makeStyles({ root: { alignItems: 'center', @@ -57,7 +57,7 @@ describe('makeStyles', () => { }); it('can create style functions (no type errors)', () => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated makeStyles(() => ({ root: { alignItems: 'center', @@ -78,7 +78,7 @@ describe('makeStyles', () => { }); safeMount( - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated , diff --git a/packages/react/src/utilities/ThemeProvider/makeStyles.ts b/packages/react/src/utilities/ThemeProvider/makeStyles.ts index f6db5a11310a6..6be5a1f5f7074 100644 --- a/packages/react/src/utilities/ThemeProvider/makeStyles.ts +++ b/packages/react/src/utilities/ThemeProvider/makeStyles.ts @@ -53,12 +53,12 @@ export type UseStylesOptions = { */ export function makeStyles( styleOrFunction: TStyleSet | ((theme: Theme) => TStyleSet), - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated ): (options?: UseStylesOptions) => { [key in keyof TStyleSet]: string } { // Create graph of inputs to map to output. const graph = new Map(); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated return (options: UseStylesOptions = {}) => { let { theme } = options; const win = useWindow(); diff --git a/packages/react/src/utilities/ThemeProvider/useThemeProviderClasses.tsx b/packages/react/src/utilities/ThemeProvider/useThemeProviderClasses.tsx index ae44f3a63b55a..8d3916239805b 100644 --- a/packages/react/src/utilities/ThemeProvider/useThemeProviderClasses.tsx +++ b/packages/react/src/utilities/ThemeProvider/useThemeProviderClasses.tsx @@ -5,7 +5,7 @@ import { makeStyles } from './makeStyles'; import type { ThemeProviderState } from './ThemeProvider.types'; import type { Theme } from '@fluentui/theme'; -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated const useThemeProviderStyles = makeStyles((theme: Theme) => { const { semanticColors, fonts } = theme; diff --git a/packages/react/src/utilities/contextualMenu/contextualMenuUtility.ts b/packages/react/src/utilities/contextualMenu/contextualMenuUtility.ts index 018e3051df284..ffdc7f92bda7f 100644 --- a/packages/react/src/utilities/contextualMenu/contextualMenuUtility.ts +++ b/packages/react/src/utilities/contextualMenu/contextualMenuUtility.ts @@ -26,7 +26,7 @@ export function getIsChecked(item: IContextualMenuItem): boolean | null { } export function hasSubmenu(item: IContextualMenuItem): boolean { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated return !!(item.subMenuProps || item.items); } diff --git a/packages/react/src/utilities/decorators/withResponsiveMode.test.tsx b/packages/react/src/utilities/decorators/withResponsiveMode.test.tsx index 3906902e0a5f3..4cb461d37e59a 100644 --- a/packages/react/src/utilities/decorators/withResponsiveMode.test.tsx +++ b/packages/react/src/utilities/decorators/withResponsiveMode.test.tsx @@ -3,7 +3,7 @@ import * as ReactTestUtils from 'react-dom/test-utils'; import { setResponsiveMode, withResponsiveMode, ResponsiveMode } from './withResponsiveMode'; import { setSSR } from '../../Utilities'; -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated @withResponsiveMode class Example extends React.Component { public render(): JSX.Element { diff --git a/packages/react/src/utilities/decorators/withResponsiveMode.tsx b/packages/react/src/utilities/decorators/withResponsiveMode.tsx index ef98771c698fb..3a5cce675caf3 100644 --- a/packages/react/src/utilities/decorators/withResponsiveMode.tsx +++ b/packages/react/src/utilities/decorators/withResponsiveMode.tsx @@ -74,7 +74,7 @@ export function getInitialResponsiveMode(): ResponsiveMode { export function withResponsiveMode( ComposedComponent: new (props: TProps, ...args: any[]) => React.Component, ): any { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const resultClass = class WithResponsiveMode extends BaseDecorator { public static contextType = WindowContext; public context: React.ContextType; diff --git a/packages/react/src/utilities/positioning/positioning.ts b/packages/react/src/utilities/positioning/positioning.ts index 99ffb84c89ec2..ebfbcc1d981f8 100644 --- a/packages/react/src/utilities/positioning/positioning.ts +++ b/packages/react/src/utilities/positioning/positioning.ts @@ -757,9 +757,9 @@ function _getTargetRect(bounds: Rectangle, target: Element | MouseEvent | Point // HTMLImgElements can have x and y values. The check for it being a point must go last. } else { const rectOrPoint: Point & Rectangle = target as Point & Rectangle; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const left = rectOrPoint.left || rectOrPoint.x; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const top = rectOrPoint.top || rectOrPoint.y; const right = rectOrPoint.right || left; const bottom = rectOrPoint.bottom || top; @@ -987,9 +987,9 @@ export function getMaxHeight( ? _getRectangleFromIRect(bounds) : new Rectangle(0, window.innerWidth - getScrollbarWidth(), 0, window.innerHeight); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const left = rectOrPointTarget.left || rectOrPointTarget.x; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated const top = rectOrPointTarget.top || rectOrPointTarget.y; const right = rectOrPointTarget.right || left; const bottom = rectOrPointTarget.bottom || top; @@ -1046,9 +1046,9 @@ function _getBoundsFromTargetWindow( } // If the target is not null get x-axis and y-axis coordinates directly. else if (target !== null) { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated x = (target as Point).left || (target as MouseEvent | Point).x; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated y = (target as Point).top || (target as MouseEvent | Point).y; } diff --git a/packages/react/src/utilities/positioning/positioning.types.ts b/packages/react/src/utilities/positioning/positioning.types.ts index 4810db92f5a9d..86bb2f2984028 100644 --- a/packages/react/src/utilities/positioning/positioning.types.ts +++ b/packages/react/src/utilities/positioning/positioning.types.ts @@ -123,5 +123,5 @@ export interface IRelativePositions { submenuDirection: DirectionalHint; } -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated export type { Point, IPoint } from '../../Utilities'; diff --git a/packages/react/src/utilities/selection/SelectionZone.tsx b/packages/react/src/utilities/selection/SelectionZone.tsx index f5d50479443fe..ef30b1178465d 100644 --- a/packages/react/src/utilities/selection/SelectionZone.tsx +++ b/packages/react/src/utilities/selection/SelectionZone.tsx @@ -488,9 +488,9 @@ export class SelectionZone extends React.Component).keyCode; this._isTabPressed = keyCode ? keyCode === KeyCodes.tab : false; } diff --git a/packages/set-version/.eslintrc.json b/packages/set-version/.eslintrc.json index 242cf7dcccffb..615a7b87e3424 100644 --- a/packages/set-version/.eslintrc.json +++ b/packages/set-version/.eslintrc.json @@ -2,7 +2,7 @@ "extends": ["plugin:@fluentui/eslint-plugin/react"], "root": true, "rules": { - "deprecation/deprecation": "off", + "etc/no-deprecated": "off", "prefer-const": "off" } } diff --git a/packages/style-utilities/src/utilities/icons.ts b/packages/style-utilities/src/utilities/icons.ts index a151bc2c691d2..60545156e7d14 100644 --- a/packages/style-utilities/src/utilities/icons.ts +++ b/packages/style-utilities/src/utilities/icons.ts @@ -194,7 +194,7 @@ export function getIcon(name?: string): IIconRecord | undefined { } } } else { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (!options.disableWarnings && options.warnOnMissingIcons) { warn( `The icon "${name}" was used but not registered. See https://github.com/microsoft/fluentui/wiki/Using-icons for more information.`, diff --git a/packages/theme/src/utilities/makeSemanticColors.ts b/packages/theme/src/utilities/makeSemanticColors.ts index b9924ec0d7afa..c7095c0567047 100644 --- a/packages/theme/src/utilities/makeSemanticColors.ts +++ b/packages/theme/src/utilities/makeSemanticColors.ts @@ -132,7 +132,7 @@ export function getSemanticColors>( result.listItemBackgroundChecked = neutralLight; result.listHeaderBackgroundPressed = neutralLight; result.menuItemBackgroundPressed = neutralLight; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated result.menuItemBackgroundChecked = neutralLight; } if (neutralLighter) { diff --git a/packages/utilities/src/BaseComponent.test.tsx b/packages/utilities/src/BaseComponent.test.tsx index 3849bdbabc2cd..f856c3f4470bc 100644 --- a/packages/utilities/src/BaseComponent.test.tsx +++ b/packages/utilities/src/BaseComponent.test.tsx @@ -5,12 +5,12 @@ import { BaseComponent } from './BaseComponent'; describe('BaseComponent', () => { it('can resolve refs', () => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated class Foo extends BaseComponent<{}, {}> { public root!: HTMLElement; public render(): JSX.Element { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated return
; } } diff --git a/packages/utilities/src/BaseComponent.ts b/packages/utilities/src/BaseComponent.ts index 75f553d8e2664..35253c2d66ad6 100644 --- a/packages/utilities/src/BaseComponent.ts +++ b/packages/utilities/src/BaseComponent.ts @@ -46,7 +46,7 @@ export class BaseComponent extends constructor(props: TProps, context?: any) { super(props, context); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated _makeAllSafe(this, BaseComponent.prototype, [ 'componentDidMount', 'shouldComponentUpdate', @@ -232,14 +232,14 @@ export class BaseComponent extends * ensures that the BaseComponent's methods are called before the subclass's. This ensures that * componentWillUnmount in the base is called and that things in the _disposables array are disposed. */ -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated function _makeAllSafe(obj: BaseComponent<{}, {}>, prototype: Object, methodNames: string[]): void { for (let i = 0, len = methodNames.length; i < len; i++) { _makeSafe(obj, prototype, methodNames[i]); } } -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated function _makeSafe(obj: BaseComponent<{}, {}>, prototype: Object, methodName: string): void { /* eslint-disable @typescript-eslint/no-explicit-any */ let classMethod = (obj as any)[methodName]; diff --git a/packages/utilities/src/DelayedRender.tsx b/packages/utilities/src/DelayedRender.tsx index 66b1c7e739394..cb5ff7aefc94f 100644 --- a/packages/utilities/src/DelayedRender.tsx +++ b/packages/utilities/src/DelayedRender.tsx @@ -6,7 +6,7 @@ import { getWindow } from './dom/getWindow'; * * @public */ -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated export interface IDelayedRenderProps extends React.Props<{}> { /** * Number of milliseconds to delay rendering children. diff --git a/packages/utilities/src/dom.ts b/packages/utilities/src/dom.ts index a1ceab1d13472..ba91870312521 100644 --- a/packages/utilities/src/dom.ts +++ b/packages/utilities/src/dom.ts @@ -13,7 +13,7 @@ export { isVirtualElement } from './dom/isVirtualElement'; export { on } from './dom/on'; export { portalContainsElement } from './dom/portalContainsElement'; export { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated raiseClick, } from './dom/raiseClick'; export { DATA_PORTAL_ATTRIBUTE, setPortalAttribute } from './dom/setPortalAttribute'; diff --git a/packages/utilities/src/index.ts b/packages/utilities/src/index.ts index f860378694b6c..63b96f7fba468 100644 --- a/packages/utilities/src/index.ts +++ b/packages/utilities/src/index.ts @@ -2,7 +2,7 @@ export { Async } from './Async'; export type { ICancelable } from './Async'; export { AutoScroll } from './AutoScroll'; export { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated BaseComponent, nullRender, } from './BaseComponent'; @@ -16,13 +16,13 @@ export type { IPerfData, IPerfMeasurement, IPerfSummary } from './FabricPerforma export { GlobalSettings } from './GlobalSettings'; export type { IChangeDescription, IChangeEventCallback } from './GlobalSettings'; export type { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated IClassNames, } from './IClassNames'; export type { IComponentAs, IComponentAsProps } from './IComponentAs'; export type { IDisposable } from './IDisposable'; export type { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated IPoint, Point, } from './Point'; @@ -61,13 +61,13 @@ export type { ICustomizations, ISettings, ISettingsFunction, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated Settings, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated SettingsFunction, } from './customizations/Customizations'; export { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated Customizer, } from './customizations/Customizer'; export type { ICustomizerProps } from './customizations/Customizer.types'; @@ -92,7 +92,7 @@ export { isVirtualElement, on, portalContainsElement, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated raiseClick, setPortalAttribute, setVirtualParent, @@ -124,7 +124,7 @@ export { hoistMethods, unhoistMethods } from './hoist'; export { hoistStatics } from './hoistStatics'; export { initializeComponentRef } from './initializeComponentRef'; export { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated initializeFocusRects, } from './initializeFocusRects'; export { FocusRects, useFocusRects } from './useFocusRects'; @@ -132,7 +132,7 @@ export { getInitials } from './initials'; export { addDirectionalKeyCode, isDirectionalKeyCode } from './keyboard'; export { getLanguage, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated setLanguage, } from './language'; export { calculatePrecision, fitContentToBounds, getDistanceBetweenPoints, precisionRound } from './math'; @@ -157,7 +157,7 @@ export { getNativeProps, htmlElementProperties, iframeProperties, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated imageProperties, imgProperties, inputProperties, @@ -175,9 +175,9 @@ export { } from './properties'; export { composeRenderFunction } from './renderFunction/composeRenderFunction'; export { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated getResourceUrl, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated setBaseUrl, } from './resources'; export { getRTL, getRTLSafeKeyCode, setRTL } from './rtl'; @@ -227,5 +227,5 @@ export { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect'; import './version'; -// eslint-disable-next-line deprecation/deprecation +// eslint-disable-next-line etc/no-deprecated export type { IStyleFunctionOrObject, Omit } from '@fluentui/merge-styles'; diff --git a/packages/utilities/src/initializeFocusRects.test.ts b/packages/utilities/src/initializeFocusRects.test.ts index 42969ad28137c..bc5f6bf9801b0 100644 --- a/packages/utilities/src/initializeFocusRects.test.ts +++ b/packages/utilities/src/initializeFocusRects.test.ts @@ -38,7 +38,7 @@ describe('initializeFocusRects', () => { beforeEach(() => { classNames = []; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated initializeFocusRects(mockWindow as Window); }); diff --git a/packages/utilities/src/initializeFocusRects.ts b/packages/utilities/src/initializeFocusRects.ts index 30f4075886f52..b7007537af489 100644 --- a/packages/utilities/src/initializeFocusRects.ts +++ b/packages/utilities/src/initializeFocusRects.ts @@ -50,6 +50,6 @@ function _onPointerDown(ev: PointerEvent): void { } function _onKeyDown(ev: KeyboardEvent): void { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated isDirectionalKeyCode(ev.which) && setFocusVisibility(true, ev.target as Element); } diff --git a/packages/utilities/src/useFocusRects.ts b/packages/utilities/src/useFocusRects.ts index f30a8845797db..eadedd6cfa69b 100644 --- a/packages/utilities/src/useFocusRects.ts +++ b/packages/utilities/src/useFocusRects.ts @@ -89,7 +89,7 @@ function _onPointerDown(ev: PointerEvent): void { } function _onKeyDown(ev: KeyboardEvent): void { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line etc/no-deprecated if (isDirectionalKeyCode(ev.which)) { setFocusVisibility(true, ev.target as Element); } diff --git a/packages/webpack-utilities/.eslintrc.json b/packages/webpack-utilities/.eslintrc.json index 9f62e5a326378..1482d20f16e21 100644 --- a/packages/webpack-utilities/.eslintrc.json +++ b/packages/webpack-utilities/.eslintrc.json @@ -3,7 +3,7 @@ "root": true, "rules": { "@typescript-eslint/no-explicit-any": "off", - "deprecation/deprecation": "off", + "etc/no-deprecated": "off", "prefer-arrow-callback": "off" } } diff --git a/yarn.lock b/yarn.lock index 1878a9e54de6b..10078a9e1f31d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3385,6 +3385,13 @@ dependencies: esquery "^1.0.1" +"@phenomnomnominal/tsquery@^4.0.0": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@phenomnomnominal/tsquery/-/tsquery-4.2.0.tgz#7742ff4af12ce673b0b601ba5515c934f1876b14" + integrity sha512-hR2U3uVcrrdkuG30ItQ+uFDs4ncZAybxWG0OjTE8ptPzVoU7GVeXpy+vMU8zX9EbmjGeITPw/su5HjYQyAH8bA== + dependencies: + esquery "^1.0.1" + "@pmmmwh/react-refresh-webpack-plugin@^0.5.1": version "0.5.4" resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.4.tgz#df0d0d855fc527db48aac93c218a0bf4ada41f99" @@ -5663,6 +5670,13 @@ dependencies: "@types/yargs-parser" "*" +"@types/yargs@^17.0.0": + version "17.0.10" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.10.tgz#591522fce85d8739bca7b8bb90d048e4478d186a" + integrity sha512-gmEaFwpj/7f/ROdtIlci1R1VYU1J4j95m8T+Tj3iBgiBFKg1foE/PSl93bBd5T9LDXNPo8UlNN6W0qwD8O5OaA== + dependencies: + "@types/yargs-parser" "*" + "@typescript-eslint/eslint-plugin@4.22.0", "@typescript-eslint/eslint-plugin@^4.22.0", "@typescript-eslint/eslint-plugin@^5.0.0": version "4.22.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.22.0.tgz#3d5f29bb59e61a9dba1513d491b059e536e16dbc" @@ -5677,7 +5691,7 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@4.22.0", "@typescript-eslint/experimental-utils@^2.19.2 || ^3.0.0", "@typescript-eslint/experimental-utils@^2.5.0", "@typescript-eslint/experimental-utils@^4.22.0", "@typescript-eslint/experimental-utils@^5.0.0": +"@typescript-eslint/experimental-utils@4.22.0", "@typescript-eslint/experimental-utils@^2.5.0", "@typescript-eslint/experimental-utils@^4.22.0", "@typescript-eslint/experimental-utils@^5.0.0": version "4.22.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.22.0.tgz#68765167cca531178e7b650a53456e6e0bef3b1f" integrity sha512-xJXHHl6TuAxB5AWiVrGhvbGL8/hbiCQ8FiWwObO3r0fnvBdrbWEDy1hlvGQOAWc6qsCWuWMKdVWlLAEMpxnddg== @@ -11407,6 +11421,15 @@ eslint-config-prettier@8.3.0, eslint-config-prettier@^8.3.0: resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a" integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew== +eslint-etc@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/eslint-etc/-/eslint-etc-5.1.0.tgz#7e99b80452fe8335065fddf7800e4495dc0922a0" + integrity sha512-Rmjl01h5smi5cbsFne2xpTuch2xNnwXiX2lbS4HttXUN5FwXKAwG1UEFBVGO1nC091YO/QyVahyfNPJSX2ae+g== + dependencies: + "@typescript-eslint/experimental-utils" "^5.0.0" + tsutils "^3.17.1" + tsutils-etc "^1.4.1" + eslint-import-resolver-node@^0.3.6: version "0.3.6" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz#4048b958395da89668252001dbd9eca6b83bacbd" @@ -11434,15 +11457,6 @@ eslint-module-utils@^2.7.2: debug "^3.2.7" find-up "^2.1.0" -eslint-plugin-deprecation@1.2.1, eslint-plugin-deprecation@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-deprecation/-/eslint-plugin-deprecation-1.2.1.tgz#ab1b80d7d0b8ce694f646ed41e03f90d3f0fbcd0" - integrity sha512-8KFAWPO3AvF0szxIh1ivRtHotd1fzxVOuNR3NI8dfCsQKgcxu9fAgEY+eTKvCRLAwwI8kaDDfImMt+498+EgRw== - dependencies: - "@typescript-eslint/experimental-utils" "^2.19.2 || ^3.0.0" - tslib "^1.10.0" - tsutils "^3.0.0" - eslint-plugin-es@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz#f0822f0c18a535a97c3e714e89f88586a7641ec9" @@ -11459,6 +11473,18 @@ eslint-plugin-es@^3.0.0: eslint-utils "^2.0.0" regexpp "^3.0.0" +eslint-plugin-etc@2.0.2, eslint-plugin-etc@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-etc/-/eslint-plugin-etc-2.0.2.tgz#98013013058209f5a1d364caf17caeb62bd817ce" + integrity sha512-g3b95LCdTCwZA8On9EICYL8m1NMWaiGfmNUd/ftZTeGZDXrwujKXUr+unYzqKjKFo1EbqJ31vt+Dqzrdm/sUcw== + dependencies: + "@phenomnomnominal/tsquery" "^4.0.0" + "@typescript-eslint/experimental-utils" "^5.0.0" + eslint-etc "^5.1.0" + requireindex "~1.2.0" + tslib "^2.0.0" + tsutils "^3.0.0" + eslint-plugin-import@2.25.4, eslint-plugin-import@^2.22.1: version "2.25.4" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz#322f3f916a4e9e991ac7af32032c25ce313209f1" @@ -22438,6 +22464,11 @@ require-package-name@^2.0.1: resolved "https://registry.yarnpkg.com/require-package-name/-/require-package-name-2.0.1.tgz#c11e97276b65b8e2923f75dabf5fb2ef0c3841b9" integrity sha1-wR6XJ2tluOKSP3Xav1+y7ww4Qbk= +requireindex@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.2.0.tgz#3463cdb22ee151902635aa6c9535d4de9c2ef1ef" + integrity sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww== + requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" @@ -25195,6 +25226,14 @@ tslib@^1.10.0, tslib@^1.13.0, tslib@^1.14.1, tslib@^1.8.1, tslib@^1.9.0, tslib@^ resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== +tsutils-etc@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/tsutils-etc/-/tsutils-etc-1.4.1.tgz#bd42a0079d534765ab314d087f8a89c77a68723f" + integrity sha512-6UPYgc7OXcIW5tFxlsZF3OVSBvDInl/BkS3Xsu64YITXk7WrnWTVByKWPCThFDBp5gl5IGHOzGMdQuDCE7OL4g== + dependencies: + "@types/yargs" "^17.0.0" + yargs "^17.0.0" + tsutils@^3.0.0, tsutils@^3.17.1: version "3.17.1" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" @@ -27078,10 +27117,10 @@ yargs@^16.1.1, yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^17.2.1: - version "17.3.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.3.1.tgz#da56b28f32e2fd45aefb402ed9c26f42be4c07b9" - integrity sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA== +yargs@^17.0.0, yargs@^17.2.1: + version "17.4.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.4.0.tgz#9fc9efc96bd3aa2c1240446af28499f0e7593d00" + integrity sha512-WJudfrk81yWFSOkZYpAZx4Nt7V4xp7S/uJkX0CnxovMCt1wCE8LNftPpNuF9X/u9gN5nsD7ycYtRcDf2pL3UiA== dependencies: cliui "^7.0.2" escalade "^3.1.1"