Skip to content

Commit

Permalink
dev: eslint-plugin - prepare for publishing (#2570)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed Mar 12, 2022
1 parent 41b292a commit 30e0ee4
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 5 deletions.
81 changes: 79 additions & 2 deletions packages/cspell-eslint-plugin/README.md
@@ -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 }]
}
}
```
6 changes: 3 additions & 3 deletions packages/cspell-eslint-plugin/tsconfig.base.json
@@ -1,10 +1,10 @@
{
"compilerOptions": {
"target": "ESNext",
"target": "ES2020",
"lib": [
"ESNext"
"ES2020"
],
"module": "ESNext",
"module": "ES2020",
"moduleResolution": "node",
"resolveJsonModule": true,
"allowJs": false,
Expand Down

0 comments on commit 30e0ee4

Please sign in to comment.