webpack/.eslintrc.js

104 lines
2.5 KiB
JavaScript
Raw Normal View History

module.exports = {
2018-03-16 18:07:39 +08:00
root: true,
plugins: ["prettier", "node", "jest", "jsdoc"],
extends: [
"eslint:recommended",
"plugin:node/recommended",
"plugin:prettier/recommended"
],
2018-03-16 18:07:39 +08:00
env: {
node: true,
2018-04-12 05:30:28 +08:00
es6: true
2015-04-24 05:55:50 +08:00
},
2018-03-16 18:07:39 +08:00
parserOptions: {
ecmaVersion: 2018
2018-03-16 18:07:39 +08:00
},
rules: {
2017-11-15 20:52:01 +08:00
"prettier/prettier": "error",
2017-01-11 17:51:58 +08:00
"no-template-curly-in-string": "error",
"no-caller": "error",
2018-03-26 22:56:10 +08:00
"no-control-regex": "off",
yoda: "error",
eqeqeq: "error",
"eol-last": "error",
"no-extra-bind": "warn",
"no-process-exit": "warn",
"no-use-before-define": "off",
"no-unused-vars": ["error", { args: "none", ignoreRestSiblings: true }],
"no-loop-func": "warn",
2018-03-16 18:07:39 +08:00
"node/no-missing-require": ["error", { allowModules: ["webpack"] }],
2020-03-03 20:37:18 +08:00
"jsdoc/check-indentation": "error",
"jsdoc/check-param-names": "error",
2020-03-03 20:37:18 +08:00
"jsdoc/check-property-names": "error",
"jsdoc/check-tag-names": "error",
"jsdoc/require-hyphen-before-param-description": ["error", "never"],
"jsdoc/require-param-description": "error",
"jsdoc/require-param-name": "error",
"jsdoc/require-param-type": "error",
"jsdoc/require-param": "error",
2020-03-03 20:37:18 +08:00
"jsdoc/require-property": "error",
"jsdoc/require-property-name": "error",
"jsdoc/require-property-type": "error",
"jsdoc/require-returns-description": "error",
"jsdoc/require-returns-type": "error",
"jsdoc/require-returns": "error",
// Disallow @ts-ignore directive. Use @ts-expect-error instead
"no-warning-comments": [
"error",
{ terms: ["@ts-ignore"], location: "start" }
]
},
settings: {
jsdoc: {
2020-03-03 20:37:18 +08:00
mode: "typescript",
// supported tags https://github.com/microsoft/TypeScript-wiki/blob/master/JSDoc-support-in-JavaScript.md
tagNamePreference: {
2019-08-06 14:55:00 +08:00
...["implements", "const", "memberof", "readonly", "yields"].reduce(
(acc, tag) => {
acc[tag] = {
message: `@${tag} currently not supported in Typescript`
};
return acc;
},
{}
),
2019-07-15 22:19:51 +08:00
extends: "extends",
return: "returns",
constructor: "constructor",
prop: "property",
arg: "param",
augments: "extends",
description: false,
desc: false,
inheritdoc: false,
2019-08-06 14:55:00 +08:00
class: "constructor"
},
overrideReplacesDocs: false
}
2018-03-16 18:07:39 +08:00
},
overrides: [
{
files: ["lib/**/*.runtime.js", "hot/*.js"],
2018-03-16 18:07:39 +08:00
env: {
es6: false,
browser: true
2018-03-16 18:07:39 +08:00
},
globals: {
2018-07-10 18:18:34 +08:00
Promise: false
2018-03-16 18:07:39 +08:00
},
parserOptions: {
ecmaVersion: 5
}
2018-04-02 19:24:58 +08:00
},
{
files: ["test/**/*.js"],
env: {
2018-04-12 05:30:28 +08:00
"jest/globals": true
2018-07-10 18:18:34 +08:00
},
globals: {
nsObj: false
2018-04-12 05:30:28 +08:00
}
2018-03-16 18:07:39 +08:00
}
]
2017-04-20 14:53:44 +08:00
};