-
-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy patheslint.config.js
More file actions
61 lines (54 loc) · 2.29 KB
/
Copy patheslint.config.js
File metadata and controls
61 lines (54 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/** @see https://github.com/un-ts/eslint-plugin-import-x#readme */ import { importX } from 'eslint-plugin-import-x';
/** @see https://github.com/gajus/eslint-plugin-jsdoc#readme */ import { jsdoc } from 'eslint-plugin-jsdoc';
/** @see https://github.com/neostandard/neostandard#readme */ import neostandard from 'neostandard';
export default [
/**
* Semistandard style guide.
*
* Includes the following plugins and makes them available for use:
* - `@stylistic`
* - `n`
* - `promise`
* - `react`
* - `typescript-eslint`
*/
...neostandard({
env: ['browser', 'jquery', 'webextensions'],
ignores: ['src/lib/**'],
semi: true,
}),
/**
* Enforce consistent use of trailing commas in object and array literals.
* @see https://eslint.style/rules/comma-dangle
*/
{ rules: { '@stylistic/comma-dangle': ['warn', 'always-multiline'] } },
/**
* Enable plugin `import-x` and use its recommended config.
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/master/src/config/flat/recommended.ts
*/
importX.configs['flat/recommended'],
/**
* Prevent cyclical imports; enforce alphabetical imports.
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-cycle.md
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/order.md
*/
{
rules: {
'import-x/no-cycle': 'error',
'import-x/order': ['warn', { alphabetize: { order: 'asc', caseInsensitive: true } }],
},
},
/** Enable plugin `jsdoc` and use its recommended config. */
jsdoc({ config: 'flat/recommended' }),
/**
* Disallow hyphens before param descriptions. Prevents IntelliSense from showing parameter descriptions as bullet points.
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-hyphen-before-param-description.md
*/
{ rules: { 'jsdoc/require-hyphen-before-param-description': ['error', 'never', { tags: { '*': 'never' } }] } },
/**
* Do not require JSDoc on "main world" injected scripts, which have definitions
* which make them _look_ reusable, but are only used by the `inject()` util.
* @see https://github.com/AprilSylph/XKit-Rewritten/blob/master/src/utils/inject.js
*/
{ files: ['src/main_world/**'], rules: { 'jsdoc/require-jsdoc': 'off' } },
];