0.0.4 • Published 5 years ago
eslint-config-w1spamulet v0.0.4
ESlint and Prettier Config with @typescript-eslint/parser
from @w1spamulet
Install
DO NOT install it globally since we are using ESlint v6
Check this ESlint - migrating to 6.0
Make sure you have
package.json
file in your directory, or create a new onenpm init
Install this package and its peer dependencies
npx install-peerdeps --dev eslint-config-w1spamulet
Create a
.eslintrc.js
file at the same folder aspackage.json
module.exports = { extends: ['w1spamulet'], };
Options
Add script to your
package.json
so your can manually lint via command"scripts": { "lint": "eslint .", "lint:fix": "eslint --fix" },
Settings
Override the default rules like this
module.exports = {
extends: ['w1spamulet'],
rules: {
// your rules
'no-console': 1,
},
// sometimes you need to override rules according to file type, for example:
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
'no-unused-vars': 0, // you don't want to see two rules saying the same thing
'react/prop-types': 0, // you can use interface or type in .tsx
},
},
{
files: ['*.js', '*.jsx'],
rules: {
'@typescript-eslint/no-unused-vars': 0,
},
},
],
};
0.0.4
5 years ago