eslint-config-collaborne
v5.4.10
Published
ES lint configuration for Collaborne projects
Downloads
3,666
Keywords
Readme
eslint-config-collaborne
ES lint configuration for Collaborne projects
Usage
Install dependencies
npm install --save-dev \ eslint-config-collaborne \ eslint@7 \ eslint-plugin-disable@2 \ eslint-plugin-import@2 \ eslint-plugin-node@11 \ eslint-plugin-prettier@3 \ eslint-plugin-promise@4 \ prettier@2
Add
.prettierrc
(configuration for prettier){ "singleQuote": true, "jsxSingleQuote": false, "semi": true, "tabWidth": 2, "useTabs": true, "bracketSpacing": true, "jsxBracketSameLine": false, "arrowParens": "avoid", "trailingComma": "all" }
Add
.eslintignore
node_modules
Add
.eslintrc.json
{ "extends": "collaborne" }
Add linting scripts in
package.json
{ // ... "scripts": { // ... "lint": "npm run lint:ts", "lint:ts": "eslint --report-unused-disable-directives $(node -p 'require("./tsconfig.json").include.map(include => `'\${include}.\{js,ts,tsx\}'`).join(" ")')" // ... } // ... }
Note: This requires that
tsconfig.json
contains ainclude
property, which should only directories, and in the formatdir/**/*
.
Additional configuration
- Always use
overrides
to configure additional rules - Try to document the reason for a override configuration in the commit message for traceability, and consider reporting the rule here as a future addition with the rationale