streetsidesoftware / cspell

A Spell Checker for Code!

Home Page:https://cspell.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update `@cspell/eslint-plugin` readme so that it does not suggest configuring "dictionaries" and "dictionaryDefinitions" is possible

Drew-Daniels opened this issue · comments

Is your feature request related to a problem? Please describe.
The README for @cspell/eslint-plugin suggests that you can pass your own custom dictionaries and dictionaryDefinitions to cspell, but when I try this, I get an error when I run eslint:

Error: .eslintrc.js:
        Configuration for rule "@cspell/spellchecker" is invalid:
        Value {"autoFix":true,"dictionaries":["business-terminology"],"dictionaryDefinitions":[{"name":"business-terminology","path":"./dictionaries/business-terminology.txt"}],"checkComments":true,"checkIdentifiers":true,"checkJSXText":true,"checkStringTemplates":true,"checkStrings":true,"debugMode":false,"generateSuggestions":true,"ignoreImportProperties":true,"ignoreImports":true,"numSuggestions":8} should NOT have additional properties.

Here is my .eslintrc.js:

module.exports = {
  env: {
    browser: true,
    commonjs: true,
    es6: true,
    jest: true,
    node: true
  },
  extends: [
    "eslint:recommended",
    "plugin:react/recommended",
    "plugin:jsx-a11y/recommended",
    "plugin:react-hooks/recommended",
    "plugin:jest/recommended",
    "plugin:testing-library/react",
    "plugin:@cspell/recommended"
  ],
  parser: "babel-eslint",
  parserOptions: {
    ecmaFeatures: { jsx: true },
    ecmaVersion: 2018,
    sourceType: "module"
  },
  plugins: ["@cspell"],
  root: true,
  rules: {
    "@cspell/spellchecker": [
      "warn",
      { 
        "autoFix": true, 
        "cspell": {
          "dictionaries": ["business-terminology"],
          "dictionaryDefinitions": [
            {
              "name": "business-terminology",
              "path": "./dictionaries/business-terminology.txt",
            }
          ]
        }
      }
    ]
  },
  settings: {
    react: { version: "detect" }
  }
}

dictionaries/business-terminology.txt

*likert*
*datetime*
*plannable*
*fhir*
*pendo*

Describe the solution you'd like
I want the README to be in sync with how @cspell/eslint-plugin can actually be configured.

Describe alternatives you've considered
I have tried:

  • Typing cspell as cSpell as suggested in the README on npm
  • Tried moving my dictionary and dictionaryDefinitions outside of the cspell property (and removing the cspell property from my eslint config)

None work, making me think that this is possible, and the docs just need to be updated.

Additional context
image

@Drew-Daniels,

It looks like this feature was never fully working. I'll put up a fix soon.

Awesome thanks a lot @Jason3S !

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.