-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support
--fix
in ESLint plugin (#4162)
- Loading branch information
Showing
15 changed files
with
126 additions
and
18 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ignorePaths: | ||
- cspell*.{yaml,json} | ||
ignoreWords: | ||
- todos | ||
- bluelist | ||
words: | ||
- estree | ||
- pnpm | ||
- synckit | ||
- treeshake | ||
- tsbuildinfo |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
ignorePaths: | ||
- cspell*.{yaml,json} | ||
ignoreWords: | ||
- todos | ||
flagWords: | ||
- blacklist->denylist | ||
- whitelist->allowlist | ||
- café->cafe | ||
- bluelist->greenList | ||
- Bluelist->GreenList |
12 changes: 12 additions & 0 deletions
12
packages/cspell-eslint-plugin/fixtures/with-errors/auto-fix.ts
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const bluelist = ['one', 'two', 'three']; | ||
|
||
/** | ||
* This is a file with errors that can be autoFixed. | ||
* | ||
* Time to go to the café. | ||
*/ | ||
export function calcBluelist(names: string[]) { | ||
const bluelistSet = new Set(bluelist); | ||
|
||
return names.filter(name => bluelistSet.has(name)); | ||
} |
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
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
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
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
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
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
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
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
14 changes: 14 additions & 0 deletions
14
test-packages/cspell-eslint-plugin/test-cspell-eslint-plugin/cspell.config.yaml
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
ignorePaths: | ||
- "*.{ts,js}" | ||
- "cspell*.{json,yaml}" | ||
ignoreWords: | ||
- quic | ||
- tsbuildinfo | ||
words: | ||
- pnpm | ||
flagWords: | ||
- blacklist->denylist | ||
- whitelist->allowlist | ||
- café->cafe | ||
- bluelist->greenList | ||
- Bluelist->GreenList |
5 changes: 0 additions & 5 deletions
5
test-packages/cspell-eslint-plugin/test-cspell-eslint-plugin/cspell.json
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
test-packages/cspell-eslint-plugin/test-cspell-eslint-plugin/fixtures/auto-fix.ts
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const bluelist = ['one', 'two', 'three']; | ||
|
||
/** | ||
* This is a file with errors that can be autoFixed. | ||
* | ||
* Time to go to the café. | ||
*/ | ||
export function calcBluelist(names: string[]) { | ||
const bluelistSet = new Set(bluelist); | ||
|
||
return names.filter((name) => bluelistSet.has(name)); | ||
} |