@activescott/eslint-config
v3.0.1
Published
An ESLint sharable config for TypeScript.
Downloads
352
Readme
@activescott/eslint-config
This is @activescott's sharable config for ESLint. The default is optimized for TypeScript. It does prettify other files too including JavaScript, Markdown, etc.
Multiple config may be added to this package in the future as described at https://eslint.org/docs/developer-guide/shareable-configs#sharing-multiple-configs
Usage
Step 1: Add the following dependencies to your project:
npm add -D @activescott/eslint-config@3 typescript-eslint@8 eslint-plugin-prettier@5 eslint-plugin-jest@28 @stylistic/eslint-plugin@2 eslint-config-prettier@9 eslint-plugin-unicorn@56Step 2: Enter the following to create a eslint.config.js, .prettierrc, and .prettierignore in the root with the right content:
printf 'import config from "@activescott/eslint-config"
// Global ignores - must be in a separate config object with ONLY the ignores property
const globalIgnores = {
ignores: [
"**/node_modules/**",
"**/dist/**",
"**/.react-router/**",
"**/test-data/**",
],
}
const overrides = {
rules: {
},
}
export default [globalIgnores, ...config, overrides]
' > eslint.config.js
printf "semi: false\n" > .prettierrc
printf '.prettierignore
node_modules/
/dist/
/.next/
.nyc_output/
coverage/
.react-router/
'Step 3 (optional): Add the following scripts to package.json:
{
"scripts": {
"lint": "eslint",
"lint-fix": "eslint --fix"
}
}See https://eslint.org/docs/user-guide/configuring for more information.
Notes
React
When using React add plugin:react/recommended from package eslint-plugin-react:
extends:
- ...
- "plugin:react/recommended"Local Testing
You can also test your shareable config on your computer before publishing by linking your module globally. Type:
npm linkThen, in your project that wants to use your shareable config, type:
npm link @activescott/eslint-configRelease Process (Deploying to NPM) 🚀
We use semantic-release to consistently release semver-compatible versions. This project deploys to multiple npm distribution tags. Each of the below branches correspond to the following npm distribution tags:
| branch | npm distribution tag | | ------ | -------------------- | | master | latest | | beta | beta |
To trigger a release use a Conventional Commit following Angular Commit Message Conventions on one of the above branches.
Notes to self
References:
- https://eslint.org/docs/latest/use/configure/configuration-files
- https://eslint.org/docs/latest/use/configure/parser#configure-a-custom-parser
- https://typescript-eslint.io/getting-started
- https://prettier.io/docs/en/integrating-with-linters.html
- https://github.com/prettier/eslint-plugin-prettier
- https://eslint.org/docs/latest/extend/shareable-configs
Todo
- https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unused-modules.md
