@alexzimakov/eslint-config
v2.3.0
Published
ESLint config for my projects.
Downloads
35
Readme
eslint-config-alexzimakov
ESLint rules for my JavaScript projects.
Install
npm install @alexzimakov/eslint-config --save-dev
Add this to your .eslintrc
file:
{
"extends": ["@alexzimakov/eslint-config"]
}
Config example
JavaScript project:
// .eslintrc.cjs
module.exports = {
root: true,
env: {
browser: true,
node: true,
es2022: true,
},
extends: ["@alexzimakov/eslint-config"],
};
TypeScript project:
// .eslintrc.cjs
module.exports = {
root: true,
env: {
browser: true,
node: true,
es2022: true,
},
extends: ["@alexzimakov/eslint-config"],
overrides: [
{
files: ["*.ts"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "tsconfig.json",
sourceType: "module",
},
},
],
};
TypeScript & React project:
// .eslintrc.cjs
module.exports = {
root: true,
env: {
browser: true,
node: true,
es2022: true,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
settings: {
react: {
version: "detect",
},
},
extends: ["@alexzimakov/eslint-config", "@alexzimakov/eslint-config/react"],
overrides: [
{
files: ["*.ts", "*.tsx"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "tsconfig.json",
sourceType: "module",
},
},
],
};