101 lines
2.8 KiB
JavaScript
101 lines
2.8 KiB
JavaScript
const path = require('path');
|
|
|
|
module.exports = {
|
|
root: true,
|
|
env: {
|
|
browser: true,
|
|
es6: true,
|
|
node: true,
|
|
mocha: true
|
|
},
|
|
globals: {
|
|
BigInt: true,
|
|
},
|
|
parser: "@typescript-eslint/parser",
|
|
parserOptions: {
|
|
ecmaVersion: "latest",
|
|
project: "./tsconfig.json",
|
|
sourceType: "module",
|
|
},
|
|
plugins: [
|
|
"@typescript-eslint",
|
|
"eslint-plugin-import",
|
|
"prettier",
|
|
"@chainsafe/eslint-plugin-node"
|
|
],
|
|
extends: [
|
|
"eslint:recommended",
|
|
"plugin:import/errors",
|
|
"plugin:import/warnings",
|
|
"plugin:import/typescript",
|
|
"plugin:@typescript-eslint/recommended"
|
|
],
|
|
settings: {},
|
|
rules: {
|
|
"prettier/prettier": "error",
|
|
//doesnt work, it reports false errors
|
|
"constructor-super": "off",
|
|
//"@typescript-eslint/class-name-casing": "error",
|
|
"@typescript-eslint/explicit-function-return-type": ["error", {
|
|
"allowExpressions": true
|
|
}],
|
|
"@typescript-eslint/func-call-spacing": "error",
|
|
"@typescript-eslint/indent": ["error", 2],
|
|
//"@typescript-eslint/interface-name-prefix": ["error", "always"],
|
|
"@typescript-eslint/member-ordering": "error",
|
|
"@typescript-eslint/no-explicit-any": "error",
|
|
"@typescript-eslint/no-require-imports": "error",
|
|
"@typescript-eslint/no-unused-vars": ["error", {
|
|
"varsIgnorePattern": "^_",
|
|
"argsIgnorePattern": "^_",
|
|
}],
|
|
"@typescript-eslint/ban-ts-comment": "warn",
|
|
"@typescript-eslint/no-use-before-define": "off",
|
|
"@typescript-eslint/semi": "error",
|
|
"@typescript-eslint/type-annotation-spacing": "error",
|
|
//it doesn't recognize module/lib/something (like mainnet & minimal presets)
|
|
"import/no-duplicates": "off",
|
|
"import/no-extraneous-dependencies": ["error", {
|
|
"devDependencies": false,
|
|
"optionalDependencies": false,
|
|
"peerDependencies": true
|
|
}],
|
|
"func-call-spacing": "off",
|
|
"max-len": ["error", {
|
|
"code": 120
|
|
}],
|
|
//if --fix is run it messes imports like /lib/presets/minimal & /lib/presets/mainnet
|
|
"import/no-duplicates": "off",
|
|
"new-parens": "error",
|
|
"no-caller": "error",
|
|
"no-bitwise": "off",
|
|
"no-cond-assign": "error",
|
|
"no-consecutive-blank-lines": 0,
|
|
"no-console": "warn",
|
|
"no-var": "error",
|
|
"object-curly-spacing": ["error", "never"],
|
|
"object-literal-sort-keys": 0,
|
|
"no-prototype-builtins": 0,
|
|
"prefer-const": "error",
|
|
"quotes": ["error", "double"],
|
|
"semi": "off",
|
|
"@chainsafe/node/file-extension-in-import": [
|
|
"error",
|
|
"always",
|
|
{
|
|
"esm": true
|
|
}
|
|
],
|
|
"import/no-unresolved": "off",
|
|
},
|
|
"overrides": [
|
|
{
|
|
"files": ["**/test/**/*.ts"],
|
|
"rules": {
|
|
"import/no-extraneous-dependencies": "off",
|
|
"@typescript-eslint/no-explicit-any": "off"
|
|
}
|
|
}
|
|
]
|
|
};
|