Skip to content

Commit

Permalink
dev: eslint-plugin add recommended and options (#2564)
Browse files Browse the repository at this point in the history
* dev: eslint-plugin add recommended

* dev: eslint-plugin add options

Add Options:
- numSuggestions
- generateSuggestions
- debugMode

* Do not lint auto generated files.

* Update cspell-eslint-plugin.ts
  • Loading branch information
Jason3S committed Mar 11, 2022
1 parent 813872f commit 9f3e6e6
Show file tree
Hide file tree
Showing 15 changed files with 532 additions and 220 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
**/dist/**
**/node_modules/**
**/package-lock.json
**/_auto_generated_/**
CHANGELOG.md
coverage
cspell.json
Expand Down
146 changes: 145 additions & 1 deletion packages/cspell-eslint-plugin/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions packages/cspell-eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@
"!**/*.map"
],
"scripts": {
"build": "rollup --config rollup.config.ts --configPlugin typescript",
"watch": "npm run build -- --watch",
"build": "npm run build-schema && npm run build-rollup",
"build-rollup": "rollup --config rollup.config.ts --configPlugin typescript",
"build-schema": "ts-json-schema-generator --no-top-ref --path src/options.ts --type Options -o ./src/_auto_generated_/options.schema.json",
"watch": "npm run build-rollup -- --watch",
"clean": "rimraf dist coverage .tsbuildinfo",
"clean-build": "npm run clean && npm run build",
"coverage": "echo coverage",
Expand All @@ -53,6 +55,7 @@
},
"devDependencies": {
"@rollup/plugin-commonjs": "^21.0.2",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"@rollup/plugin-typescript": "^8.3.1",
"@types/eslint": "^8.4.1",
Expand All @@ -65,7 +68,8 @@
"mocha": "^9.2.1",
"rimraf": "^3.0.2",
"rollup": "^2.70.0",
"rollup-plugin-dts": "^4.2.0"
"rollup-plugin-dts": "^4.2.0",
"ts-json-schema-generator": "^0.98.0"
},
"dependencies": {
"cspell-lib": "^5.18.5"
Expand Down
2 changes: 2 additions & 0 deletions packages/cspell-eslint-plugin/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import rollupPluginNodeResolve from '@rollup/plugin-node-resolve';
import rollupPluginTypescript from '@rollup/plugin-typescript';
import rollupPluginJson from '@rollup/plugin-json';
import rollupPluginDts from 'rollup-plugin-dts';
import type { RollupOptions } from 'rollup';

Expand Down Expand Up @@ -39,6 +40,7 @@ function getPlugins(tsconfig = 'tsconfig.build.json') {
rollupPluginTypescript({
tsconfig,
}),
rollupPluginJson(),
];
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"definitions": {},
"properties": {
"debugMode": {
"default": false,
"description": "Output debug logs",
"type": "boolean"
},
"generateSuggestions": {
"default": true,
"description": "Generate suggestions",
"type": "boolean"
},
"numSuggestions": {
"default": 8,
"description": "Number of spelling suggestions to make.",
"type": "number"
}
},
"required": [
"numSuggestions",
"generateSuggestions",
"debugMode"
],
"type": "object"
}
Loading

0 comments on commit 9f3e6e6

Please sign in to comment.