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

💡: Add support for YML to the CSpell ESLint Plugin #5740

Closed
1 task done
dblock opened this issue Jun 12, 2024 · 2 comments · Fixed by #5741 · 4 remaining pull requests
Closed
1 task done

💡: Add support for YML to the CSpell ESLint Plugin #5740

dblock opened this issue Jun 12, 2024 · 2 comments · Fixed by #5741 · 4 remaining pull requests

Comments

@dblock
Copy link

dblock commented Jun 12, 2024

Problem

Coming from opensearch-project/opensearch-api-specification#337 we are using eslint to check markdown files. Those have a lot of English text that we'd like to spell-check.

Solution

import parserYml from "yaml-eslint-parser"
import pluginYml from 'eslint-plugin-yml'
import pluginCspell from '@cspell/eslint-plugin'

export default [
  ...pluginYml.configs['flat/standard'],
  {
    files: ["**/*.yaml", "**/*.yml"],
    languageOptions: {
      parser: parserYml
    },
    plugins: {
      'yml': pluginYml,
      '@cspell': pluginCspell
    },
    rules: {
      '@cspell/spellchecker': 'warn'
    }
  }
]

Alternatives

No response

Additional Context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@dblock
Copy link
Author

dblock commented Jun 17, 2024

Thank you so much for adding support for this @Jason3S! Tried it out, it works!

git clone https://github.com/streetsidesoftware/cspell
cd cspell
pnpm install
pnpm bt

Added to my package.json.

    "@cspell/eslint-plugin": "file:///Users/dblock/source/cspell/upstream-cspell/packages/cspell-eslint-plugin",
$ npm run lint

/Users/dblock/source/opensearch-project/opensearch-api-specification/dblock-opensearch-api-specification/tools/tests/tester/fixtures/specs/indices_excerpt.yaml
  174:35  warning  Unknown word: "nanos"  @cspell/spellchecker
  176:46  warning  Unknown word: "nanos"  @cspell/spellchecker

opensearch-project/opensearch-api-specification#341

Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.