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

feat: Support ESLint flat config #5270

Merged
merged 4 commits into from
Feb 18, 2024
Merged

feat: Support ESLint flat config #5270

merged 4 commits into from
Feb 18, 2024

Conversation

Jason3S
Copy link
Collaborator

@Jason3S Jason3S commented Feb 18, 2024

This feature add support for ESLint flat file configuration.

Configuration (new: eslint.config.js)

eslint.config.js using recommended.

import cspellESLintPluginRecommended from '@cspell/eslint-plugin/recommended';

export default [
  // other config imports
  cspellESLintPluginRecommended
  // other configs
];

Or

eslint.config.js using configs.

import cspellConfigs from '@cspell/eslint-plugin/configs';

export default [
  // other config imports
  cspellConfigs.recommended
  // other configs
];

Or

eslint.config.js using plugins

import cspellPlugin from '@cspell/eslint-plugin';

export default [
  // other config imports
  {
    plugins: { '@cspell': cspellPlugin },
    rules: {
      '@cspell/spellchecker': ['warn', {}]
    }
  }
  // other configs
];

Configuration (Legacy: .eslintrc)

Add "plugin:@cspell/recommended" to the extends section of the configuration.

.eslintrc

{
  "extends": ["plugin:@cspell/recommended"]
}

Copy link
Contributor

github-actions bot commented Feb 18, 2024

Performance Report

Detailed Performance Report
Rep Elapsed Delta Min Max Median Avg Count
AdaDoom3/AdaDoom3 12.463 -4.69% 11.703 12.028 11.904 11.879 8
alexiosc/megistos 30.912 0.59% 30.436 32.779 31.096 31.131 8
apollographql/apollo-server 6.810 -0.25% 6.431 6.911 6.793 6.705 9
aspnetboilerplate/aspnetboilerplate 23.597 -2.84% 22.662 23.610 22.945 23.017 8
aws-amplify/docs 31.575 1.42% 30.759 33.636 32.029 32.087 8
Azure/azure-rest-api-specs 28.527 0.60% 27.635 30.838 28.698 28.976 8
bitjson/typescript-starter 0.748 0.85% 0.729 0.780 0.754 0.754 8
caddyserver/caddy 10.256 -1.30% 10.047 10.585 10.125 10.195 8
canada-ca/open-source-logiciel-libre 0.898 -1.33% 0.860 0.975 0.886 0.893 8
chef/chef 20.649 -0.75% 20.254 21.738 20.495 20.688 8
django/django 51.783 0.45% 49.551 53.176 52.016 51.688 8
eslint/eslint 31.520 -1.05% 30.421 37.111 31.192 31.869 8
exonum/exonum 11.502 0.93% 11.325 12.098 11.610 11.616 8
gitbucket/gitbucket 6.673 3.96% 6.685 7.327 6.948 6.951 8
googleapis/google-cloud-cpp 361.965 0.49% 351.866 395.651 363.753 370.333 9
graphql/express-graphql 0.798 3.35% 0.790 0.861 0.826 0.825 9
graphql/graphql-js 6.023 -2.66% 5.715 6.074 5.867 5.892 9
graphql/graphql-relay-js 0.792 0.58% 0.760 0.855 0.797 0.801 9
graphql/graphql-spec 1.858 -2.52% 1.764 1.848 1.812 1.811 9
iluwatar/java-design-patterns 28.443 2.55% 28.115 31.184 29.186 29.305 8
ktaranov/sqlserver-kit 23.315 0.33% 22.906 23.861 23.391 23.394 8
liriliri/licia 8.116 0.17% 7.733 8.438 8.130 8.147 8
MartinThoma/LaTeX-examples 13.429 1.79% 13.406 13.886 13.673 13.676 8
mdx-js/mdx 3.794 -1.53% 3.681 3.911 3.737 3.760 8
microsoft/TypeScript-Website 18.554 -3.48% 16.919 18.571 17.931 17.871 8
MicrosoftDocs/PowerShell-Docs 102.922 1.62% 99.342 112.225 104.616 105.188 9
neovim/nvim-lspconfig 8.105 2.79% 8.067 8.626 8.337 8.363 8
pagekit/pagekit 7.608 -2.98% 7.137 7.540 7.388 7.380 8
php/php-src 116.560 -6.07% 107.526 119.574 109.885 110.940 9
plasticrake/tplink-smarthome-api 1.439 2.78% 1.438 1.514 1.480 1.478 8
prettier/prettier 13.044 -0.01% 12.700 13.471 13.043 13.059 8
pycontribs/jira 2.404 1.34% 2.392 2.500 2.437 2.441 8
RustPython/RustPython 12.691 4.96% 13.169 13.596 13.352 13.370 8
shoelace-style/shoelace 7.194 2.70% 7.101 8.161 7.394 7.435 8
SoftwareBrothers/admin-bro 4.077 -1.91% 3.852 4.423 4.001 4.050 8
sveltejs/svelte 34.331 0.36% 33.886 35.774 34.456 34.771 9
TheAlgorithms/Python 16.956 -3.22% 15.934 17.077 16.426 16.409 8
twbs/bootstrap 3.569 1.68% 3.561 3.947 3.629 3.678 8
typescript-cheatsheets/react 2.055 0.31% 2.031 2.141 2.062 2.075 8
typescript-eslint/typescript-eslint 8.371 -6.36% 7.660 8.099 7.870 7.874 8
w3c/aria-practices 9.449 1.79% 9.400 10.215 9.621 9.711 8
w3c/specberus 2.776 2.22% 2.725 2.978 2.839 2.848 9
webdeveric/webpack-assets-manifest 0.750 -4.73% 0.676 0.734 0.716 0.713 8
webpack/webpack 11.927 0.69% 11.793 12.345 12.010 12.081 8
wireapp/wire-desktop 1.226 -1.84% 1.197 1.239 1.204 1.212 8
wireapp/wire-webapp 20.806 1.38% 20.400 22.736 21.097 21.227 9

