@zappar/eslint-config-zappar
Getting Started
Install eslint
and this config package:
npm i --save-dev eslint @zappar/eslint-config-zappar
After installation, create a .eslintrc.js
in the root of your project with the following config:
// eslintrc.js:
require("@rushstack/eslint-patch/modern-module-resolution");
module.exports = {
extends: ["@zappar/eslint-config-zappar"],
parserOptions: { tsconfigRootDir: __dirname },
};
Rules
Base
{
"tsdoc/syntax": 2,
"@typescript-eslint/explicit-member-accessibility": 1,
"no-console": [0],
"eol-last": 0,
"no-use-before-define": [0],
"@typescript-eslint/no-use-before-define": [1],
"no-shadow": [0],
"no-multi-assign": [0],
"import/extensions": [0],
"import/prefer-default-export": [0],
"max-classes-per-file": [0],
"no-unused-vars": [0],
"no-unused-expressions": [0],
"import/no-extraneous-dependencies": [0],
"max-len": [
"error",
{
code: 155,
},
],
}
React
{
"react/jsx-props-no-spreading": 0,
"react/prop-types": 0,
}
Other
extends: ["airbnb-base", "plugin:prettier/recommended"],
env: {
browser: true,
commonjs: true,
es2021: true,
node: true,
jest: true,
},
globals: {
page: true,
browser: true,
context: true,
jestPuppeteer: true,
},
parserOptions: {
ecmaVersion: 12,
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
},
plugins: ["@typescript-eslint", "eslint-plugin-tsdoc"],
rules: {
...base,
...react,
},
settings: {
react: {
version: "detect",
},
settings: {
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx", ".d.ts"],
},
},
},
},