Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update naming of plugins #602

Merged
merged 6 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ module.exports = [
},
plugins: {
eslintPlugin,
importPlugin,
import: importPlugin,
'i18n-text': fixupPluginRules(i18nTextPlugin),
},
rules: {
'importPlugin/extensions': 'off',
'importPlugin/no-commonjs': 'off',
'import/extensions': 'off',
'import/no-commonjs': 'off',
'github/filenames-match-regex': 'off',
'i18n-text/no-en': 'off',
'eslint-plugin/prefer-placeholders': 'off',
Expand Down
10 changes: 5 additions & 5 deletions lib/configs/flat/browser.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
const globals = require('globals')
const github = require('../../plugin')
const importPlugin = require('eslint-plugin-import')
const escompatPlugin = require('eslint-plugin-escompat')
const escompat = require('eslint-plugin-escompat')
const {fixupPluginRules} = require('@eslint/compat')

module.exports = {
...escompatPlugin.configs['flat/recommended'],
...escompat.configs['flat/recommended'],
languageOptions: {
globals: {
...globals.browser,
},
},
plugins: {importPlugin, escompatPlugin, github: fixupPluginRules(github)},
plugins: {import: importPlugin, escompat, github: fixupPluginRules(github)},
rules: {
'escompatPlugin/no-dynamic-imports': 'off',
'escompat/no-dynamic-imports': 'off',
'github/async-currenttarget': 'error',
'github/async-preventdefault': 'error',
'github/get-attribute': 'error',
Expand All @@ -25,7 +25,7 @@ module.exports = {
'github/no-useless-passive': 'error',
'github/require-passive-events': 'error',
'github/prefer-observers': 'error',
'importPlugin/no-nodejs-modules': 'error',
'import/no-nodejs-modules': 'error',
'no-restricted-syntax': [
'error',
{
Expand Down
14 changes: 7 additions & 7 deletions lib/configs/flat/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,31 @@ module.exports = {
},
},
},
plugins: {github: fixupPluginRules(github), jsxA11yPlugin},
plugins: {github: fixupPluginRules(github), 'jsx-a11y': jsxA11yPlugin},
rules: {
'jsxA11yPlugin/role-supports-aria-props': 'off', // Override with github/a11y-role-supports-aria-props until https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/910 is resolved
'jsx-a11y/role-supports-aria-props': 'off', // Override with github/a11y-role-supports-aria-props until https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/910 is resolved
'github/a11y-aria-label-is-well-formatted': 'error',
'github/a11y-no-visually-hidden-interactive-element': 'error',
'github/a11y-no-title-attribute': 'error',
'github/a11y-svg-has-accessible-name': 'error',
'github/a11y-role-supports-aria-props': 'error',
'jsxA11yPlugin/no-aria-hidden-on-focusable': 'error',
'jsxA11yPlugin/no-autofocus': 'off',
'jsxA11yPlugin/anchor-ambiguous-text': [
'jsx-a11y/no-aria-hidden-on-focusable': 'error',
'jsx-a11y/no-autofocus': 'off',
'jsx-a11y/anchor-ambiguous-text': [
'error',
{
words: ['this', 'more', 'read here', 'read more'],
},
],
'jsxA11yPlugin/no-interactive-element-to-noninteractive-role': [
'jsx-a11y/no-interactive-element-to-noninteractive-role': [
'error',
{
tr: ['none', 'presentation'],
td: ['cell'], // TODO: Remove once https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/pull/937#issuecomment-1638128318 is addressed.
canvas: ['img'],
},
],
'jsxA11yPlugin/no-redundant-roles': [
'jsx-a11y/no-redundant-roles': [
'error',
{
nav: ['navigation'], // default in eslint-plugin-jsx-a11y
Expand Down
44 changes: 22 additions & 22 deletions lib/configs/flat/recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
plugins: {
prettierPlugin,
eslintComments,
importPlugin,
import: importPlugin,
'i18n-text': fixupPluginRules(i18nTextPlugin),
noOnlyTestsPlugin,
github: fixupPluginRules(github),
Expand All @@ -39,15 +39,15 @@ module.exports = {
'github/no-then': 'error',
'github/no-dynamic-script-tag': 'error',
'i18n-text/no-en': ['error'],
'importPlugin/default': 'error',
'importPlugin/export': 'error',
'importPlugin/extensions': 'error',
'importPlugin/first': 'error',
'importPlugin/named': 'error',
'importPlugin/namespace': 'error',
'importPlugin/no-absolute-path': 'error',
'importPlugin/no-amd': 'error',
'importPlugin/no-anonymous-default-export': [
'import/default': 'error',
'import/export': 'error',
'import/extensions': 'error',
'import/first': 'error',
'import/named': 'error',
'import/namespace': 'error',
'import/no-absolute-path': 'error',
'import/no-amd': 'error',
'import/no-anonymous-default-export': [
'error',
{
allowAnonymousClass: false,
Expand All @@ -58,17 +58,17 @@ module.exports = {
allowObject: true,
},
],
'importPlugin/no-commonjs': 'error',
'importPlugin/no-deprecated': 'error',
'importPlugin/no-duplicates': 'error',
'importPlugin/no-dynamic-require': 'error',
'importPlugin/no-extraneous-dependencies': [0, {devDependencies: false}],
'importPlugin/no-mutable-exports': 'error',
'importPlugin/no-named-as-default': 'error',
'importPlugin/no-named-as-default-member': 'error',
'importPlugin/no-namespace': 'error',
'importPlugin/no-unresolved': 'error',
'importPlugin/no-webpack-loader-syntax': 'error',
'import/no-commonjs': 'error',
'import/no-deprecated': 'error',
'import/no-duplicates': 'error',
'import/no-dynamic-require': 'error',
'import/no-extraneous-dependencies': [0, {devDependencies: false}],
'import/no-mutable-exports': 'error',
'import/no-named-as-default': 'error',
'import/no-named-as-default-member': 'error',
'import/no-namespace': 'error',
'import/no-unresolved': 'error',
'import/no-webpack-loader-syntax': 'error',
'no-case-declarations': 'error',
'no-class-assign': 'error',
'no-compare-neg-zero': 'error',
Expand Down Expand Up @@ -139,7 +139,7 @@ module.exports = {
eqeqeq: ['error', 'smart'],
},
settings: {
'importPlugin/resolver': {
'import/resolver': {
node: {
extensions: ['.js', '.ts'],
},
Expand Down
7 changes: 3 additions & 4 deletions lib/configs/flat/typescript.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
const eslint = require('@eslint/js')
const tseslint = require('typescript-eslint')
const escompatPlugin = require('eslint-plugin-escompat')
const escompat = require('eslint-plugin-escompat')
const github = require('../../plugin')
const {fixupPluginRules} = require('@eslint/compat')

module.exports = tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommended, {
module.exports = tseslint.config(...tseslint.configs.recommended, ...escompat.configs['flat/typescript-2020'], {
languageOptions: {
parser: tseslint.parser,
},
plugins: {'@typescript-eslint': tseslint.plugin, escompatPlugin, github: fixupPluginRules(github)},
plugins: {'@typescript-eslint': tseslint.plugin, escompat, github: fixupPluginRules(github)},
rules: {
camelcase: 'off',
'no-unused-vars': 'off',
Expand Down