-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.base.cjs
42 lines (40 loc) · 1.19 KB
/
.eslintrc.base.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/** @type {import('eslint').Linter.Config} */
const config = {
root: true,
env: {
es2022: true,
},
parser: "@babel/eslint-parser",
parserOptions: {
requireConfigFile: false,
babelOptions: {
babelrc: false,
configFile: false,
presets: ["@babel/preset-env"],
},
},
extends: ["eslint:recommended", "airbnb-base", "plugin:prettier/recommended"],
plugins: ["import"],
rules: {
// eslint core
// Allow console.log in development
"no-console": "off",
// Explicitly allow unused variables starting with _ (e.g. _req, _res) to
// indicate that they are unused on purpose
"no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
"func-names": "off",
// Allow reassigning props in react
"no-param-reassign": ["error", { props: false }],
// Use function hoisting to improve code readability
"no-use-before-define": "off",
// This is a personal preference doesn't affect code readability or performance
"no-underscore-dangle": "off",
// import rules
"import/no-extraneous-dependencies": "off",
"import/prefer-default-export": "off",
},
};
module.exports = config;