@andrewt03/eslint-typescript-rules 0.0.21 → 0.0.23
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 +233 -2
- package/dist/index.d.mts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +38 -1
- package/dist/index.mjs +37 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,3 +1,234 @@
|
|
|
1
|
-
# AndrewTran03-ESLint-TypeScript-Rules
|
|
1
|
+
# `AndrewTran03-ESLint-TypeScript-Rules` · [](https://github.com/facebook/react/blob/main/LICENSE) [](https://www.npmjs.com/package/@andrewt03/eslint-typescript-rules)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The `AndrewTran03-ESLint-TypeScript-Rules` package is `recommended` ESLint Rules for general `TypeScript`, `Node.js/Express.js`, `Angular`, and `React.js` Projects that utilize `TypeScript` for development.
|
|
4
|
+
|
|
5
|
+
- **Note:** By default, we will be using ESLint's newest `Flat Config` file configuration (published in August 2022 and publicly announced on this [blog](https://eslint.org/blog/2022/08/new-config-system-part-2/) post). If you are currently using a legacy `eslintrc` format in your codebase (such as `.eslintrc`, `.eslintrc.js`, `.eslintrc.json`, `.eslintrc.yml`, or other another legacy-equivalent file), please consult `ESLint` for the most updated [Configuration Migration Guide](https://eslint.org/docs/latest/use/configure/migration-guide).
|
|
6
|
+
|
|
7
|
+
## Necessary Dependencies
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
# General:
|
|
11
|
+
eslint
|
|
12
|
+
eslint-plugin-import
|
|
13
|
+
eslint-plugin-simple-import-sort
|
|
14
|
+
eslint-plugin-unicorn
|
|
15
|
+
typescript-eslint
|
|
16
|
+
@typescript-eslint/utils
|
|
17
|
+
globals
|
|
18
|
+
|
|
19
|
+
# Angular-Specific:
|
|
20
|
+
angular-eslint
|
|
21
|
+
|
|
22
|
+
# React-Specific:
|
|
23
|
+
eslint-plugin-react
|
|
24
|
+
eslint-plugin-react-hooks
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Example Usage
|
|
28
|
+
|
|
29
|
+
### `NPM` File Configuration
|
|
30
|
+
|
|
31
|
+
- Add the following lines to your `package.json` under `scripts`:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"scripts": {
|
|
36
|
+
// TODO: [REMOVE THIS COMMENT] Other NPM project aliases (here)...
|
|
37
|
+
// TODO: [REMOVE THIS COMMENT] Change directory path in these commands based on project configuration and use-case...
|
|
38
|
+
"lint": "eslint \"./src\"",
|
|
39
|
+
"lint:fix": "eslint \"./src\" --fix"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
- Type `npm run lint` in your terminal to log your linting warnings/errors.
|
|
45
|
+
- Type `npm run lint:fix` in your terminal to allow `ESLint` to try and resolve your linting warnings/errors within your project (wherever possible).
|
|
46
|
+
|
|
47
|
+
### `ESLint` File Configuration
|
|
48
|
+
|
|
49
|
+
#### Recommended (Stable) - `CommonJS`
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
// eslint.config.cjs
|
|
55
|
+
const ESLINT_RULES = require("@andrewt03/eslint-typescript-rules");
|
|
56
|
+
const eslintPluginUnicorn = require("eslint-plugin-unicorn");
|
|
57
|
+
const globals = require("globals");
|
|
58
|
+
const tseslint = require("typescript-eslint");
|
|
59
|
+
const eslintPluginSimpleImportSort = require("eslint-plugin-simple-import-sort");
|
|
60
|
+
const eslintImportPlugin = require("eslint-plugin-import");
|
|
61
|
+
const angularEslintPlugin = require("@angular-eslint/eslint-plugin");
|
|
62
|
+
const eslintReactPlugin = require("eslint-plugin-react");
|
|
63
|
+
const eslintReactHooksPlugin = require("eslint-plugin-react-hooks");
|
|
64
|
+
|
|
65
|
+
module.exports = [
|
|
66
|
+
{
|
|
67
|
+
ignores: ["**/dist"]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
files: ["src/**/*.ts", "src/**/*.tsx"],
|
|
71
|
+
|
|
72
|
+
// React-Specific (Omit if not necessary)
|
|
73
|
+
settings: {
|
|
74
|
+
react: {
|
|
75
|
+
version: "detect"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
languageOptions: {
|
|
80
|
+
globals: globals.builtin,
|
|
81
|
+
parser: tseslint.parser,
|
|
82
|
+
parserOptions: {
|
|
83
|
+
projectService: true,
|
|
84
|
+
tsconfigRootDir: __dirname,
|
|
85
|
+
|
|
86
|
+
// React-Specific (Omit if not necessary)
|
|
87
|
+
ecmaFeatures: {
|
|
88
|
+
jsx: true
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
plugins: {
|
|
93
|
+
unicorn: eslintPluginUnicorn,
|
|
94
|
+
"@typescript-eslint": tseslint.plugin,
|
|
95
|
+
"simple-import-sort": eslintPluginSimpleImportSort,
|
|
96
|
+
import: eslintImportPlugin,
|
|
97
|
+
|
|
98
|
+
// Angular-Specific (Omit if not necessary)
|
|
99
|
+
"@angular-eslint": angularEslintPlugin,
|
|
100
|
+
|
|
101
|
+
// React-Specific (Omit if not necessary)
|
|
102
|
+
react: eslintReactPlugin,
|
|
103
|
+
"react-hooks": eslintReactHooksPlugin
|
|
104
|
+
},
|
|
105
|
+
rules: {
|
|
106
|
+
// Standard ESLint Rules
|
|
107
|
+
...ESLINT_RULES.STANDARD_ESLINT_CONFIG_RULES,
|
|
108
|
+
|
|
109
|
+
// TypeScript ESLint Rules
|
|
110
|
+
...ESLINT_RULES.TYPESCRIPT_ESLINT_CONFIG_RULES,
|
|
111
|
+
|
|
112
|
+
// Unicorn ESLint Rules
|
|
113
|
+
...ESLINT_RULES.UNICORN_ESLINT_CONFIG_RULES,
|
|
114
|
+
|
|
115
|
+
// ESLint Rules: Console/Debugger to "Warn"
|
|
116
|
+
...ESLINT_RULES.CONSOLE_DEBUGGER_WARN_ESLINT_CONFIG_RULES,
|
|
117
|
+
// ...ESLINT_RULES.CONSOLE_DEBUGGER_ERROR_ESLINT_CONFIG_RULES, // Alternative: Console/Debugger to "Error"
|
|
118
|
+
|
|
119
|
+
// ESLint Rules: Sorting Imports
|
|
120
|
+
...ESLINT_RULES.SORT_IMPORT_ESLINT_CONFIG_RULES,
|
|
121
|
+
|
|
122
|
+
// ESLint Rules: Angular
|
|
123
|
+
...ESLINT_RULES.ANGULAR_ESLINT_CONFIG_RULES,
|
|
124
|
+
|
|
125
|
+
// ESLint Rules: React
|
|
126
|
+
...ESLINT_RULES.REACT_ESLINT_CONFIG_RULES,
|
|
127
|
+
...ESLINT_RULES.REACT_HOOKS_ESLINT_CONFIG_RULES
|
|
128
|
+
|
|
129
|
+
// TODO: Add more ESLint rules here for personal customization (or you can override existing rules manually based on project/team development norms)
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
];
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Alternative - `ESModules`
|
|
136
|
+
|
|
137
|
+
- **Note:** In `ESModules`, the `__dirname` variable is not available. As a fix, in most cases, we can leverage `process.cwd()` in this case since the `ESLint` file configuration is typically written at the top-level of a project. However, if this does not work, some alternatives can be found in this [StackOverflow](https://stackoverflow.com/questions/46745014/alternative-for-dirname-in-node-js-when-using-es6-modules) post.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
```js
|
|
142
|
+
// eslint.config.mjs
|
|
143
|
+
import ESLINT_RULES from "@andrewt03/eslint-typescript-rules";
|
|
144
|
+
import eslintPluginUnicorn from "eslint-plugin-unicorn";
|
|
145
|
+
import globals from "globals";
|
|
146
|
+
import tseslint from "typescript-eslint";
|
|
147
|
+
import eslintPluginSimpleImportSort from "eslint-plugin-simple-import-sort";
|
|
148
|
+
import eslintImportPlugin from "eslint-plugin-import";
|
|
149
|
+
import angularEslintPlugin from "@angular-eslint/eslint-plugin";
|
|
150
|
+
import eslintReactPlugin from "eslint-plugin-react";
|
|
151
|
+
import eslintReactHooksPlugin from "eslint-plugin-react-hooks";
|
|
152
|
+
|
|
153
|
+
export default [
|
|
154
|
+
{
|
|
155
|
+
ignores: ["**/dist"]
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
files: ["src/**/*.ts", "src/**/*.tsx"],
|
|
159
|
+
|
|
160
|
+
// React-Specific (Omit if not necessary)
|
|
161
|
+
settings: {
|
|
162
|
+
react: {
|
|
163
|
+
version: "detect"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
languageOptions: {
|
|
168
|
+
globals: globals.builtin,
|
|
169
|
+
parser: tseslint.parser,
|
|
170
|
+
parserOptions: {
|
|
171
|
+
projectService: true,
|
|
172
|
+
tsconfigRootDir: new URL(".", import.meta.url).pathname,
|
|
173
|
+
|
|
174
|
+
// React-Specific (Omit if not necessary)
|
|
175
|
+
ecmaFeatures: {
|
|
176
|
+
jsx: true
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
plugins: {
|
|
181
|
+
unicorn: eslintPluginUnicorn,
|
|
182
|
+
"@typescript-eslint": tseslint.plugin,
|
|
183
|
+
"simple-import-sort": eslintPluginSimpleImportSort,
|
|
184
|
+
import: eslintImportPlugin,
|
|
185
|
+
|
|
186
|
+
// Angular-Specific (Omit if not necessary)
|
|
187
|
+
"@angular-eslint": angularEslintPlugin,
|
|
188
|
+
|
|
189
|
+
// React-Specific (Omit if not necessary)
|
|
190
|
+
react: eslintReactPlugin,
|
|
191
|
+
"react-hooks": eslintReactHooksPlugin
|
|
192
|
+
},
|
|
193
|
+
rules: {
|
|
194
|
+
// Standard ESLint Rules
|
|
195
|
+
...ESLINT_RULES.STANDARD_ESLINT_CONFIG_RULES,
|
|
196
|
+
|
|
197
|
+
// TypeScript ESLint Rules
|
|
198
|
+
...ESLINT_RULES.TYPESCRIPT_ESLINT_CONFIG_RULES,
|
|
199
|
+
|
|
200
|
+
// Unicorn ESLint Rules
|
|
201
|
+
...ESLINT_RULES.UNICORN_ESLINT_CONFIG_RULES,
|
|
202
|
+
|
|
203
|
+
// ESLint Rules: Console/Debugger to "Warn"
|
|
204
|
+
...ESLINT_RULES.CONSOLE_DEBUGGER_WARN_ESLINT_CONFIG_RULES,
|
|
205
|
+
// ...ESLINT_RULES.CONSOLE_DEBUGGER_ERROR_ESLINT_CONFIG_RULES, // Alternative: Console/Debugger to "Error"
|
|
206
|
+
|
|
207
|
+
// ESLint Rules: Sorting Imports
|
|
208
|
+
...ESLINT_RULES.SORT_IMPORT_ESLINT_CONFIG_RULES,
|
|
209
|
+
|
|
210
|
+
// ESLint Rules: Angular
|
|
211
|
+
...ESLINT_RULES.ANGULAR_ESLINT_CONFIG_RULES,
|
|
212
|
+
|
|
213
|
+
// ESLint Rules: React
|
|
214
|
+
...ESLINT_RULES.REACT_ESLINT_CONFIG_RULES,
|
|
215
|
+
...ESLINT_RULES.REACT_HOOKS_ESLINT_CONFIG_RULES
|
|
216
|
+
|
|
217
|
+
// TODO: Add more ESLint rules here for personal customization (or you can override existing rules manually based on project/team development norms)
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
];
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Additional Resources:
|
|
224
|
+
|
|
225
|
+
For more information about `ESLint` Rule Configuration, please check out the following links:
|
|
226
|
+
|
|
227
|
+
- `ESLint`: https://eslint.org/docs/latest/rules/
|
|
228
|
+
- `TypeScript-ESLint`: https://typescript-eslint.io/rules/
|
|
229
|
+
- `ESLint-Plugin-Unicorn`: https://github.com/sindresorhus/eslint-plugin-unicorn/tree/main?tab=readme-ov-file
|
|
230
|
+
- `ESLint-Plugin-Import`: https://www.npmjs.com/package/eslint-plugin-import
|
|
231
|
+
- `ESLint-Plugin-Simple-Import-Sort`: https://www.npmjs.com/package/eslint-plugin-simple-import-sort
|
|
232
|
+
- `Angular-ESLint`: https://www.npmjs.com/package/@angular-eslint/eslint-plugin
|
|
233
|
+
- `React-ESLint`: https://www.npmjs.com/package/eslint-plugin-react
|
|
234
|
+
- `React-Hooks-ESLint`: https://www.npmjs.com/package/eslint-plugin-react-hooks
|
package/dist/index.d.mts
CHANGED
|
@@ -35,8 +35,14 @@ declare const SORT_IMPORT_ESLINT_CONFIG_RULES: ConfigRules;
|
|
|
35
35
|
*/
|
|
36
36
|
declare const ANGULAR_ESLINT_CONFIG_RULES: ConfigRules;
|
|
37
37
|
/**
|
|
38
|
-
* @tutorial [React-ESLint-Reference](https://
|
|
38
|
+
* @tutorial [React-ESLint-Reference](https://www.npmjs.com/package/eslint-plugin-react)
|
|
39
39
|
*/
|
|
40
40
|
declare const REACT_ESLINT_CONFIG_RULES: ConfigRules;
|
|
41
|
+
/**
|
|
42
|
+
* @tutorial [React-Hooks-ESLint-Reference](https://www.npmjs.com/package/eslint-plugin-react-hooks)
|
|
43
|
+
*/
|
|
44
|
+
declare const REACT_HOOKS_ESLINT_CONFIG_RULES: {
|
|
45
|
+
"react-hooks/rules-of-hooks": string;
|
|
46
|
+
};
|
|
41
47
|
|
|
42
|
-
export { ANGULAR_ESLINT_CONFIG_RULES, CONSOLE_DEBUGGER_ERROR_ESLINT_CONFIG_RULES, CONSOLE_DEBUGGER_WARN_ESLINT_CONFIG_RULES, type ConfigRules, REACT_ESLINT_CONFIG_RULES, SORT_IMPORT_ESLINT_CONFIG_RULES, STANDARD_ESLINT_CONFIG_RULES, TYPESCRIPT_ESLINT_CONFIG_RULES, UNICORN_ESLINT_CONFIG_RULES };
|
|
48
|
+
export { ANGULAR_ESLINT_CONFIG_RULES, CONSOLE_DEBUGGER_ERROR_ESLINT_CONFIG_RULES, CONSOLE_DEBUGGER_WARN_ESLINT_CONFIG_RULES, type ConfigRules, REACT_ESLINT_CONFIG_RULES, REACT_HOOKS_ESLINT_CONFIG_RULES, SORT_IMPORT_ESLINT_CONFIG_RULES, STANDARD_ESLINT_CONFIG_RULES, TYPESCRIPT_ESLINT_CONFIG_RULES, UNICORN_ESLINT_CONFIG_RULES };
|
package/dist/index.d.ts
CHANGED
|
@@ -35,8 +35,14 @@ declare const SORT_IMPORT_ESLINT_CONFIG_RULES: ConfigRules;
|
|
|
35
35
|
*/
|
|
36
36
|
declare const ANGULAR_ESLINT_CONFIG_RULES: ConfigRules;
|
|
37
37
|
/**
|
|
38
|
-
* @tutorial [React-ESLint-Reference](https://
|
|
38
|
+
* @tutorial [React-ESLint-Reference](https://www.npmjs.com/package/eslint-plugin-react)
|
|
39
39
|
*/
|
|
40
40
|
declare const REACT_ESLINT_CONFIG_RULES: ConfigRules;
|
|
41
|
+
/**
|
|
42
|
+
* @tutorial [React-Hooks-ESLint-Reference](https://www.npmjs.com/package/eslint-plugin-react-hooks)
|
|
43
|
+
*/
|
|
44
|
+
declare const REACT_HOOKS_ESLINT_CONFIG_RULES: {
|
|
45
|
+
"react-hooks/rules-of-hooks": string;
|
|
46
|
+
};
|
|
41
47
|
|
|
42
|
-
export { ANGULAR_ESLINT_CONFIG_RULES, CONSOLE_DEBUGGER_ERROR_ESLINT_CONFIG_RULES, CONSOLE_DEBUGGER_WARN_ESLINT_CONFIG_RULES, type ConfigRules, REACT_ESLINT_CONFIG_RULES, SORT_IMPORT_ESLINT_CONFIG_RULES, STANDARD_ESLINT_CONFIG_RULES, TYPESCRIPT_ESLINT_CONFIG_RULES, UNICORN_ESLINT_CONFIG_RULES };
|
|
48
|
+
export { ANGULAR_ESLINT_CONFIG_RULES, CONSOLE_DEBUGGER_ERROR_ESLINT_CONFIG_RULES, CONSOLE_DEBUGGER_WARN_ESLINT_CONFIG_RULES, type ConfigRules, REACT_ESLINT_CONFIG_RULES, REACT_HOOKS_ESLINT_CONFIG_RULES, SORT_IMPORT_ESLINT_CONFIG_RULES, STANDARD_ESLINT_CONFIG_RULES, TYPESCRIPT_ESLINT_CONFIG_RULES, UNICORN_ESLINT_CONFIG_RULES };
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __export(index_exports, {
|
|
|
24
24
|
CONSOLE_DEBUGGER_ERROR_ESLINT_CONFIG_RULES: () => CONSOLE_DEBUGGER_ERROR_ESLINT_CONFIG_RULES,
|
|
25
25
|
CONSOLE_DEBUGGER_WARN_ESLINT_CONFIG_RULES: () => CONSOLE_DEBUGGER_WARN_ESLINT_CONFIG_RULES,
|
|
26
26
|
REACT_ESLINT_CONFIG_RULES: () => REACT_ESLINT_CONFIG_RULES,
|
|
27
|
+
REACT_HOOKS_ESLINT_CONFIG_RULES: () => REACT_HOOKS_ESLINT_CONFIG_RULES,
|
|
27
28
|
SORT_IMPORT_ESLINT_CONFIG_RULES: () => SORT_IMPORT_ESLINT_CONFIG_RULES,
|
|
28
29
|
STANDARD_ESLINT_CONFIG_RULES: () => STANDARD_ESLINT_CONFIG_RULES,
|
|
29
30
|
TYPESCRIPT_ESLINT_CONFIG_RULES: () => TYPESCRIPT_ESLINT_CONFIG_RULES,
|
|
@@ -337,7 +338,42 @@ var ANGULAR_ESLINT_CONFIG_RULES = {
|
|
|
337
338
|
"@angular-eslint/use-pipe-transform-interface": "error"
|
|
338
339
|
};
|
|
339
340
|
var REACT_ESLINT_CONFIG_RULES = {
|
|
340
|
-
"react/hook-use-state": "error"
|
|
341
|
+
"react/hook-use-state": "error",
|
|
342
|
+
"react/destructuring-assignment": "error",
|
|
343
|
+
"react/no-danger": "error",
|
|
344
|
+
"react/no-danger-with-children": "error",
|
|
345
|
+
"react/no-deprecated": "error",
|
|
346
|
+
"react/no-multi-comp": "error",
|
|
347
|
+
"react/no-unused-prop-types": "warn",
|
|
348
|
+
"react/prop-types": "off",
|
|
349
|
+
"react/react-in-jsx-scope": "off",
|
|
350
|
+
"react/boolean-prop-naming": "error",
|
|
351
|
+
"react/no-array-index-key": "error",
|
|
352
|
+
"react/no-direct-mutation-state": "error",
|
|
353
|
+
"react/no-typos": "error",
|
|
354
|
+
"react/jsx-no-target-blank": "error",
|
|
355
|
+
"react/jsx-pascal-case": "error",
|
|
356
|
+
"react/no-access-state-in-setstate": "error",
|
|
357
|
+
"react/jsx-boolean-value": ["error", "always"],
|
|
358
|
+
"react/jsx-no-comment-textnodes": "error",
|
|
359
|
+
"react/jsx-no-duplicate-props": "error",
|
|
360
|
+
"react/jsx-fragments": "error",
|
|
361
|
+
"react/jsx-curly-brace-presence": [
|
|
362
|
+
"error",
|
|
363
|
+
{
|
|
364
|
+
props: "never",
|
|
365
|
+
children: "never",
|
|
366
|
+
propElementValues: "always"
|
|
367
|
+
}
|
|
368
|
+
],
|
|
369
|
+
"react/jsx-uses-vars": "error",
|
|
370
|
+
"react/no-unused-state": "error",
|
|
371
|
+
"react/prefer-read-only-props": "error",
|
|
372
|
+
"react/self-closing-comp": "error",
|
|
373
|
+
"react/void-dom-elements-no-children": "error"
|
|
374
|
+
};
|
|
375
|
+
var REACT_HOOKS_ESLINT_CONFIG_RULES = {
|
|
376
|
+
"react-hooks/rules-of-hooks": "error"
|
|
341
377
|
};
|
|
342
378
|
// Annotate the CommonJS export names for ESM import in node:
|
|
343
379
|
0 && (module.exports = {
|
|
@@ -345,6 +381,7 @@ var REACT_ESLINT_CONFIG_RULES = {
|
|
|
345
381
|
CONSOLE_DEBUGGER_ERROR_ESLINT_CONFIG_RULES,
|
|
346
382
|
CONSOLE_DEBUGGER_WARN_ESLINT_CONFIG_RULES,
|
|
347
383
|
REACT_ESLINT_CONFIG_RULES,
|
|
384
|
+
REACT_HOOKS_ESLINT_CONFIG_RULES,
|
|
348
385
|
SORT_IMPORT_ESLINT_CONFIG_RULES,
|
|
349
386
|
STANDARD_ESLINT_CONFIG_RULES,
|
|
350
387
|
TYPESCRIPT_ESLINT_CONFIG_RULES,
|
package/dist/index.mjs
CHANGED
|
@@ -304,13 +304,49 @@ var ANGULAR_ESLINT_CONFIG_RULES = {
|
|
|
304
304
|
"@angular-eslint/use-pipe-transform-interface": "error"
|
|
305
305
|
};
|
|
306
306
|
var REACT_ESLINT_CONFIG_RULES = {
|
|
307
|
-
"react/hook-use-state": "error"
|
|
307
|
+
"react/hook-use-state": "error",
|
|
308
|
+
"react/destructuring-assignment": "error",
|
|
309
|
+
"react/no-danger": "error",
|
|
310
|
+
"react/no-danger-with-children": "error",
|
|
311
|
+
"react/no-deprecated": "error",
|
|
312
|
+
"react/no-multi-comp": "error",
|
|
313
|
+
"react/no-unused-prop-types": "warn",
|
|
314
|
+
"react/prop-types": "off",
|
|
315
|
+
"react/react-in-jsx-scope": "off",
|
|
316
|
+
"react/boolean-prop-naming": "error",
|
|
317
|
+
"react/no-array-index-key": "error",
|
|
318
|
+
"react/no-direct-mutation-state": "error",
|
|
319
|
+
"react/no-typos": "error",
|
|
320
|
+
"react/jsx-no-target-blank": "error",
|
|
321
|
+
"react/jsx-pascal-case": "error",
|
|
322
|
+
"react/no-access-state-in-setstate": "error",
|
|
323
|
+
"react/jsx-boolean-value": ["error", "always"],
|
|
324
|
+
"react/jsx-no-comment-textnodes": "error",
|
|
325
|
+
"react/jsx-no-duplicate-props": "error",
|
|
326
|
+
"react/jsx-fragments": "error",
|
|
327
|
+
"react/jsx-curly-brace-presence": [
|
|
328
|
+
"error",
|
|
329
|
+
{
|
|
330
|
+
props: "never",
|
|
331
|
+
children: "never",
|
|
332
|
+
propElementValues: "always"
|
|
333
|
+
}
|
|
334
|
+
],
|
|
335
|
+
"react/jsx-uses-vars": "error",
|
|
336
|
+
"react/no-unused-state": "error",
|
|
337
|
+
"react/prefer-read-only-props": "error",
|
|
338
|
+
"react/self-closing-comp": "error",
|
|
339
|
+
"react/void-dom-elements-no-children": "error"
|
|
340
|
+
};
|
|
341
|
+
var REACT_HOOKS_ESLINT_CONFIG_RULES = {
|
|
342
|
+
"react-hooks/rules-of-hooks": "error"
|
|
308
343
|
};
|
|
309
344
|
export {
|
|
310
345
|
ANGULAR_ESLINT_CONFIG_RULES,
|
|
311
346
|
CONSOLE_DEBUGGER_ERROR_ESLINT_CONFIG_RULES,
|
|
312
347
|
CONSOLE_DEBUGGER_WARN_ESLINT_CONFIG_RULES,
|
|
313
348
|
REACT_ESLINT_CONFIG_RULES,
|
|
349
|
+
REACT_HOOKS_ESLINT_CONFIG_RULES,
|
|
314
350
|
SORT_IMPORT_ESLINT_CONFIG_RULES,
|
|
315
351
|
STANDARD_ESLINT_CONFIG_RULES,
|
|
316
352
|
TYPESCRIPT_ESLINT_CONFIG_RULES,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andrewt03/eslint-typescript-rules",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23",
|
|
4
4
|
"description": "Recommended ESLint Rules for general TypeScript, Node.js/Express.js, Angular, and React.js Projects",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"url": "git+https://github.com/AndrewTran03/AndrewTran03-ESLint-TypeScript-Rules.git"
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
|
-
"build": "tsup",
|
|
15
|
+
"build": "rm -rf dist/ && tsup",
|
|
16
16
|
"release": "npm run build && changeset publish",
|
|
17
17
|
"version:patch": "npm run prettier && npm run lint && npm run build && npm version patch && npm install && npm run publish",
|
|
18
18
|
"version:minor": "npm run prettier && npm run lint && npm run build && npm version minor && npm install && npm run publish",
|