dance/.eslintrc.js

96 lines
2.9 KiB
JavaScript
Raw Permalink Normal View History

2020-10-13 15:35:08 +03:00
/** @type import("eslint").Linter.Config */
module.exports = {
root: true,
2020-10-13 15:35:08 +03:00
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
extends: ["eslint:recommended", "plugin:@typescript-eslint/eslint-recommended"],
parserOptions: {
ecmaVersion: 2019,
2020-10-13 15:35:08 +03:00
sourceType: "module",
},
ignorePatterns: ["out/", "*.js"],
2020-10-13 15:35:08 +03:00
overrides: [
{
files: ["commands/index.ts"],
rules: {
"max-len": "off",
},
},
2021-05-04 23:09:29 +03:00
{
files: ["test/suite/commands/*.ts"],
rules: {
"no-useless-escape": "off",
},
},
{
files: ["test/suite/commands/*-tabs.test.ts"],
rules: {
"no-tabs": "off",
},
},
2020-10-13 15:35:08 +03:00
],
rules: {
2021-03-19 22:01:01 +03:00
"indent": ["error", 2, {
2021-03-19 22:32:23 +03:00
"CallExpression": { arguments: "first" },
"FunctionDeclaration": { parameters: "first" },
"FunctionExpression": { parameters: "first" },
2021-03-19 22:01:01 +03:00
"VariableDeclarator": "first",
"flatTernaryExpressions": true,
"offsetTernaryExpressions": true,
2022-03-03 02:31:07 +03:00
"ignoredNodes": [
"TemplateLiteral *",
"VariableDeclaration VariableDeclarator:first-child ObjectExpression",
],
2021-03-19 22:01:01 +03:00
}],
2020-10-13 15:35:08 +03:00
"curly": ["error", "all"],
"dot-location": ["error", "property"],
"eqeqeq": ["error", "always", { null: "ignore" }],
"require-await": "error",
"array-bracket-spacing": ["error", "never"],
"block-scoped-var": "error",
"block-spacing": ["error", "always"],
"brace-style": ["error", "1tbs", { allowSingleLine: false }],
"comma-dangle": ["error", "always-multiline"],
"linebreak-style": ["error", "unix"],
"max-len": [
"warn",
{
2021-03-19 22:01:01 +03:00
code: 100,
comments: 80,
2021-05-04 23:09:29 +03:00
ignorePattern: "^ *(\\*|//) ([sS]ee )?http\\S+\\)?.?$|^ *// =+( [^=]+ =+)?$|\|$",
2020-10-13 15:35:08 +03:00
},
],
2021-03-19 22:01:01 +03:00
"multiline-ternary": ["error", "always-multiline"],
2020-10-13 15:35:08 +03:00
"no-tabs": "error",
"no-trailing-spaces": "error",
"no-unexpected-multiline": "error",
"no-unneeded-ternary": "error",
"object-curly-spacing": ["error", "always"],
2021-05-04 23:09:29 +03:00
"operator-linebreak": ["error", "before", { overrides: { "=": "after" } }],
2020-10-13 15:35:08 +03:00
"object-shorthand": "error",
"quotes": ["error", "double", { avoidEscape: true, allowTemplateLiterals: true }],
"semi": ["error", "always"],
"sort-imports": [
"error",
{
2021-05-04 23:09:29 +03:00
ignoreCase: true,
2020-10-13 15:35:08 +03:00
ignoreDeclarationSort: true,
memberSyntaxSortOrder: ["none", "all", "single", "multiple"],
},
],
2021-05-04 23:09:29 +03:00
"space-before-function-paren": "off",
2020-10-13 15:35:08 +03:00
"space-before-blocks": "error",
"space-infix-ops": "error",
"unicode-bom": "error",
"keyword-spacing": ["error", { before: true, after: true }],
"no-unused-vars": "off",
"no-case-declarations": "off",
"no-cond-assign": "off",
"@typescript-eslint/explicit-member-accessibility": ["error"],
2021-05-04 23:09:29 +03:00
"@typescript-eslint/space-before-function-paren": [
"error",
{ anonymous: "always", named: "never", asyncArrow: "always" },
],
},
2020-10-13 15:35:08 +03:00
};