2017-04-20 10:05:28 +08:00
|
|
|
module.exports = {
|
2018-03-16 18:07:39 +08:00
|
|
|
root: true,
|
2019-07-10 04:15:14 +08:00
|
|
|
plugins: ["prettier", "node", "jest", "jsdoc"],
|
2018-08-24 22:57:16 +08:00
|
|
|
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: {
|
2018-12-19 01:29:12 +08:00
|
|
|
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",
|
2018-08-24 22:57:16 +08:00
|
|
|
yoda: "error",
|
|
|
|
eqeqeq: "error",
|
2016-12-30 00:10:41 +08:00
|
|
|
"eol-last": "error",
|
|
|
|
"no-extra-bind": "warn",
|
|
|
|
"no-process-exit": "warn",
|
|
|
|
"no-use-before-define": "off",
|
2018-12-19 01:29:12 +08:00
|
|
|
"no-unused-vars": ["error", { args: "none", ignoreRestSiblings: true }],
|
2021-08-04 21:55:58 +08:00
|
|
|
"no-loop-func": "off",
|
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",
|
2019-07-17 00:25:45 +08:00
|
|
|
"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"],
|
2019-07-17 00:25:45 +08:00
|
|
|
"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",
|
2019-07-17 00:25:45 +08:00
|
|
|
"jsdoc/require-returns-description": "error",
|
|
|
|
"jsdoc/require-returns-type": "error",
|
2020-03-31 00:02:44 +08:00
|
|
|
"jsdoc/require-returns": "error",
|
|
|
|
// Disallow @ts-ignore directive. Use @ts-expect-error instead
|
2020-05-28 02:34:55 +08:00
|
|
|
"no-warning-comments": [
|
|
|
|
"error",
|
|
|
|
{ terms: ["@ts-ignore"], location: "start" }
|
|
|
|
]
|
2019-07-10 05:38:18 +08:00
|
|
|
},
|
|
|
|
settings: {
|
|
|
|
jsdoc: {
|
2020-03-03 20:37:18 +08:00
|
|
|
mode: "typescript",
|
2019-07-10 05:38:18 +08:00
|
|
|
// 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] = {
|
2022-08-19 16:24:38 +08:00
|
|
|
message: `@${tag} currently not supported in TypeScript`
|
2019-08-06 14:55:00 +08:00
|
|
|
};
|
|
|
|
return acc;
|
|
|
|
},
|
|
|
|
{}
|
|
|
|
),
|
2019-07-15 22:19:51 +08:00
|
|
|
extends: "extends",
|
2019-07-17 00:25:45 +08:00
|
|
|
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"
|
2019-07-17 00:25:45 +08:00
|
|
|
},
|
|
|
|
overrideReplacesDocs: false
|
2019-07-10 05:38:18 +08:00
|
|
|
}
|
2018-03-16 18:07:39 +08:00
|
|
|
},
|
|
|
|
overrides: [
|
2023-04-28 20:49:05 +08:00
|
|
|
{
|
|
|
|
// Allow to use `dynamic` import
|
|
|
|
files: ["bin/**/*.js"],
|
|
|
|
parserOptions: {
|
|
|
|
ecmaVersion: 2020
|
|
|
|
}
|
|
|
|
},
|
2018-03-16 18:07:39 +08:00
|
|
|
{
|
2019-06-22 22:26:35 +08:00
|
|
|
files: ["lib/**/*.runtime.js", "hot/*.js"],
|
2018-03-16 18:07:39 +08:00
|
|
|
env: {
|
2018-04-02 20:42:22 +08:00
|
|
|
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
|
|
|
},
|
2023-04-08 09:01:26 +08:00
|
|
|
{
|
|
|
|
files: ["tooling/**/*.js"],
|
|
|
|
env: { es6: true },
|
|
|
|
parserOptions: {
|
|
|
|
ecmaVersion: 2020
|
|
|
|
}
|
|
|
|
},
|
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: {
|
2020-11-26 18:13:17 +08:00
|
|
|
nsObj: false,
|
|
|
|
jasmine: 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
|
|
|
};
|