@cpuabuse/eslint-config v0.0.52
eslint-config
About
Strict ESLint config for cpuabuse.
Feel free to reuse any bits.
Usage
Installation
npm install --save-dev @cpuabuse/eslint-configPeer dependencies must also be installed.
Configuration
Create a file in the root of the project named .eslintrc.yml to extend default config, containing the following:
extends: "@cpuabuse"Additional configs
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.
typescript
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.
vue
Rules for Vue, .eslintrc.yml should contain the following:
extends: "@cpuabuse/eslint-config/vue"vue-tsx
Rules for Vue TSX, .eslintrc.yml should contain the following:
extends: "@cpuabuse/eslint-config/vue-tsx"TSDoc
This package provides tsdoc.json to extend via tsdoc entry point.
Notes:
- In
package.jsonthis package is usingtypesVersionsfor types instead ofexports, since for it to work,moduleResolutionmust beNode16in consuming package. - Module resolution of TSDoc's
extendswithintsdoc.jsondoes not seem to pick upexportsofpackage.json, so configuration should be extended with "absolute" file path relative to the module:"extends": ["@cpuabuse/eslint-config/dist/release/tsdoc/tsdoc.json"].
Development
Top level configs go into src folder, while anything else must reside inside src/lib (.gitignore ignores /lib folder for release).
Build types
release
npm run buildConfig 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.
test
npm run testValidates exported config structure with Mocha.
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago