Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev: eslint-plugin - prepare for publishing (#2570)
- Loading branch information
Showing
2 changed files
with
82 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,80 @@ | ||
# `@cspell/eslint-plugin-cspell` | ||
# [WIP] CSpell ESLint Plugin | ||
|
||
**[WIP]** A CSpell Plugin for ESLint. | ||
A spell checker plugin for ESLint based upon CSpell. | ||
|
||
## [WIP] - Work In Progress | ||
|
||
This plugin is still in active development. Due to the nature of how files are parsed, the `cspell` command line tool and this ESLint plugin will give different results. It is recommended that ESLint or `cspell` checks a file, but not both. Use `ignorePaths` setting in `cspell.json` to tell the `cspell` command line tool to ignore files checked by ESLint. | ||
|
||
## Quick Setup | ||
|
||
- Install `@cspell/eslint-plugin` as a dev-dependency | ||
|
||
```sh | ||
npm install --save-dev @cspell/eslint-plugin | ||
``` | ||
|
||
- Add to it to `.eslintrc.json` | ||
```json | ||
"extends": ["plugin:@cspell/recommended"] | ||
``` | ||
|
||
## Options | ||
|
||
```ts | ||
interface Options { | ||
/** | ||
* Number of spelling suggestions to make. | ||
* @default 8 | ||
*/ | ||
numSuggestions: number; | ||
|
||
/** | ||
* Generate suggestions | ||
* @default true | ||
*/ | ||
generateSuggestions: boolean; | ||
|
||
/** | ||
* Output debug logs | ||
* @default false | ||
*/ | ||
debugMode?: boolean; | ||
/** | ||
* Ignore import and require names | ||
* @default true | ||
*/ | ||
ignoreImports?: boolean; | ||
/** | ||
* Spell check identifiers (variables names, function names, and class names) | ||
* @default true | ||
*/ | ||
checkIdentifiers?: boolean; | ||
/** | ||
* Spell check strings | ||
* @default true | ||
*/ | ||
checkStrings?: boolean; | ||
/** | ||
* Spell check template strings | ||
* @default true | ||
*/ | ||
checkStringTemplates?: boolean; | ||
/** | ||
* Spell check comments | ||
* @default true | ||
*/ | ||
checkComments?: boolean; | ||
} | ||
``` | ||
|
||
Example: | ||
|
||
```json | ||
{ | ||
"plugins": ["@cspell"], | ||
"rules": { | ||
"@cspell/spellchecker": ["warn", { "checkComments": false }] | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters