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

dev: eslint-plugin - prepare for publishing #2570

Merged
merged 1 commit into from Mar 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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