Strict ESLint config for cpuabuse.
Feel free to reuse any bits.
npm install --save-dev @cpuabuse/eslint-config
Peer dependencies must also be installed.
Create a file in the root of the project named .eslintrc.yml
to extend default config, containing the following:
extends: "@cpuabuse"
In case of using additional configs, ESLint does not support omitting eslint-config
for scoped modules.
Following configs, are mutually exclusive, and default config conditionally extends them, based on path/extension.
Each config has a respective package entry point.
Used by default config for TypeScript files, .eslintrc.yml
should contain the following:
extends: "@cpuabuse/eslint-config/typescript"
If setting parserOptions
' project
, it should be set relative to this package's dist/release/eslint/typescript.js
, unless tsconfigRootDir
is also provided. If installed in node_modules
it defaults to tsconfig.json
in folder, containing node_modules
.
Rules for Vue, .eslintrc.yml
should contain the following:
extends: "@cpuabuse/eslint-config/vue"
Rules for Vue TSX, .eslintrc.yml
should contain the following:
extends: "@cpuabuse/eslint-config/vue-tsx"
This package provides tsdoc.json
to extend via tsdoc
entry point.
Notes:
- In
package.json
this package is usingtypesVersions
for types instead ofexports
, since for it to work,moduleResolution
must beNode16
in consuming package. - Module resolution of TSDoc's
extends
withintsdoc.json
does not seem to pick upexports
ofpackage.json
, so configuration should be extended with "absolute" file path relative to the module:"extends": ["@cpuabuse/eslint-config/dist/release/tsdoc/tsdoc.json"]
.
Top level configs go into src
folder, while anything else must reside inside src/lib
(.gitignore
ignores /lib
folder for release).
npm run build
Config files are put into the package root, so that ESLint can consume additional configs, as it resolves their path relative to root, not the entrypoint.
npm run test
Validates exported config structure with Mocha.