@andrewt03/eslint-typescript-rules 0.0.68 → 0.0.69
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 +36 -2
- package/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +61 -0
- package/dist/index.mjs +60 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -67,9 +67,11 @@ import globals from "globals";
|
|
|
67
67
|
import tseslint from "typescript-eslint";
|
|
68
68
|
import eslintPluginSimpleImportSort from "eslint-plugin-simple-import-sort";
|
|
69
69
|
import eslintImportPlugin from "eslint-plugin-import";
|
|
70
|
-
import angularEslintPlugin from "@angular-eslint/eslint-plugin";
|
|
71
70
|
import eslintReactPlugin from "eslint-plugin-react";
|
|
72
71
|
import eslintReactHooksPlugin from "eslint-plugin-react-hooks";
|
|
72
|
+
import angularEslintPlugin from "@angular-eslint/eslint-plugin";
|
|
73
|
+
import angularTemplateParser from "@angular-eslint/template-parser";
|
|
74
|
+
import angularTemplatePlugin from "@angular-eslint/eslint-plugin-template";
|
|
73
75
|
|
|
74
76
|
const DIR_NAME = import.meta.dirname;
|
|
75
77
|
|
|
@@ -165,6 +167,21 @@ export default [
|
|
|
165
167
|
...ESLINT_RULES.REACT_ESLINT_CONFIG_RULES,
|
|
166
168
|
...ESLINT_RULES.REACT_HOOKS_ESLINT_CONFIG_RULES
|
|
167
169
|
|
|
170
|
+
// TODO: Add more ESLint rules here for personal customization (or you can override existing rules manually based on project/team development norms)
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
// Angular-Specific (Omit if not necessary)
|
|
175
|
+
files: ["src/**/*.html"],
|
|
176
|
+
languageOptions: {
|
|
177
|
+
parser: angularTemplateParser
|
|
178
|
+
},
|
|
179
|
+
plugins: {
|
|
180
|
+
"@angular-eslint/template": angularTemplatePlugin
|
|
181
|
+
},
|
|
182
|
+
rules: {
|
|
183
|
+
...ESLINT_RULES.ANGULAR_HTML_TEMPLATE_ESLINT_CONFIG_RULES
|
|
184
|
+
|
|
168
185
|
// TODO: Add more ESLint rules here for personal customization (or you can override existing rules manually based on project/team development norms)
|
|
169
186
|
}
|
|
170
187
|
}
|
|
@@ -183,9 +200,11 @@ const globals = require("globals");
|
|
|
183
200
|
const tseslint = require("typescript-eslint");
|
|
184
201
|
const eslintPluginSimpleImportSort = require("eslint-plugin-simple-import-sort");
|
|
185
202
|
const eslintImportPlugin = require("eslint-plugin-import");
|
|
186
|
-
const angularEslintPlugin = require("@angular-eslint/eslint-plugin");
|
|
187
203
|
const eslintReactPlugin = require("eslint-plugin-react");
|
|
188
204
|
const eslintReactHooksPlugin = require("eslint-plugin-react-hooks");
|
|
205
|
+
const angularEslintPlugin = require("@angular-eslint/eslint-plugin");
|
|
206
|
+
const angularTemplateParser = require("@angular-eslint/template-parser");
|
|
207
|
+
const angularTemplatePlugin = require("@angular-eslint/eslint-plugin-template");
|
|
189
208
|
|
|
190
209
|
module.exports = [
|
|
191
210
|
{
|
|
@@ -279,6 +298,21 @@ module.exports = [
|
|
|
279
298
|
...ESLINT_RULES.REACT_ESLINT_CONFIG_RULES,
|
|
280
299
|
...ESLINT_RULES.REACT_HOOKS_ESLINT_CONFIG_RULES
|
|
281
300
|
|
|
301
|
+
// TODO: Add more ESLint rules here for personal customization (or you can override existing rules manually based on project/team development norms)
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
// Angular-Specific (Omit if not necessary)
|
|
306
|
+
files: ["src/**/*.html"],
|
|
307
|
+
languageOptions: {
|
|
308
|
+
parser: angularTemplateParser
|
|
309
|
+
},
|
|
310
|
+
plugins: {
|
|
311
|
+
"@angular-eslint/template": angularTemplatePlugin
|
|
312
|
+
},
|
|
313
|
+
rules: {
|
|
314
|
+
...ESLINT_RULES.ANGULAR_HTML_TEMPLATE_ESLINT_CONFIG_RULES
|
|
315
|
+
|
|
282
316
|
// TODO: Add more ESLint rules here for personal customization (or you can override existing rules manually based on project/team development norms)
|
|
283
317
|
}
|
|
284
318
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -40,5 +40,9 @@ declare const REACT_ESLINT_CONFIG_RULES: ConfigRules;
|
|
|
40
40
|
declare const REACT_HOOKS_ESLINT_CONFIG_RULES: {
|
|
41
41
|
"react-hooks/rules-of-hooks": string;
|
|
42
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* @tutorial [Angular-HTML-Template-ESLint-Reference](https://www.npmjs.com/package/@angular-eslint/eslint-plugin-template)
|
|
45
|
+
*/
|
|
46
|
+
declare const ANGULAR_HTML_TEMPLATE_ESLINT_CONFIG_RULES: ConfigRules;
|
|
43
47
|
|
|
44
|
-
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 };
|
|
48
|
+
export { ANGULAR_ESLINT_CONFIG_RULES, ANGULAR_HTML_TEMPLATE_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
|
@@ -40,5 +40,9 @@ declare const REACT_ESLINT_CONFIG_RULES: ConfigRules;
|
|
|
40
40
|
declare const REACT_HOOKS_ESLINT_CONFIG_RULES: {
|
|
41
41
|
"react-hooks/rules-of-hooks": string;
|
|
42
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* @tutorial [Angular-HTML-Template-ESLint-Reference](https://www.npmjs.com/package/@angular-eslint/eslint-plugin-template)
|
|
45
|
+
*/
|
|
46
|
+
declare const ANGULAR_HTML_TEMPLATE_ESLINT_CONFIG_RULES: ConfigRules;
|
|
43
47
|
|
|
44
|
-
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 };
|
|
48
|
+
export { ANGULAR_ESLINT_CONFIG_RULES, ANGULAR_HTML_TEMPLATE_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
|
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
ANGULAR_ESLINT_CONFIG_RULES: () => ANGULAR_ESLINT_CONFIG_RULES,
|
|
24
|
+
ANGULAR_HTML_TEMPLATE_ESLINT_CONFIG_RULES: () => ANGULAR_HTML_TEMPLATE_ESLINT_CONFIG_RULES,
|
|
24
25
|
CONSOLE_DEBUGGER_ERROR_ESLINT_CONFIG_RULES: () => CONSOLE_DEBUGGER_ERROR_ESLINT_CONFIG_RULES,
|
|
25
26
|
CONSOLE_DEBUGGER_WARN_ESLINT_CONFIG_RULES: () => CONSOLE_DEBUGGER_WARN_ESLINT_CONFIG_RULES,
|
|
26
27
|
REACT_ESLINT_CONFIG_RULES: () => REACT_ESLINT_CONFIG_RULES,
|
|
@@ -399,9 +400,69 @@ var REACT_ESLINT_CONFIG_RULES = {
|
|
|
399
400
|
var REACT_HOOKS_ESLINT_CONFIG_RULES = {
|
|
400
401
|
"react-hooks/rules-of-hooks": "error"
|
|
401
402
|
};
|
|
403
|
+
var ANGULAR_HTML_TEMPLATE_ESLINT_CONFIG_RULES = {
|
|
404
|
+
"@angular-eslint/template/alt-text": "warn",
|
|
405
|
+
"@angular-eslint/template/banana-in-box": "error",
|
|
406
|
+
"@angular-eslint/template/button-has-type": "error",
|
|
407
|
+
"@angular-eslint/template/click-events-have-key-events": "warn",
|
|
408
|
+
"@angular-eslint/template/conditional-complexity": "error",
|
|
409
|
+
"@angular-eslint/template/cyclomatic-complexity": "error",
|
|
410
|
+
"@angular-eslint/template/elements-content": "warn",
|
|
411
|
+
"@angular-eslint/template/eqeqeq": [
|
|
412
|
+
"error",
|
|
413
|
+
{
|
|
414
|
+
allowNullOrUndefined: true
|
|
415
|
+
}
|
|
416
|
+
],
|
|
417
|
+
// "@angular-eslint/template/i18n": "warn", // Disabled due to excessive warnings; enable if internationalization is a priority
|
|
418
|
+
"@angular-eslint/template/interactive-supports-focus": "warn",
|
|
419
|
+
"@angular-eslint/template/mouse-events-have-key-events": "warn",
|
|
420
|
+
"@angular-eslint/template/no-any": "error",
|
|
421
|
+
"@angular-eslint/template/no-autofocus": "warn",
|
|
422
|
+
// "@angular-eslint/template/no-call-expression": "warn",
|
|
423
|
+
"@angular-eslint/template/no-distracting-elements": "warn",
|
|
424
|
+
"@angular-eslint/template/no-empty-control-flow": "warn",
|
|
425
|
+
"@angular-eslint/template/no-inline-styles": "warn",
|
|
426
|
+
"@angular-eslint/template/no-interpolation-in-attributes": [
|
|
427
|
+
"error",
|
|
428
|
+
{
|
|
429
|
+
allowSubstringInterpolation: true
|
|
430
|
+
}
|
|
431
|
+
],
|
|
432
|
+
"@angular-eslint/template/no-negated-async": "error",
|
|
433
|
+
"@angular-eslint/template/no-positive-tabindex": "warn",
|
|
434
|
+
"@angular-eslint/template/prefer-at-else": "error",
|
|
435
|
+
"@angular-eslint/template/prefer-at-empty": "warn",
|
|
436
|
+
"@angular-eslint/template/prefer-built-in-pipes": "error",
|
|
437
|
+
"@angular-eslint/template/prefer-contextual-for-variables": "warn",
|
|
438
|
+
"@angular-eslint/template/prefer-control-flow": "error",
|
|
439
|
+
// "@angular-eslint/template/prefer-ngsrc": "warn",
|
|
440
|
+
"@angular-eslint/template/prefer-template-literal": "error",
|
|
441
|
+
"@angular-eslint/template/role-has-required-aria": "warn",
|
|
442
|
+
"@angular-eslint/template/table-scope": "error",
|
|
443
|
+
// "@angular-eslint/template/use-track-by-function": "error",
|
|
444
|
+
"@angular-eslint/template/valid-aria": "warn",
|
|
445
|
+
"@angular-eslint/template/attributes-order": [
|
|
446
|
+
"error",
|
|
447
|
+
{
|
|
448
|
+
alphabetical: true,
|
|
449
|
+
order: [
|
|
450
|
+
"STRUCTURAL_DIRECTIVE",
|
|
451
|
+
"TEMPLATE_REFERENCE",
|
|
452
|
+
"ATTRIBUTE_BINDING",
|
|
453
|
+
"INPUT_BINDING",
|
|
454
|
+
"TWO_WAY_BINDING",
|
|
455
|
+
"OUTPUT_BINDING"
|
|
456
|
+
]
|
|
457
|
+
}
|
|
458
|
+
],
|
|
459
|
+
"@angular-eslint/template/prefer-self-closing-tags": "error",
|
|
460
|
+
"@angular-eslint/template/prefer-static-string-properties": "error"
|
|
461
|
+
};
|
|
402
462
|
// Annotate the CommonJS export names for ESM import in node:
|
|
403
463
|
0 && (module.exports = {
|
|
404
464
|
ANGULAR_ESLINT_CONFIG_RULES,
|
|
465
|
+
ANGULAR_HTML_TEMPLATE_ESLINT_CONFIG_RULES,
|
|
405
466
|
CONSOLE_DEBUGGER_ERROR_ESLINT_CONFIG_RULES,
|
|
406
467
|
CONSOLE_DEBUGGER_WARN_ESLINT_CONFIG_RULES,
|
|
407
468
|
REACT_ESLINT_CONFIG_RULES,
|
package/dist/index.mjs
CHANGED
|
@@ -365,8 +365,68 @@ var REACT_ESLINT_CONFIG_RULES = {
|
|
|
365
365
|
var REACT_HOOKS_ESLINT_CONFIG_RULES = {
|
|
366
366
|
"react-hooks/rules-of-hooks": "error"
|
|
367
367
|
};
|
|
368
|
+
var ANGULAR_HTML_TEMPLATE_ESLINT_CONFIG_RULES = {
|
|
369
|
+
"@angular-eslint/template/alt-text": "warn",
|
|
370
|
+
"@angular-eslint/template/banana-in-box": "error",
|
|
371
|
+
"@angular-eslint/template/button-has-type": "error",
|
|
372
|
+
"@angular-eslint/template/click-events-have-key-events": "warn",
|
|
373
|
+
"@angular-eslint/template/conditional-complexity": "error",
|
|
374
|
+
"@angular-eslint/template/cyclomatic-complexity": "error",
|
|
375
|
+
"@angular-eslint/template/elements-content": "warn",
|
|
376
|
+
"@angular-eslint/template/eqeqeq": [
|
|
377
|
+
"error",
|
|
378
|
+
{
|
|
379
|
+
allowNullOrUndefined: true
|
|
380
|
+
}
|
|
381
|
+
],
|
|
382
|
+
// "@angular-eslint/template/i18n": "warn", // Disabled due to excessive warnings; enable if internationalization is a priority
|
|
383
|
+
"@angular-eslint/template/interactive-supports-focus": "warn",
|
|
384
|
+
"@angular-eslint/template/mouse-events-have-key-events": "warn",
|
|
385
|
+
"@angular-eslint/template/no-any": "error",
|
|
386
|
+
"@angular-eslint/template/no-autofocus": "warn",
|
|
387
|
+
// "@angular-eslint/template/no-call-expression": "warn",
|
|
388
|
+
"@angular-eslint/template/no-distracting-elements": "warn",
|
|
389
|
+
"@angular-eslint/template/no-empty-control-flow": "warn",
|
|
390
|
+
"@angular-eslint/template/no-inline-styles": "warn",
|
|
391
|
+
"@angular-eslint/template/no-interpolation-in-attributes": [
|
|
392
|
+
"error",
|
|
393
|
+
{
|
|
394
|
+
allowSubstringInterpolation: true
|
|
395
|
+
}
|
|
396
|
+
],
|
|
397
|
+
"@angular-eslint/template/no-negated-async": "error",
|
|
398
|
+
"@angular-eslint/template/no-positive-tabindex": "warn",
|
|
399
|
+
"@angular-eslint/template/prefer-at-else": "error",
|
|
400
|
+
"@angular-eslint/template/prefer-at-empty": "warn",
|
|
401
|
+
"@angular-eslint/template/prefer-built-in-pipes": "error",
|
|
402
|
+
"@angular-eslint/template/prefer-contextual-for-variables": "warn",
|
|
403
|
+
"@angular-eslint/template/prefer-control-flow": "error",
|
|
404
|
+
// "@angular-eslint/template/prefer-ngsrc": "warn",
|
|
405
|
+
"@angular-eslint/template/prefer-template-literal": "error",
|
|
406
|
+
"@angular-eslint/template/role-has-required-aria": "warn",
|
|
407
|
+
"@angular-eslint/template/table-scope": "error",
|
|
408
|
+
// "@angular-eslint/template/use-track-by-function": "error",
|
|
409
|
+
"@angular-eslint/template/valid-aria": "warn",
|
|
410
|
+
"@angular-eslint/template/attributes-order": [
|
|
411
|
+
"error",
|
|
412
|
+
{
|
|
413
|
+
alphabetical: true,
|
|
414
|
+
order: [
|
|
415
|
+
"STRUCTURAL_DIRECTIVE",
|
|
416
|
+
"TEMPLATE_REFERENCE",
|
|
417
|
+
"ATTRIBUTE_BINDING",
|
|
418
|
+
"INPUT_BINDING",
|
|
419
|
+
"TWO_WAY_BINDING",
|
|
420
|
+
"OUTPUT_BINDING"
|
|
421
|
+
]
|
|
422
|
+
}
|
|
423
|
+
],
|
|
424
|
+
"@angular-eslint/template/prefer-self-closing-tags": "error",
|
|
425
|
+
"@angular-eslint/template/prefer-static-string-properties": "error"
|
|
426
|
+
};
|
|
368
427
|
export {
|
|
369
428
|
ANGULAR_ESLINT_CONFIG_RULES,
|
|
429
|
+
ANGULAR_HTML_TEMPLATE_ESLINT_CONFIG_RULES,
|
|
370
430
|
CONSOLE_DEBUGGER_ERROR_ESLINT_CONFIG_RULES,
|
|
371
431
|
CONSOLE_DEBUGGER_WARN_ESLINT_CONFIG_RULES,
|
|
372
432
|
REACT_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.69",
|
|
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",
|