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 spell checking more document types #5741

Merged
merged 6 commits into from
Jun 13, 2024
Merged

feat: Support spell checking more document types #5741

merged 6 commits into from
Jun 13, 2024

Conversation

Jason3S
Copy link
Collaborator

@Jason3S Jason3S commented Jun 13, 2024

fixes #5740

Checking Custom AST Nodes

The checkScope setting is used to enable / disable checking AST Nodes. Parsers are used to generate the AST (Abstract Syntax Tree) used by ESLint to evaluate a document. Each PlugIn gets access to the AST. checkScope can be used to handle new AST node when a custom parser is added.

rules: {
  '@cspell/spellchecker': ['warn', { checkScope: [
    ['JSONLiteral': true],  // will match AST Nodes of type `JSONLiteral` and spell check the value.
    ['JSONProperty[key] JSONLiteral', false]  // will turn off checking the JSON Property keys.
    ['JSONProperty JSONLiteral', false]  // will turn off checking the JSON Property keys and values.
    ['JSONProperty[value] JSONLiteral', true]  // will turn on checking the JSON Property values.
    ['YAMLPair[key] YAMLScalar', true],
    ['YAMLPair[value] YAMLScalar', true],
    ['YAMLSequence YAMLScalar', true],
  ] }],
},

New Options

  /**
   * Scope selectors to spell check.
   * This is a list of scope selectors to spell check.
   *
   * Example:
   * ```js
   * checkScope: [
   *     ['YAMLPair[key] YAMLScalar', true],
   *     ['YAMLPair[value] YAMLScalar', true],
   *     ['YAMLSequence[entries] YAMLScalar', true],
   *     ['JSONProperty[key] JSONLiteral', true],
   *     ['JSONProperty[value] JSONLiteral', true],
   *     ['JSONArrayExpression JSONLiteral', true],
   * ],
   * ```
   *
   * To turn off checking JSON keys, use the following:
   *
   * ```js
   * checkScope: [
   *     ['JSONProperty[key] JSONLiteral', false],
   * ],
   * ```
   *
   * @since 8.9.0
   */
  checkScope?: ScopeSelectorList;

Copy link
Contributor

github-actions bot commented Jun 13, 2024

Performance Report

