@its-tailtime/eslint-config
v1.0.3
Published
ESLint shareable configs
Readme
eslint-config
ESLint shareable configs. The default ESLint config is for Vue + TS projects - but if required, others can be added to this repository and accessed as @its-tailtime/eslint-config/some-other-config post-install.
Shareable configs are designed to work with the extends feature of eslint.config.js files. You can learn more about Shareable Configs on the official ESLint website.
Installation
Run the following command (this will also install dependencies):
pnpm add --save-dev @its-tailtime/eslint-configThen, create a eslint.config.js file at the root of your repository containing the following:
// @ts-check
import defaultConfig from '@its-tailtime/eslint-config';
export default [
...defaultConfig,
{
name: "Per-project customisations - Global ignores - do not add anything else to this object or else these won't be treated as such",
ignores: []
}
];(for repositories where the "type": "module" is not set in package.json, you'll need to use the extension .mjs)
You can override settings from the shareable config by adding them directly into your eslint.config.js file.
To ensure that all relevant rules are run, ensure that your lint script in your package.json file resembles:
"lint": "eslint --no-fix --max-warnings 0",
"lint:fix": "eslint --fix --max-warnings 0",We used to use --cache, but the cache is too naïve to support our usage with eslint rules operating on Typescript. E.g. if a type is changed in a file it can affect many others and the cache will prevent the linter running on the affected files.
For VS Code users, after installing the relevant extensions - ensure that you have the following in your settings.json file so that any fixable eslint errors are fixed on save:
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},