@phts/eslint-config
v2.1.1
Published
My config for ESLint.
Downloads
73
Readme
@phts/eslint-config
My config for ESLint.
Install
$ npm i -D @phts/eslint-config
Usage
Basic rules
.eslintrc.json
:
{
"extends": "@phts"
}
Prettier
{
"extends": ["@phts", "@phts/eslint-config/addons/prettier"]
}
Enable support for Prettier via eslint-config-prettier and eslint-plugin-prettier for all .js
, .jsx
, .ts
, .tsx
files in the project.
Prettier must be installed manually:
$ npm i -D prettier
Make sure to put this addon last, so it gets the chance to override other configs.
TypeScript
@typescript-eslint/parser and @typescript-eslint/eslint-plugin are used under the hood.
.eslintrc.json
:
{
"extends": ["@phts", "@phts/eslint-config/addons/typescript"]
}
package.json
:
{
"scripts": {
"lint": "eslint --ext .js,.ts,.tsx ."
}
}
SublimeText project:
{
"folders": [
{
"path": "."
}
],
"settings": {
"SublimeLinter.linters.eslint.selector": "source.js, source.ts, source.tsx",
"SublimeLinter.linters.tslint.disable": true
}
}
VS Code workspace:
{
"settings": {
// ...
"eslint.validate": ["typescript", "typescriptreact"]
}
}