@lenne.tech/eslint-config-angular 0.0.15 → 1.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.
Files changed (2) hide show
  1. package/index.js +106 -150
  2. package/package.json +9 -12
package/index.js CHANGED
@@ -1,160 +1,116 @@
1
1
  console.log("Linting Angular...");
2
+ import tsParser from "@typescript-eslint/parser";
3
+ import typescript from "@typescript-eslint/eslint-plugin";
4
+ import stylistic from "@stylistic/eslint-plugin";
2
5
 
3
- module.exports = {
4
- overrides: [
5
- {
6
- files: ["*.ts"],
7
- extends: [
8
- "eslint:recommended",
9
- "plugin:@typescript-eslint/recommended",
10
- "plugin:@angular-eslint/recommended",
11
- // This is required if you use inline templates in Components
12
- "plugin:@angular-eslint/template/process-inline-templates",
13
- "plugin:perfectionist/recommended-natural"
14
- ],
15
- rules: {
16
- /**
17
- * Any TypeScript source code (NOT TEMPLATE) related rules you wish to use/reconfigure over and above the
18
- * recommended set provided by the @angular-eslint project would go here.
19
- */
20
- "@angular-eslint/directive-selector": [
21
- "error",
22
- { type: "attribute", prefix: "app", style: "camelCase" },
23
- ], // Enforces a consistent naming convention for Angular directives
24
- "@angular-eslint/component-selector": [
25
- "error",
26
- { type: "element", prefix: "app", style: "kebab-case" },
27
- ], // Enforces a consistent naming convention for Angular components
28
- "no-async-promise-executor": "warn", // Warns when using an async function as a Promise executor
29
- "@typescript-eslint/no-explicit-any": "warn",
30
- "@typescript-eslint/no-unused-vars": "error", // Reports unused variables in TypeScript code
31
- },
6
+ export default [
7
+ {
8
+ files: ["*.ts"],
9
+ languageOptions: {
10
+ parser: tsParser,
32
11
  },
33
- {
34
- files: ["*.html"],
35
- extends: [
36
- "plugin:@angular-eslint/template/recommended",
37
- "plugin:@angular-eslint/template/accessibility",
38
- ],
39
- rules: {
40
- /**
41
- * Any template/HTML related rules you wish to use/reconfigure over and above the
42
- * recommended set provided by the @angular-eslint project would go here.
43
- */
44
- "@angular-eslint/template/interactive-supports-focus": "warn", // Warns about interactive elements lacking keyboard focus handling in Angular templates
45
- "@angular-eslint/template/click-events-have-key-events": "warn", // Warns about clickable elements lacking keyboard support in Angular templates
46
- },
12
+ plugins: {
13
+ "@typescript-eslint": typescript,
14
+ "@stylistic": stylistic,
15
+ typescript,
47
16
  },
48
- ],
49
- ignorePatterns: ["**/*.js"],
50
- rules: {
51
- "perfectionist/sort-classes": "off",
52
-
53
- // TS
54
- "@typescript-eslint/ban-ts-comment": [
55
- "error",
56
- { "ts-ignore": "allow-with-description" },
57
- ], // Bans specific TypeScript comment syntax
58
- "@typescript-eslint/member-delimiter-style": [
59
- "error",
60
- {
61
- multiline: {
62
- delimiter: "semi",
63
- requireLast: true,
64
- },
65
- singleline: {
66
- delimiter: "semi",
67
- requireLast: false,
17
+ rules: {
18
+ // TS
19
+ "@typescript-eslint/ban-ts-comment": [
20
+ "error",
21
+ { "ts-ignore": "allow-with-description" },
22
+ ], // Bans specific TypeScript comment syntax
23
+ "@stylistic/member-delimiter-style": [
24
+ "error",
25
+ {
26
+ multiline: {
27
+ delimiter: "semi",
28
+ requireLast: true,
29
+ },
30
+ singleline: {
31
+ delimiter: "semi",
32
+ requireLast: false,
33
+ },
34
+ multilineDetection: "brackets",
68
35
  },
69
- multilineDetection: "brackets",
70
- },
71
- ], // Enforces member delimiter style in TypeScript interfaces and type literals
72
- "@typescript-eslint/type-annotation-spacing": ["error", {}], // Enforces consistent spacing around type annotations in TypeScript
73
- "@typescript-eslint/consistent-type-definitions": ["error", "interface"], // Enforces consistent usage of type definitions in TypeScript (interface vs type)
74
- "@typescript-eslint/prefer-ts-expect-error": "error", // Recommends using '@ts-expect-error' over '@ts-ignore' when ignoring TypeScript errors
75
- "@typescript-eslint/no-require-imports": "error", // Disallows using the `require` function to import modules in TypeScript
76
- "no-useless-constructor": "off", // Disallows unnecessary constructors
77
- indent: "off", // Disallows inconsistent indentation
78
- "@typescript-eslint/no-invalid-this": "error", // Reports invalid uses of 'this' in TypeScript code
36
+ ], // Enforces member delimiter style in TypeScript interfaces and type literals
37
+ "@stylistic/type-annotation-spacing": ["error", {}], // Enforces consistent spacing around type annotations in TypeScript
38
+ "@typescript-eslint/consistent-type-definitions": ["error", "interface"], // Enforces consistent usage of type definitions in TypeScript (interface vs type)
39
+ "@typescript-eslint/prefer-ts-expect-error": "error", // Recommends using '@ts-expect-error' over '@ts-ignore' when ignoring TypeScript errors
40
+ "@typescript-eslint/no-require-imports": "error", // Disallows using the `require` function to import modules in TypeScript
41
+ "no-useless-constructor": "off", // Disallows unnecessary constructors
42
+ indent: "off", // Disallows inconsistent indentation
43
+ "@typescript-eslint/no-invalid-this": "error", // Reports invalid uses of 'this' in TypeScript code
79
44
 
80
- "@typescript-eslint/no-redeclare": "error", // Reports redeclaring variables in TypeScript code
81
- "@typescript-eslint/no-use-before-define": [
82
- "error",
83
- { functions: false, classes: false, variables: true },
84
- ], // Reports using variables before they are defined in TypeScript code (excluding functions and classes)
85
- "@typescript-eslint/comma-dangle": ["error", "only-multiline"], // Enforces trailing commas in TypeScript arrays and objects, but only in multiline expressions
86
- "@typescript-eslint/object-curly-spacing": ["error", "always"], // Enforces consistent spacing inside braces for TypeScript objects
87
- "@typescript-eslint/semi": ["error"], // Enforces the use of semicolons in TypeScript code
88
- "@typescript-eslint/quotes": ["error", "single"], // Enforces the consistent use of single quotes in TypeScript code
89
- "@typescript-eslint/space-before-blocks": ["error", "always"], // Enforces consistent spacing before blocks in TypeScript code
90
- "@typescript-eslint/space-before-function-paren": [
91
- "error",
92
- {
93
- anonymous: "always",
94
- named: "never",
95
- asyncArrow: "always",
96
- },
97
- ], // Enforces consistent spacing before function parentheses in TypeScript code, with specific rules for anonymous, named, and async arrow functions
98
- "@typescript-eslint/space-infix-ops": "error", // Enforces spacing around infix operators in TypeScript code
99
- "@typescript-eslint/keyword-spacing": [
100
- "error",
101
- { before: true, after: true },
102
- ], // Enforces consistent spacing before and after keywords in TypeScript code
103
- "@typescript-eslint/comma-spacing": [
104
- "error",
105
- { before: false, after: true },
106
- ], // Enforces consistent spacing before and after commas in TypeScript code
107
- "@typescript-eslint/no-extra-parens": ["error", "functions"], // Reports unnecessary parentheses in TypeScript code, excluding function expressions
108
- "@typescript-eslint/no-dupe-class-members": "error", // Reports duplicate class members in TypeScript code
109
- "@typescript-eslint/no-loss-of-precision": "error", // Reports literal numbers that lose precision in TypeScript code
110
- "@typescript-eslint/lines-between-class-members": [
111
- "error",
112
- "always",
113
- { exceptAfterSingleLine: true },
114
- ], // Requires an empty line between class members in TypeScript code, except after a single-line member
115
- "@typescript-eslint/brace-style": [
116
- "error",
117
- "1tbs",
118
- { allowSingleLine: false },
119
- ],
45
+ "@typescript-eslint/no-redeclare": "error", // Reports redeclaring variables in TypeScript code
46
+ "@typescript-eslint/no-use-before-define": [
47
+ "error",
48
+ { functions: false, classes: false, variables: true },
49
+ ], // Reports using variables before they are defined in TypeScript code (excluding functions and classes)
50
+ "@stylistic/comma-dangle": ["error", "only-multiline"], // Enforces trailing commas in TypeScript arrays and objects, but only in multiline expressions
51
+ "@stylistic/object-curly-spacing": ["error", "always"], // Enforces consistent spacing inside braces for TypeScript objects
52
+ "@stylistic/semi": ["error"], // Enforces the use of semicolons in TypeScript code
53
+ "@stylistic/quotes": ["error", "single"], // Enforces the consistent use of single quotes in TypeScript code
54
+ "@stylistic/space-before-blocks": ["error", "always"], // Enforces consistent spacing before blocks in TypeScript code
55
+ "@stylistic/space-before-function-paren": [
56
+ "error",
57
+ {
58
+ anonymous: "always",
59
+ named: "never",
60
+ asyncArrow: "always",
61
+ },
62
+ ], // Enforces consistent spacing before function parentheses in TypeScript code, with specific rules for anonymous, named, and async arrow functions
63
+ "@stylistic/space-infix-ops": "error", // Enforces spacing around infix operators in TypeScript code
64
+ "@stylistic/keyword-spacing": ["error", { before: true, after: true }], // Enforces consistent spacing before and after keywords in TypeScript code
65
+ "@stylistic/comma-spacing": ["error", { before: false, after: true }], // Enforces consistent spacing before and after commas in TypeScript code
66
+ "@stylistic/no-extra-parens": ["error", "functions"], // Reports unnecessary parentheses in TypeScript code, excluding function expressions
67
+ "@typescript-eslint/no-dupe-class-members": "error", // Reports duplicate class members in TypeScript code
68
+ "@typescript-eslint/no-loss-of-precision": "error", // Reports literal numbers that lose precision in TypeScript code
69
+ "@stylistic/lines-between-class-members": [
70
+ "error",
71
+ "always",
72
+ { exceptAfterSingleLine: true },
73
+ ], // Requires an empty line between class members in TypeScript code, except after a single-line member
74
+ "@stylistic/brace-style": ["error", "1tbs", { allowSingleLine: false }],
120
75
 
121
- // normal
122
- "no-console": ["error", { allow: ["info", "debug", "warn", "error"] }], // Disallows or restricts the use of certain console methods
123
- "prefer-template": "error",
124
- curly: ["error", "all"],
125
- "max-statements-per-line": ["error", { max: 1 }],
76
+ // normal
77
+ "no-console": ["error", { allow: ["info", "debug", "warn", "error"] }], // Disallows or restricts the use of certain console methods
78
+ "prefer-template": "error",
79
+ curly: ["error", "all"],
80
+ "max-statements-per-line": ["error", { max: 1 }],
126
81
 
127
- // off
128
- // TS
129
- "@typescript-eslint/consistent-indexed-object-style": "off", // Enforces consistent usage of index signatures or record types in TypeScript code
130
- "@typescript-eslint/naming-convention": "off", // Enforces naming conventions for variables, functions, classes, etc. in TypeScript code
131
- "@typescript-eslint/explicit-member-accessibility": "off", // Requires explicit accessibility modifiers on class members in TypeScript code
132
- "@typescript-eslint/parameter-properties": "off", // Requires parameter properties to be declared on the constructor in TypeScript code
133
- "@typescript-eslint/interface-name-prefix": "off", // Requires or disallows a prefix for interface names in TypeScript code
134
- "@typescript-eslint/no-empty-interface": "off", // Disallows empty interfaces in TypeScript code
135
- "@typescript-eslint/ban-ts-ignore": "off", // Disallows the use of the '@ts-ignore' comment in TypeScript code
136
- "@typescript-eslint/no-empty-function": "off", // Disallows empty function declarations in TypeScript code
137
- "@typescript-eslint/no-non-null-assertion": "off", // Disallows the use of the non-null assertion operator (!) in TypeScript code
138
- "@typescript-eslint/explicit-module-boundary-types": "off", // Requires explicit return and parameter types on exported functions and methods in TypeScript code
139
- "@typescript-eslint/ban-types": "off", // Disallows specific types in TypeScript code
140
- "@typescript-eslint/triple-slash-reference": "off", // Disallows the use of triple slash reference directives in TypeScript code
82
+ // off
83
+ // TS
84
+ "@typescript-eslint/consistent-indexed-object-style": "off", // Enforces consistent usage of index signatures or record types in TypeScript code
85
+ "@typescript-eslint/naming-convention": "off", // Enforces naming conventions for variables, functions, classes, etc. in TypeScript code
86
+ "@typescript-eslint/explicit-member-accessibility": "off", // Requires explicit accessibility modifiers on class members in TypeScript code
87
+ "@typescript-eslint/parameter-properties": "off", // Requires parameter properties to be declared on the constructor in TypeScript code
88
+ "@typescript-eslint/interface-name-prefix": "off", // Requires or disallows a prefix for interface names in TypeScript code
89
+ "@typescript-eslint/no-empty-interface": "off", // Disallows empty interfaces in TypeScript code
90
+ "@typescript-eslint/ban-ts-ignore": "off", // Disallows the use of the '@ts-ignore' comment in TypeScript code
91
+ "@typescript-eslint/no-empty-function": "off", // Disallows empty function declarations in TypeScript code
92
+ "@typescript-eslint/no-non-null-assertion": "off", // Disallows the use of the non-null assertion operator (!) in TypeScript code
93
+ "@typescript-eslint/explicit-module-boundary-types": "off", // Requires explicit return and parameter types on exported functions and methods in TypeScript code
94
+ "@typescript-eslint/ban-types": "off", // Disallows specific types in TypeScript code
95
+ "@typescript-eslint/triple-slash-reference": "off", // Disallows the use of triple slash reference directives in TypeScript code
141
96
 
142
- // normal
143
- "no-invalid-this": "off", // Disallows using 'this' outside of classes or class-like objects (turned off because the TypeScript rule handles it)
144
- "no-redeclare": "off", // Disallows redeclaring variables (turned off because the TypeScript rule handles it)
145
- "no-use-before-define": "off", // Disallows using variables before they are defined (turned off because the TypeScript rule handles it)
146
- "brace-style": "off", // Enforces consistent brace style for blocks (turned off because the TypeScript rule handles it)
147
- "object-curly-spacing": "off", // Enforces consistent spacing inside braces for objects (turned off because the TypeScript rule handles it)
148
- semi: "off", // Disallows or enforces semicolons (turned off because the TypeScript rule handles it)
149
- quotes: "off", // Enforces the consistent use of either single or double quotes (turned off because the TypeScript rule handles it)
150
- "space-before-blocks": "off", // Enforces consistent spacing before blocks (turned off because the TypeScript rule handles it)
151
- "space-before-function-paren": "off", // Enforces consistent spacing before function parentheses (turned off because the TypeScript rule handles it)
152
- "space-infix-ops": "off", // Enforces spacing around infix operators (turned off because the TypeScript rule handles it)
153
- "keyword-spacing": "off", // Enforces consistent spacing before and after keywords (turned off because the TypeScript rule handles it)
154
- "comma-spacing": "off", // Enforces consistent spacing before and after commas (turned off because the TypeScript rule handles it)
155
- "no-extra-parens": "off", // Disallows unnecessary parentheses (turned off because the TypeScript rule handles it)
156
- "no-dupe-class-members": "off", // Disallows duplicate class members (turned off because the TypeScript rule handles it)
157
- "no-loss-of-precision": "off", // Disallows literal numbers that lose precision (turned off because the TypeScript rule handles it)
158
- "lines-between-class-members": "off", // Requires an empty line between class members (turned off because the TypeScript rule handles it)
97
+ // normal
98
+ "no-invalid-this": "off", // Disallows using 'this' outside of classes or class-like objects (turned off because the TypeScript rule handles it)
99
+ "no-redeclare": "off", // Disallows redeclaring variables (turned off because the TypeScript rule handles it)
100
+ "no-use-before-define": "off", // Disallows using variables before they are defined (turned off because the TypeScript rule handles it)
101
+ "brace-style": "off", // Enforces consistent brace style for blocks (turned off because the TypeScript rule handles it)
102
+ "object-curly-spacing": "off", // Enforces consistent spacing inside braces for objects (turned off because the TypeScript rule handles it)
103
+ semi: "off", // Disallows or enforces semicolons (turned off because the TypeScript rule handles it)
104
+ quotes: "off", // Enforces the consistent use of either single or double quotes (turned off because the TypeScript rule handles it)
105
+ "space-before-blocks": "off", // Enforces consistent spacing before blocks (turned off because the TypeScript rule handles it)
106
+ "space-before-function-paren": "off", // Enforces consistent spacing before function parentheses (turned off because the TypeScript rule handles it)
107
+ "space-infix-ops": "off", // Enforces spacing around infix operators (turned off because the TypeScript rule handles it)
108
+ "keyword-spacing": "off", // Enforces consistent spacing before and after keywords (turned off because the TypeScript rule handles it)
109
+ "comma-spacing": "off", // Enforces consistent spacing before and after commas (turned off because the TypeScript rule handles it)
110
+ "no-extra-parens": "off", // Disallows unnecessary parentheses (turned off because the TypeScript rule handles it)
111
+ "no-dupe-class-members": "off", // Disallows duplicate class members (turned off because the TypeScript rule handles it)
112
+ "no-loss-of-precision": "off", // Disallows literal numbers that lose precision (turned off because the TypeScript rule handles it)
113
+ "lines-between-class-members": "off", // Requires an empty line between class members (turned off because the TypeScript rule handles it)
114
+ },
159
115
  },
160
- };
116
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lenne.tech/eslint-config-angular",
3
- "version": "0.0.15",
3
+ "version": "1.0.1",
4
4
  "description": "ESLint config of lenne.Tech for Angular",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -10,26 +10,23 @@
10
10
  "files": [
11
11
  "index.js"
12
12
  ],
13
+ "type": "module",
13
14
  "scripts": {
14
15
  "watch": "watch 'yalc push --private'"
15
16
  },
16
17
  "peerDependencies": {
17
- "eslint": ">=7.4.0"
18
+ "eslint": ">=9.0.0"
18
19
  },
19
20
  "dependencies": {
20
- "@angular-eslint/builder": "16.1.2",
21
- "@angular-eslint/eslint-plugin": "16.1.2",
22
- "@angular-eslint/eslint-plugin-template": "16.1.2",
23
- "@angular-eslint/schematics": "16.1.2",
24
- "@angular-eslint/template-parser": "16.1.2",
25
- "@typescript-eslint/eslint-plugin": "6.7.0",
26
- "@typescript-eslint/parser": "6.7.0",
27
- "eslint-config-prettier": "9.0.0",
28
- "eslint-plugin-perfectionist": "2.4.2",
21
+ "@typescript-eslint/parser": "8.19.1",
22
+ "@typescript-eslint/eslint-plugin": "8.19.1",
23
+ "@stylistic/eslint-plugin": "2.12.1",
24
+ "eslint-config-prettier": "9.1.0",
25
+ "eslint-plugin-perfectionist": "4.5.0",
29
26
  "functions-have-names": "1.2.3"
30
27
  },
31
28
  "devDependencies": {
32
- "eslint": "8.49.0",
29
+ "eslint": "9.17.0",
33
30
  "watch": "1.0.2"
34
31
  }
35
32
  }