Repository Elapsed Min/Avg/Max SD SD Graph
AdaDoom3/AdaDoom3 12.11 11.9 / 12.3 / 13.9 0.38 ┣━━┻━●╋━━┻━━┫
alexiosc/megistos 31.14 29.5 / 31.1 / 33.0 0.83 ┣━━┻━━●━━┻━━┫
apollographql/apollo-server 6.75 6.4 / 6.7 / 7.0 0.17 ┣━┻━━╋●━┻━┫
aspnetboilerplate/aspnetboilerplate 24.50 23.3 / 24.4 / 25.8 0.66 ┣━━┻━━●━━┻━━┫
aws-amplify/docs 37.22 35.3 / 36.6 / 38.5 0.93 ┣━━┻━━╋━●┻━━┫
Azure/azure-rest-api-specs 33.30 30.0 / 31.8 / 34.3 1.19 ┣━━┻━━╋━━┻●━┫
bitjson/typescript-starter 0.87 0.8 / 0.9 / 1.1 0.07 ┣━━┻━●━┻━━┫
caddyserver/caddy 11.39 11.2 / 11.7 / 12.6 0.35 ┣━━┻●━╋━━┻━━┫
canada-ca/open-source-logiciel-libre 0.97 1.0 / 1.0 / 1.1 0.03 ┣━━●━╋━┻━━┫
chef/chef 19.82 19.8 / 20.6 / 21.7 0.55 ┣━●┻━━╋━━┻━━┫
django/django 51.75 50.2 / 52.4 / 54.8 1.16 ┣━━━┻●━╋━━┻━━━┫
eslint/eslint 32.42 29.7 / 31.6 / 33.7 0.89 ┣━━┻━━╋━━●━━┫
exonum/exonum 11.82 11.3 / 11.8 / 12.6 0.31 ┣━━┻━━●━━┻━━┫
gitbucket/gitbucket 7.11 6.7 / 7.0 / 7.5 0.21 ┣━━┻━━╋━●┻━━┫
googleapis/google-cloud-cpp 411.19 378.1 / 392.6 / 418.4 9.74 ┣━━━┻━━━╋━━━┻━━━●
graphql/express-graphql 0.90 0.9 / 0.9 / 1.0 0.03 ┣━●┻━╋━┻━━┫
graphql/graphql-js 6.01 5.7 / 6.0 / 7.0 0.27 ┣━━┻━━●━━┻━━┫
graphql/graphql-relay-js 0.92 0.9 / 0.9 / 1.1 0.04 ┣━━┻●╋━┻━━┫
graphql/graphql-spec 1.88 1.8 / 1.9 / 2.0 0.05 ┣━━┻●╋━┻━━┫
iluwatar/java-design-patterns 33.52 30.8 / 32.6 / 36.2 1.10 ┣━━┻━━╋━━●━━┫
ktaranov/sqlserver-kit 22.28 22.1 / 23.4 / 25.3 0.68 ┣●━┻━━╋━━┻━━┫
liriliri/licia 8.06 7.5 / 8.0 / 8.7 0.28 ┣━━┻━━╋●━┻━━┫
MartinThoma/LaTeX-examples 13.56 12.8 / 13.9 / 15.2 0.45 ┣━━●━━╋━━┻━━┫
mdx-js/mdx 3.96 3.7 / 3.8 / 4.2 0.12 ┣━┻━━╋━━●━┫
microsoft/TypeScript-Website 17.64 17.1 / 18.6 / 20.6 1.02 ┣━━●━━╋━━┻━━┫
MicrosoftDocs/PowerShell-Docs 88.99 85.0 / 89.0 / 92.9 1.84 ┣━━━┻━━●━━┻━━━┫
neovim/nvim-lspconfig 9.23 8.6 / 9.1 / 9.9 0.29 ┣━━┻━━╋●━┻━━┫
pagekit/pagekit 7.47 7.4 / 7.7 / 8.3 0.26 ┣━━●━━╋━━┻━━┫
php/php-src 112.51 110.5 / 115.4 / 122.3 3.16 ┣━━┻●━━╋━━━┻━━┫
plasticrake/tplink-smarthome-api 1.58 1.5 / 1.5 / 1.7 0.05 ┣━━┻━╋━●━━┫
prettier/prettier 14.02 12.9 / 13.4 / 14.1 0.30 ┣━━┻━━╋━━┻━━●
pycontribs/jira 2.70 2.5 / 2.7 / 3.0 0.11 ┣━┻━━╋●━┻━┫
RustPython/RustPython 14.47 13.8 / 14.6 / 16.1 0.51 ┣━━┻━●╋━━┻━━┫
shoelace-style/shoelace 7.32 7.2 / 7.5 / 8.5 0.31 ┣━━┻●━╋━━┻━━┫
SoftwareBrothers/admin-bro 4.64 4.5 / 4.7 / 5.0 0.14 ┣━┻━●╋━━┻━┫
sveltejs/svelte 38.81 36.6 / 37.9 / 39.5 0.81 ┣━━┻━━╋━━┻●━┫
TheAlgorithms/Python 16.51 16.2 / 16.9 / 17.7 0.37 ┣━━●━━╋━━┻━━┫
twbs/bootstrap 3.71 3.6 / 3.7 / 4.0 0.11 ┣━┻━━●━━┻━┫
typescript-cheatsheets/react 2.06 2.0 / 2.1 / 2.3 0.07 ┣━━●━╋━┻━━┫
typescript-eslint/typescript-eslint 6.74 6.3 / 6.7 / 7.5 0.28 ┣━━┻━━●━━┻━━┫
w3c/aria-practices 9.53 9.2 / 9.7 / 10.5 0.32 ┣━━┻●━╋━━┻━━┫
w3c/specberus 2.88 2.8 / 3.0 / 3.3 0.12 ┣━┻●━╋━━┻━┫
webdeveric/webpack-assets-manifest 0.83 0.8 / 0.8 / 1.0 0.04 ┣━━┻━●━┻━━┫
webpack/webpack 11.91 11.5 / 12.2 / 13.0 0.34 ┣━━┻●━╋━━┻━━┫
wireapp/wire-desktop 1.33 1.3 / 1.4 / 1.6 0.08 ┣━━┻●╋━┻━━┫
wireapp/wire-webapp 21.35 19.5 / 21.4 / 22.8 0.69 ┣━━┻━━●━━┻━━┫
Repository Elapsed Rel Trend Count
AdaDoom3/AdaDoom3 12.11 -1.39% ▄█▄▃▄▂▃▃▅▂▃▃▄▅▃▄▂▄▄▃ 29
alexiosc/megistos 31.14 0.06% ▆▅▃▅▇▁▅▆▄▃▄▃▂▃▄▄▃▅▃▄ 29
apollographql/apollo-server 6.75 0.60% ▅▃▂▆▃▃▄▆▁▄▂▅▅▁▂▆▅▄▄▄ 29
aspnetboilerplate/aspnetboilerplate 24.50 0.32% ▂▅▃▃▂▇▃▁▃▄▇▅▃▃▃▃▇▇▄▄ 29
aws-amplify/docs 37.22 1.75% ▂▇▆▃▆▄▇▆▅▅▅▃▂▆▃▄▁▃▄▅ 29
Azure/azure-rest-api-specs 33.30 4.57% ▄▂▁▅▁▇▄▂▄▅▆▃▆▃▄▅▆▃▃▆ 29
bitjson/typescript-starter 0.87 -0.89% ▃▃█▇▄▄▃▃▃▃▄▃▃▃▃▂▄▂▆▄ 29
caddyserver/caddy 11.39 -2.32% ▁▃▅▅▄▂▄▂▅▄▇▂▄▃▃▅▆▄▂▂ 29
canada-ca/open-source-logiciel-libre 0.97 -2.87% ▂▃█▃█▄▅▃▃▃▃▂▇▅▄▃▃▃▄▂ 29
chef/chef 19.82 -3.92% ▅▇▂▃▃▃▄▆▇▄▁▃▃▄▃▂▃▂▂▁ 29
django/django 51.75 -1.17% ▃▂▃▆▅▅▄▁▂▆▂▄▄▅▃▄▆▄▅▃ 29
eslint/eslint 32.42 2.51% ▇▄▂▅▄▇ ▃▄▄▃▂▂▃▃▂▇▅▄▅ 29
exonum/exonum 11.82 0.21% ▄▂▄▅▄▃▅▂▅▂▂▃▆▃▂▃▂▃▃▄ 29
gitbucket/gitbucket 7.11 2.12% ▂▃▂▃▅▅▂▅▃▃▄▁▇▆▁▄▃▅▃▅ 29
googleapis/google-cloud-cpp 411.19 4.75% ▄▃▁▆▄▄▅▃▃▁▆▂▂▄▅▆▃▂▅▇ 31
graphql/express-graphql 0.90 -3.60% ▆▄▂▃▆▄▅▃▃▂█▄▂▅▂▄▂▄▂▂ 29
graphql/graphql-js 6.01 -0.59% ▄▃▄▄▄▄▂▅▄▅▂▂▂▄▂▂▄▃▇▃ 29
graphql/graphql-relay-js 0.92 -2.10% ▂█▇▃▄▃▃▂▃▇▃▃▃▅▃▄▃▃▂▃ 29
graphql/graphql-spec 1.88 -1.58% ▄▃▃▅▃▆▃▅▄▂▃▂▂▃▂▂▂▇▃▃ 29
iluwatar/java-design-patterns 33.52 2.70% ▃▁▁▃▃▃▆▂▅▄▃▃▄█▄▅▅▅▄▅ 29
ktaranov/sqlserver-kit 22.28 -4.77% ▂▃▄▃▂▄▅▃▂▃▂▆▄▄█▃▃▁▃▁ 29
liriliri/licia 8.06 1.26% ▅▅▃▃▄▁▃▃▅▇▁▃▂▄▂▃▆▃▅▄ 29
MartinThoma/LaTeX-examples 13.56 -2.75% ▄▃▁▄▂█▂▃▅▄▃▃▄▇▃▃▄▃▄▂ 29
mdx-js/mdx 3.96 3.23% ▂▄▃▃▄▂▄▃▃▆▂▇▄▂▃▅▅▃▄▅ 29
microsoft/TypeScript-Website 17.64 -5.15% ▃▂▃▄▅▇▅▅▇▅▅▅▅▆▅▅▅▃▂▂ 29
MicrosoftDocs/PowerShell-Docs 88.99 -0.04% ▃▂▃▃▄▃▄▅▆▄▄▁▅▃▄▆▂▄▄ 29
neovim/nvim-lspconfig 9.23 1.56% ▂▂▁▃▃▄▅▃▇▆▃▄▂▂▃▄▅▅▃▄ 29
pagekit/pagekit 7.47 -3.36% ▃▁▄▂▅▃▅▇▃▃▂▃▃▂▂▃▇▃▄▂ 29
php/php-src 112.51 -2.50% ▃▄▅▅▃▂▅▄▆▄▆▂▃▂▇▄▂▃▃▂ 30
plasticrake/tplink-smarthome-api 1.58 2.96% ▃▃▁█▂▆▃▃▅▄▂▃▂▅▂▃▄▃▅▅ 29
prettier/prettier 14.02 4.79% ▅▅▁▆▃▃▃▃▄▃▅▁▃▃▁▃▂▆▅▇ 29
pycontribs/jira 2.70 0.92% ▃▅▂▂▃▂▂▂▄▅▃▂▅▅▆▄▄▄▄▄ 29
RustPython/RustPython 14.47 -0.62% ▂▃▂▁█▅▄▄▂▃▅▃▅▃▃▅▂▃▅▃ 29
shoelace-style/shoelace 7.32 -2.41% ▅▃▃▄▇▂▄▂▄▃▂▅▂▂█▄▃▆▄▃ 29
SoftwareBrothers/admin-bro 4.64 -0.62% ▄▃▄▃▃▆▇▂▂▄▆▄▂▂▂▃▃▃▄▃ 29
sveltejs/svelte 38.81 2.45% ▄▃▁▇▁▂▁▃▂▆▅▃▄▇▄▆▄▃▅▆ 29
TheAlgorithms/Python 16.51 -2.17% ▁▄▄▆▃▂▄▃▇▂▃▅▃▃▁▆▅▄▆▂ 29
twbs/bootstrap 3.71 -0.21% ▄▃▁▂▃▇▅▂▄▆▃▅▂█▃▂▄▅▄▄ 29
typescript-cheatsheets/react 2.06 -2.74% ▄█▂▃▆▄▃▃▇▅▂▃▄▄▂▅▃▄▂▂ 29
typescript-eslint/typescript-eslint 6.74 0.56% ▄▂▃▅▂▂▂▃▃█▆▃▃▂▅▇▄▅▄▄ 29
w3c/aria-practices 9.53 -2.24% ▅▄▆▃█▂▃▅▄▄▂▅▁▂▆▇▂▄▄▃ 29
w3c/specberus 2.88 -3.12% ▇▅▂▄▃▄▂▃▂▄▃▃▄▂▃▅▅█▄▂ 29
webdeveric/webpack-assets-manifest 0.83 -1.02% ▄▃▆▄▃▃▃█▃▃▃█▃▅▃▄▃▄▄▃ 29
webpack/webpack 11.91 -2.14% ▅▂▅▄▆▄▃▅▄▂▅█▃▄▃▅▆▅▃▂ 29
wireapp/wire-desktop 1.33 -2.88% ▃▃▃▆▂▃▃▂▅█▂▇▂▂▃▂▂▅▃▃ 29
wireapp/wire-webapp 21.35 -0.12% ▃▂ ▄▃▅▂▄▇▃▄▆▄▄▃▆▅▃▃▄ 29

Note:

  • Elapsed time is in seconds. The trend graph shows the last 10 runs.
    The SD graph shows the current run relative to the average and standard deviation.
  • Rel is the relative change from the average.

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.

💡: Add support for YML to the CSpell ESLint Plugin
1 participant