eslint-config-oy
Shared ESLint config for my projects.
(Lints both JavaScript & TypeScript projects.)
Installation
$ npm install --save-dev eslint-config-oy
Usage
.eslintrc.json
in TypeScript project:
{
"extends": [
"eslint-config-oy/ts"
]
}
.eslintrc.json
in JavaScript project:
{
"extends": [
"eslint-config-oy"
]
}
Evironment Set Up
Contributing
-
index.js
is eslint config for JavaScript projects.
-
ts.js
is eslint config for TypeScript projects; and extends from index.js
.
-
If @typescript-eslint
has an override rule of an eslint rule; first make sure you turn off the eslint rule in ts.js
.
{
quotes: "off",
'@typescript-eslint/quotes': [
'error',
'single',
{
avoidEscape: true,
allowTemplateLiterals: true
}
],
}
-
If a rule works the same way for both JavaScript and TypeScript, add the rule's value (configuration) in _common.js
and reference in both index.js
and ts.js
.
{
QUOTES: [
'error',
'single',
{
avoidEscape: true,
allowTemplateLiterals: true
}
],
}
{
quotes: common.QUOTES,
}
{
quotes: 'off',
'@typescript-eslint/quotes': common.QUOTES,
}
Related projects