Note: the stats do not include the last value.

Latest Performance by Repo
Repo                           ┃                                           ┃ Rel Val ┃   Min ┃   Max
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━╋━━━━━━━╋━━━━━━
AdaDoom3/AdaDoom3              ┃                   ┣━━┫   ●                ┃   1.047 ┃ 0.983 ┃ 1.010
alexiosc/megistos              ┃                   ┣●━━━━━┫                ┃   0.994 ┃ 0.979 ┃ 1.054
apollographql/apollo-server    ┃                ┣━━━━●━┫                   ┃   1.003 ┃ 0.947 ┃ 1.017
aspnetboilerplate/aspnetboiler ┃                    ┣━━━●                  ┃   1.028 ┃ 0.988 ┃ 1.029
aws-amplify/docs               ┃                 ┣━━●━━━━━┫                ┃   0.986 ┃ 0.960 ┃ 1.050
Azure/azure-rest-api-specs     ┃                 ┣━━●━━━━━━━━┫             ┃   0.994 ┃ 0.963 ┃ 1.075
bitjson/typescript-starter     ┃                  ┣━●━━━┫                  ┃   0.992 ┃ 0.967 ┃ 1.034
caddyserver/caddy              ┃                    ┣━●━━━┫                ┃   1.013 ┃ 0.992 ┃ 1.045
canada-ca/open-source-logiciel ┃                  ┣━━━●━━━━━━━━┫           ┃   1.013 ┃ 0.971 ┃ 1.100
chef/chef                      ┃                    ┣━●━━━━┫               ┃   1.008 ┃ 0.988 ┃ 1.061
django/django                  ┃                ┣━━━━●━┫                   ┃   0.996 ┃ 0.953 ┃ 1.022
eslint/eslint                  ┃                  ┣━━━●━━━━━━━━━━━━━━━━━┫  ┃   1.011 ┃ 0.975 ┃ 1.190
exonum/exonum                  ┃                  ┣━●━━━━┫                 ┃   0.991 ┃ 0.975 ┃ 1.042
gitbucket/gitbucket            ┃                 ●━━━━━━━━━┫               ┃   0.960 ┃ 0.962 ┃ 1.055
googleapis/google-cloud-cpp    ┃                  ┣━●━━━━━━━━━┫            ┃   0.995 ┃ 0.967 ┃ 1.088
graphql/express-graphql        ┃                 ┣●━━━━━━┫                 ┃   0.966 ┃ 0.957 ┃ 1.043
graphql/graphql-js             ┃                  ┣━━━━━●┫                 ┃   1.027 ┃ 0.974 ┃ 1.035
graphql/graphql-relay-js       ┃                ┣━━━●━━━━━━━┫              ┃   0.994 ┃ 0.954 ┃ 1.073
graphql/graphql-spec           ┃                  ┣━━━━┫●                  ┃   1.025 ┃ 0.973 ┃ 1.020
iluwatar/java-design-patterns  ┃                 ┣●━━━━━━━━━┫              ┃   0.975 ┃ 0.963 ┃ 1.068
ktaranov/sqlserver-kit         ┃                   ┣━●━┫                   ┃   0.997 ┃ 0.979 ┃ 1.020
liriliri/licia                 ┃                ┣━━━━●━━━┫                 ┃   0.998 ┃ 0.951 ┃ 1.038
MartinThoma/LaTeX-examples     ┃                   ●━━━┫                   ┃   0.982 ┃ 0.980 ┃ 1.016
mdx-js/mdx                     ┃                   ┣━━━●━━┫                ┃   1.015 ┃ 0.985 ┃ 1.047
microsoft/TypeScript-Website   ┃               ┣━━━━━━━━━●                 ┃   1.035 ┃ 0.944 ┃ 1.036
MicrosoftDocs/PowerShell-Docs  ┃                ┣━━●━━━━━━━━┫              ┃   0.984 ┃ 0.950 ┃ 1.073
neovim/nvim-lspconfig          ┃                  ●━━━━━━┫                 ┃   0.972 ┃ 0.968 ┃ 1.035
pagekit/pagekit                ┃                  ┣━━━━┫●                  ┃   1.030 ┃ 0.966 ┃ 1.021
php/php-src                    ┃                   ┣━━━━━━━●━━┫            ┃   1.061 ┃ 0.979 ┃ 1.088
plasticrake/tplink-smarthome-a ┃                  ●━━━━┫                   ┃   0.972 ┃ 0.972 ┃ 1.022
prettier/prettier              ┃                  ┣━━●━━┫                  ┃   1.000 ┃ 0.974 ┃ 1.033
pycontribs/jira                ┃                   ┣●━━━┫                  ┃   0.987 ┃ 0.982 ┃ 1.026
RustPython/RustPython          ┃                ●   ┣━━┫                   ┃   0.950 ┃ 0.986 ┃ 1.018
shoelace-style/shoelace        ┃                 ┣●━━━━━━━━━━━━┫           ┃   0.973 ┃ 0.960 ┃ 1.104
SoftwareBrothers/admin-bro     ┃                 ┣━━━━━●━━━━━━━━┫          ┃   1.019 ┃ 0.963 ┃ 1.105
sveltejs/svelte                ┃                   ┣━●━━━┫                 ┃   0.996 ┃ 0.983 ┃ 1.038
TheAlgorithms/Python           ┃                  ┣━━━━━●┫                 ┃   1.032 ┃ 0.970 ┃ 1.040
twbs/bootstrap                 ┃                   ●━━━━━━━━━━┫            ┃   0.983 ┃ 0.981 ┃ 1.087
typescript-cheatsheets/react   ┃                   ┣━●━━━┫                 ┃   0.997 ┃ 0.985 ┃ 1.039
typescript-eslint/typescript-e ┃                  ┣━━━━━┫  ●               ┃   1.064 ┃ 0.973 ┃ 1.029
w3c/aria-practices             ┃                   ●━━━━━━━┫               ┃   0.982 ┃ 0.977 ┃ 1.062
w3c/specberus                  ┃                 ┣━●━━━━━━┫                ┃   0.978 ┃ 0.960 ┃ 1.049
webdeveric/webpack-assets-mani ┃               ┣━━━━━━━━┫ ●                ┃   1.047 ┃ 0.945 ┃ 1.026
webpack/webpack                ┃                   ┣●━━━┫                  ┃   0.993 ┃ 0.982 ┃ 1.028
wireapp/wire-desktop           ┃                    ┣━━●┫                  ┃   1.018 ┃ 0.995 ┃ 1.029
wireapp/wire-webapp            ┃                  ┣━●━━━━━━━━┫             ┃   0.986 ┃ 0.967 ┃ 1.078

**Breaking**

For non-flag configuration, it is necessary to use `recommended-legacy` instead of `recommended`
To avoid breaking existing configurations keep the old way of doing this and add exports for the new config.
@Jason3S Jason3S marked this pull request as ready for review February 18, 2024 16:31
@Jason3S Jason3S merged commit ac583af into main Feb 18, 2024
81 checks passed
@Jason3S Jason3S deleted the dev-eslint branch February 18, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant