eslint-config-isaacscript 3.7.2 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -30
- package/base-eslint-comments.js +59 -0
- package/base-eslint.js +716 -277
- package/base-import.js +224 -0
- package/base-jsdoc.js +134 -135
- package/base-n.js +146 -0
- package/base-no-autofix.js +18 -0
- package/base-typescript-eslint.js +360 -223
- package/base-unicorn.js +227 -0
- package/base.js +15 -324
- package/mod.js +104 -94
- package/monorepo.js +4 -24
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -2,34 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/eslint-config-isaacscript)
|
|
4
4
|
|
|
5
|
-
This is a sharable configuration for ESLint that is intended to be used in TypeScript
|
|
5
|
+
This is a sharable configuration for [ESLint](https://eslint.org/) that is intended to be used in TypeScript projects.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
For TypeScript projects, set up your `.eslintrc.cjs` file to extend from the config like this:
|
|
10
|
-
|
|
11
|
-
```js
|
|
12
|
-
// This is the configuration file for ESLint, the TypeScript linter:
|
|
13
|
-
// https://eslint.org/docs/user-guide/configuring
|
|
14
|
-
module.exports = {
|
|
15
|
-
extends: [
|
|
16
|
-
// The linter base is the shared IsaacScript config:
|
|
17
|
-
// https://github.com/IsaacScript/isaacscript/blob/main/packages/eslint-config-isaacscript/base.js
|
|
18
|
-
"eslint-config-isaacscript/base",
|
|
19
|
-
],
|
|
20
|
-
|
|
21
|
-
// Don't bother linting the compiled output.
|
|
22
|
-
ignorePatterns: ["**/dist/**"],
|
|
23
|
-
|
|
24
|
-
parserOptions: {
|
|
25
|
-
// ESLint needs to know about the project's TypeScript settings in order for TypeScript-specific
|
|
26
|
-
// things to lint correctly. We do not point this at "./tsconfig.json" because certain files
|
|
27
|
-
// (such at this file) should be linted but not included in the actual project output.
|
|
28
|
-
project: "./tsconfig.eslint.json",
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
rules: {},
|
|
32
|
-
};
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Please see the [IsaacScript webpage](https://isaacscript.github.io/) for more information.
|
|
7
|
+
Please see the [docs](https://isaacscript.github.io/eslint-config-isaacscript) for more information.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// This ESLint config only contains rules from `eslint-plugin-eslint-comments`:
|
|
2
|
+
// https://github.com/mysticatea/eslint-plugin-eslint-comments
|
|
3
|
+
|
|
4
|
+
// Rules are separated into categories:
|
|
5
|
+
// 1) Best Practices
|
|
6
|
+
// 2) Stylistic Issues
|
|
7
|
+
|
|
8
|
+
/** @type {import("eslint").Linter.RulesRecord} */
|
|
9
|
+
const BEST_PRACTICES = {
|
|
10
|
+
/**
|
|
11
|
+
* The `allowWholeFile` option is enabled because it is common practice to use "eslint-disable"
|
|
12
|
+
* comments for a whole file.
|
|
13
|
+
*/
|
|
14
|
+
"eslint-comments/disable-enable-pair": [
|
|
15
|
+
"error",
|
|
16
|
+
{
|
|
17
|
+
allowWholeFile: true,
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
|
|
21
|
+
"eslint-comments/no-aggregating-enable": "error",
|
|
22
|
+
"eslint-comments/no-duplicate-disable": "error",
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Disabled because if a line breaks three or more ESLint rules, then it is useful to use a single
|
|
26
|
+
* "eslint-disable" comment to make things more concise.
|
|
27
|
+
*/
|
|
28
|
+
"eslint-comments/no-unlimited-disable": "off",
|
|
29
|
+
|
|
30
|
+
"eslint-comments/no-unused-disable": "error",
|
|
31
|
+
"eslint-comments/no-unused-enable": "error",
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @type {import("eslint").Linter.RulesRecord} */
|
|
35
|
+
const STYLISTIC_ISSUES = {
|
|
36
|
+
/**
|
|
37
|
+
* Disabled because it is only useful in projects that want to prevent disabling specific ESLint
|
|
38
|
+
* rules.
|
|
39
|
+
*/
|
|
40
|
+
"eslint-comments/no-restricted-disable": "off",
|
|
41
|
+
|
|
42
|
+
/** Disabled because we want to allow disabling ESLint rules where appropriate. */
|
|
43
|
+
"eslint-comments/no-use": "off",
|
|
44
|
+
|
|
45
|
+
/** Disabled because requiring descriptions for every ESLint disable would be too cumbersome. */
|
|
46
|
+
"eslint-comments/require-description": "off",
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/** @type {import("eslint").Linter.Config} */
|
|
50
|
+
const config = {
|
|
51
|
+
plugins: ["eslint-comments"],
|
|
52
|
+
|
|
53
|
+
rules: {
|
|
54
|
+
...BEST_PRACTICES,
|
|
55
|
+
...STYLISTIC_ISSUES,
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
module.exports = config;
|