@lenne.tech/eslint-config-angular 0.0.16 → 1.0.2

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