eslint-config-isaacscript 3.7.2 → 4.0.0

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/base-n.js ADDED
@@ -0,0 +1,146 @@
1
+ // This ESLint config only contains rules from `eslint-plugin-n`:
2
+ // https://github.com/eslint-community/eslint-plugin-n
3
+ // (This is a forked version of `eslint-plugin-node`.)
4
+
5
+ // Rules are separated into categories:
6
+ // 1) Best Practices
7
+ // 2) Possible Errors
8
+ // 3) Stylistic Issues
9
+
10
+ /** @type {import("eslint").Linter.RulesRecord} */
11
+ const BEST_PRACTICES = {
12
+ "n/no-deprecated-api": "error",
13
+ };
14
+
15
+ /** @type {import("eslint").Linter.RulesRecord} */
16
+ const POSSIBLE_ERRORS = {
17
+ "n/handle-callback-err": "error",
18
+ "n/no-callback-literal": "error",
19
+ "n/no-exports-assign": "error",
20
+
21
+ /** Disabled since it is handled by the TypeScript compiler. */
22
+ "n/no-extraneous-import": "off",
23
+
24
+ /** Disabled since require statements are not used in TypeScript code. */
25
+ "n/no-extraneous-require": "off",
26
+
27
+ /** Disabled because this rule is deprecated. */
28
+ "n/no-hide-core-modules": "off",
29
+
30
+ /** Disabled since it is handled by the TypeScript compiler. */
31
+ "n/no-missing-import": "off",
32
+
33
+ "n/no-missing-require": "error",
34
+ "n/no-new-require": "error",
35
+ "n/no-path-concat": "error",
36
+
37
+ /**
38
+ * Disabled because using `process.exit` is common to exit command-line applications without
39
+ * verbose output.
40
+ */
41
+ "n/no-process-exit": "off",
42
+
43
+ "n/no-unpublished-bin": "error",
44
+ "n/no-unpublished-import": "error",
45
+ "n/no-unpublished-require": "error",
46
+
47
+ /** Disabled because this rule is deprecated. */
48
+ "n/no-unsupported-features": "off",
49
+
50
+ /** Disabled because it is assumed that we are running on modern versions of Node.js. */
51
+ "n/no-unsupported-features/es-builtins": "off",
52
+
53
+ /**
54
+ * Disabled because it is assumed that our transpiler or runtime has support for the latest
55
+ * version of ESM.
56
+ */
57
+ "n/no-unsupported-features/es-syntax": "off",
58
+
59
+ /** Disabled since it is handled by the TypeScript compiler. */
60
+ "n/no-unsupported-features/node-builtins": "off",
61
+
62
+ "n/process-exit-as-throw": "error",
63
+
64
+ /** This rule is configured to work with TypeScript file extensions. */
65
+ "n/shebang": [
66
+ "error",
67
+ {
68
+ convertPath: {
69
+ "src/**/*.ts": ["^src/(.+?)\\.ts$", "dist/$1.js"],
70
+ },
71
+ },
72
+ ],
73
+ };
74
+
75
+ /** @type {import("eslint").Linter.RulesRecord} */
76
+ const STYLISTIC_ISSUES = {
77
+ /** Disabled since stylistic rules from this plugin are not used. */
78
+ "n/callback-return": "off",
79
+
80
+ /** Disabled since stylistic rules from this plugin are not used. */
81
+ "n/exports-style": "off",
82
+
83
+ /**
84
+ * This rule is helpful to automatically fix file extensions in import statements throughout an
85
+ * entire codebase.
86
+ */
87
+ "n/file-extension-in-import": ["error", "always"],
88
+
89
+ /** Disabled since stylistic rules from this plugin are not used. */
90
+ "n/global-require": "off",
91
+
92
+ /** Disabled since stylistic rules from this plugin are not used. */
93
+ "n/no-mixed-requires": "off",
94
+
95
+ /** Disabled since stylistic rules from this plugin are not used. */
96
+ "n/no-process-env": "off",
97
+
98
+ /** Disabled since stylistic rules from this plugin are not used. */
99
+ "n/no-restricted-import": "off",
100
+
101
+ /** Disabled since stylistic rules from this plugin are not used. */
102
+ "n/no-restricted-require": "off",
103
+
104
+ /** Disabled since stylistic rules from this plugin are not used. */
105
+ "n/no-sync": "off",
106
+
107
+ /** Disabled since stylistic rules from this plugin are not used. */
108
+ "n/prefer-global/buffer": "off",
109
+
110
+ /** Disabled since stylistic rules from this plugin are not used. */
111
+ "n/prefer-global/console": "off",
112
+
113
+ /** Disabled since stylistic rules from this plugin are not used. */
114
+ "n/prefer-global/process": "off",
115
+
116
+ /** Disabled since stylistic rules from this plugin are not used. */
117
+ "n/prefer-global/text-decoder": "off",
118
+
119
+ /** Disabled since stylistic rules from this plugin are not used. */
120
+ "n/prefer-global/text-encoder": "off",
121
+
122
+ /** Disabled since stylistic rules from this plugin are not used. */
123
+ "n/prefer-global/url": "off",
124
+
125
+ /** Disabled since stylistic rules from this plugin are not used. */
126
+ "n/prefer-global/url-search-params": "off",
127
+
128
+ /** Disabled since stylistic rules from this plugin are not used. */
129
+ "n/prefer-promises/dns": "off",
130
+
131
+ /** Disabled since stylistic rules from this plugin are not used. */
132
+ "n/prefer-promises/fs": "off",
133
+ };
134
+
135
+ /** @type {import("eslint").Linter.Config} */
136
+ const config = {
137
+ extends: ["plugin:n/recommended"],
138
+
139
+ rules: {
140
+ ...BEST_PRACTICES,
141
+ ...POSSIBLE_ERRORS,
142
+ ...STYLISTIC_ISSUES,
143
+ },
144
+ };
145
+
146
+ module.exports = config;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This ESLint config only contains rules from `eslint-plugin-no-autofix`:
3
+ * https://github.com/aladdin-add/eslint-plugin/tree/master/packages/no-autofix
4
+ *
5
+ * This allows the fixer for specific core ESLint rules to be turned off.
6
+ *
7
+ * @type {import("eslint").Linter.Config}
8
+ */
9
+ const config = {
10
+ plugins: ["no-autofix"],
11
+
12
+ rules: {
13
+ "no-autofix/no-useless-return": "error",
14
+ "no-autofix/prefer-const": "error",
15
+ },
16
+ };
17
+
18
+ module.exports = config;