-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use mediawiki linter instead of my custom definitions
- Loading branch information
1 parent
841790b
commit 03cbcb7
Showing
2 changed files
with
108 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,20 @@ | ||
{ | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:sonarjs/recommended", | ||
"plugin:jsdoc/recommended" | ||
"wikimedia/client/es6", | ||
"wikimedia/jquery", | ||
"wikimedia/mediawiki" | ||
], | ||
"root": true, | ||
"env": { | ||
"browser": true, | ||
"jquery": true, | ||
"es2022": true | ||
}, | ||
"globals": { | ||
"mw": "readonly", | ||
"Map": "readonly" | ||
"mw": "readonly" | ||
}, | ||
"ignorePatterns": ["scripts/", "tests/", "lib/"], | ||
"plugins": [ | ||
"lodash", | ||
"sonarjs", | ||
"unicorn", | ||
"jsdoc" | ||
], | ||
"rules": { | ||
"unicorn/no-abusive-eslint-disable": "error", | ||
"no-constant-condition": 0, | ||
"no-console": "warn", | ||
"no-unreachable-loop": "error", | ||
"block-scoped-var": "error", | ||
"curly": ["error"], | ||
"lodash/prefer-includes": "error", | ||
"lodash/prefer-startswith": "error", | ||
"no-caller": "error", | ||
"no-implicit-coercion": ["error", { "boolean": false }], | ||
"no-lone-blocks": "error", | ||
"no-multi-spaces": ["error", { "ignoreEOLComments": true }], | ||
"yoda": "error", | ||
"block-spacing": "error", | ||
"brace-style": ["error", "1tbs"], | ||
"comma-spacing": ["error", { "before": false, "after": true }], | ||
"func-call-spacing": ["error", "never"], | ||
"indent": ["error", "tab", { | ||
"outerIIFEBody": 0, | ||
"SwitchCase": 1, | ||
"ignoreComments": true | ||
}], | ||
"key-spacing": ["error", {"singleLine": {"beforeColon": false, "afterColon": true}}], | ||
"keyword-spacing": ["error", { "after": true, "before": true}], | ||
"no-array-constructor": "error", | ||
"no-bitwise": "error", | ||
"no-mixed-operators": "error", | ||
"no-nested-ternary": "error", | ||
"no-new-object": "error", | ||
"no-unneeded-ternary": "error", | ||
"no-useless-escape": 0, | ||
"no-whitespace-before-property": "error", | ||
"semi": ["error", "always"], | ||
"space-before-blocks": "error", | ||
"switch-colon-spacing": "error", | ||
"no-restricted-syntax": [ | ||
"error", | ||
{ | ||
"message": "Using .done() is not allowed. See https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript#Asynchronous_code", | ||
"selector": "MemberExpression > Identifier[name=\"done\"]" | ||
}, | ||
{ | ||
"message": "Using .fail() is not allowed. See https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript#Asynchronous_code", | ||
"selector": "MemberExpression > Identifier[name=\"fail\"]" | ||
} | ||
], | ||
"no-trailing-spaces": "error", | ||
"space-infix-ops": "error", | ||
"no-multiple-empty-lines": ["error", {"max": 1}], | ||
"no-script-url": "error", | ||
"jsdoc/require-jsdoc": 0, | ||
"jsdoc/require-param-description": 0, | ||
"jsdoc/require-returns": 0, | ||
"jsdoc/require-param": 0, | ||
"jsdoc/require-returns-description": 0, | ||
"sonarjs/prefer-single-boolean-return": 0, | ||
"sonarjs/prefer-immediate-return": 0 | ||
"parserOptions": { | ||
"ecmaVersion": "latest" | ||
}, | ||
"reportUnusedDisableDirectives": true, | ||
"overrides": [ | ||
{ | ||
"files": [ | ||
"popups.js" | ||
], | ||
"parserOptions": { | ||
"ecmaVersion": 5 | ||
} | ||
} | ||
] | ||
} | ||
"rules": { | ||
"es-x/no-class-fields": 0, | ||
"max-len": 0, | ||
"es-x/no-async-functions": 0, | ||
"es-x/no-array-prototype-includes": 0, | ||
"no-jquery/variable-pattern": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:sonarjs/recommended", | ||
"plugin:jsdoc/recommended" | ||
], | ||
"root": true, | ||
"env": { | ||
"browser": true, | ||
"jquery": true, | ||
"es2022": true | ||
}, | ||
"globals": { | ||
"mw": "readonly", | ||
"Map": "readonly" | ||
}, | ||
"ignorePatterns": ["scripts/", "tests/", "lib/"], | ||
"plugins": [ | ||
"lodash", | ||
"sonarjs", | ||
"unicorn", | ||
"jsdoc" | ||
], | ||
"rules": { | ||
"unicorn/no-abusive-eslint-disable": "error", | ||
"no-constant-condition": 0, | ||
"no-console": "warn", | ||
"no-unreachable-loop": "error", | ||
"block-scoped-var": "error", | ||
"curly": ["error"], | ||
"lodash/prefer-includes": "error", | ||
"lodash/prefer-startswith": "error", | ||
"no-caller": "error", | ||
"no-implicit-coercion": ["error", { "boolean": false }], | ||
"no-lone-blocks": "error", | ||
"no-multi-spaces": ["error", { "ignoreEOLComments": true }], | ||
"yoda": "error", | ||
"block-spacing": "error", | ||
"brace-style": ["error", "1tbs"], | ||
"comma-spacing": ["error", { "before": false, "after": true }], | ||
"func-call-spacing": ["error", "never"], | ||
"indent": ["error", "tab", { | ||
"outerIIFEBody": 0, | ||
"SwitchCase": 1, | ||
"ignoreComments": true | ||
}], | ||
"key-spacing": ["error", {"singleLine": {"beforeColon": false, "afterColon": true}}], | ||
"keyword-spacing": ["error", { "after": true, "before": true}], | ||
"no-array-constructor": "error", | ||
"no-bitwise": "error", | ||
"no-mixed-operators": "error", | ||
"no-nested-ternary": "error", | ||
"no-new-object": "error", | ||
"no-unneeded-ternary": "error", | ||
"no-useless-escape": 0, | ||
"no-whitespace-before-property": "error", | ||
"semi": ["error", "always"], | ||
"space-before-blocks": "error", | ||
"switch-colon-spacing": "error", | ||
"no-restricted-syntax": [ | ||
"error", | ||
{ | ||
"message": "Using .done() is not allowed. See https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript#Asynchronous_code", | ||
"selector": "MemberExpression > Identifier[name=\"done\"]" | ||
}, | ||
{ | ||
"message": "Using .fail() is not allowed. See https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript#Asynchronous_code", | ||
"selector": "MemberExpression > Identifier[name=\"fail\"]" | ||
} | ||
], | ||
"no-trailing-spaces": "error", | ||
"space-infix-ops": "error", | ||
"no-multiple-empty-lines": ["error", {"max": 1}], | ||
"no-script-url": "error", | ||
"jsdoc/require-jsdoc": 0, | ||
"jsdoc/require-param-description": 0, | ||
"jsdoc/require-returns": 0, | ||
"jsdoc/require-param": 0, | ||
"jsdoc/require-returns-description": 0, | ||
"sonarjs/prefer-single-boolean-return": 0, | ||
"sonarjs/prefer-immediate-return": 0 | ||
}, | ||
"reportUnusedDisableDirectives": true, | ||
"overrides": [ | ||
{ | ||
"files": [ | ||
"popups.js" | ||
], | ||
"parserOptions": { | ||
"ecmaVersion": 5 | ||
} | ||
} | ||
] | ||
} |