Skip to content

Commit f5282d1

Browse files
author
gokulprasanth-ni
committed
feat: update packages to be compatible with v9
Signed-off-by: gokulprasanth-ni <[email protected]>
1 parent 876d21d commit f5282d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3283
-2713
lines changed

package-lock.json

Lines changed: 1901 additions & 1542 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@
5151
"beachball": "^2.41.0"
5252
},
5353
"peerDependencies": {
54-
"typescript": "~4.8.2"
54+
"typescript": "^5.0.0"
5555
}
5656
}

packages/eslint-config-angular/.eslintrc.js

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import javascript from '@ni/eslint-config-javascript';
2+
3+
export default [
4+
...javascript,
5+
{
6+
files: ['**/*.js'],
7+
rules: {
8+
'import/no-default-export': 'off',
9+
'import/no-extraneous-dependencies': 'off',
10+
'import/no-unresolved': 'off',
11+
},
12+
},
13+
];
Lines changed: 133 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,139 +1,134 @@
1-
module.exports = {
2-
extends: [
3-
'plugin:@angular-eslint/recommended',
4-
'plugin:@angular-eslint/template/process-inline-templates',
5-
'@ni/eslint-config-typescript'
6-
],
7-
rules: {
8-
/*
9-
Overrides to Angular recommended rules:
10-
https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/src/configs/recommended.json
11-
*/
12-
13-
'@angular-eslint/no-host-metadata-property': 'error',
14-
15-
/*
16-
'@angular-eslint/no-input-rename' rule notes:
17-
Disallow renaming directive inputs generally. Use an inline comment to disable the rule for exceptions where the
18-
context changes significantly, or disable the rule for files of directives that need to prefix their inputs to avoid conflicts.
19-
*/
20-
21-
/*
22-
'@angular-eslint/no-output-rename' rule notes:
23-
Disallow renaming directive outputs generally. Use an inline comment to disable the rule for exceptions where the
24-
context changes significantly, or disable the rule for projects that use the dollar sign postfix for EventEmitters.
25-
*/
26-
27-
/*
28-
Upgrade the recommended rule configuration from a warning to an error.
29-
*/
30-
'@angular-eslint/use-lifecycle-interface': 'error',
31-
32-
// We intended to use the default from @typescript-eslint/recommended, but we adopted this override accidentally.
33-
// See https://github.com/ni/javascript-styleguide/issues/139
34-
'@typescript-eslint/no-inferrable-types': [
35-
'error',
36-
{ ignoreParameters: true }
37-
],
38-
39-
/*
40-
Overrides to Angular rules outside of the recommended configuration:
41-
*/
42-
43-
/*
44-
Extract templates and styles into a separate files. In rare cases, allow for inline templates of a few
45-
elements with attributes and three minimal CSS declarations.
46-
*/
47-
'@angular-eslint/component-max-inline-declarations': ['error', { animations: 15, styles: 15, template: 15 }],
48-
49-
/* [application-prefix] */
50-
'@angular-eslint/component-selector': 'off',
51-
52-
'@angular-eslint/contextual-decorator': 'error',
53-
54-
/*
55-
Do not require a directive to select an element or attribute exclusively, because there are valid use cases
56-
for both.
57-
*/
58-
'@angular-eslint/directive-selector': 'off',
59-
60-
'@angular-eslint/no-attribute-decorator': 'error',
61-
62-
/*
63-
`forwardRef` is needed for certain Dependency Injection use cases and abuse is not widespread so its use is permitted.
64-
*/
65-
'@angular-eslint/no-forward-ref': 'off',
66-
67-
/*
68-
We don't yet have a general naming conventions so enforcing a convention just for inputs would be inconsistent.
69-
*/
70-
'@angular-eslint/no-input-prefix': 'off',
71-
72-
'@angular-eslint/no-lifecycle-call': 'error',
73-
74-
'@angular-eslint/no-pipe-impure': 'error',
75-
76-
'@angular-eslint/no-queries-metadata-property': 'error',
77-
78-
/* [application-prefix] */
79-
'@angular-eslint/pipe-prefix': 'error',
80-
81-
/*
82-
This rule is for specific applications such as libraries that want to minimize global dependencies or parts
83-
of an application that have specific performance goals.
84-
*/
85-
'@angular-eslint/prefer-on-push-component-change-detection': 'off',
86-
87-
/*
88-
While marking @Output properties as readonly does better capture the intention of how they should generally be used,
89-
it does not appear that there is wide-spread abuse of not marking @Output properties readonly. Marking them readonly
90-
would deviate from the style given in most Angular docs and examples so this rule is not enabled.
91-
*/
92-
'@angular-eslint/prefer-output-readonly': 'off',
93-
94-
'@angular-eslint/relative-url-prefix': 'error',
95-
96-
'@angular-eslint/runtime-localize': 'error',
97-
98-
/*
99-
Generally not expected in practice to sort NgModule metadata arrays. Projects may enable if desired.
100-
*/
101-
'@angular-eslint/sort-ngmodule-metadata-arrays': 'off',
102-
103-
'@angular-eslint/use-component-selector': 'error',
104-
105-
'@angular-eslint/use-component-view-encapsulation': 'error',
106-
107-
/*
108-
Provide root services with the application root injector in the Injectable decorator. However, NgModule
109-
providers are frequently preferred for non-root, module scoped services in applications where tree-shaking
110-
is usually irrelevant. Additionally, libraries commonly export services from modules in order to manage
111-
dependencies. Consider enabling this rule for libraries to ensure proper tree-shaking when appropriate.
112-
*/
113-
'@angular-eslint/use-injectable-provided-in': 'off'
1+
import typescript from '@ni/eslint-config-typescript';
2+
import angular from 'angular-eslint';
3+
4+
export default [
5+
...angular.configs.tsRecommended,
6+
...typescript,
7+
{
8+
processor: angular.processInlineTemplates,
9+
rules: {
10+
11+
/*
12+
'@angular-eslint/no-input-rename' rule notes:
13+
Disallow renaming directive inputs generally. Use an inline comment to disable the rule for exceptions where the
14+
context changes significantly, or disable the rule for files of directives that need to prefix their inputs to avoid conflicts.
15+
*/
16+
17+
/*
18+
'@angular-eslint/no-output-rename' rule notes:
19+
Disallow renaming directive outputs generally. Use an inline comment to disable the rule for exceptions where the
20+
context changes significantly, or disable the rule for projects that use the dollar sign postfix for EventEmitters.
21+
*/
22+
23+
/*
24+
Upgrade the recommended rule configuration from a warning to an error.
25+
*/
26+
'@angular-eslint/use-lifecycle-interface': 'error',
27+
28+
// We intended to use the default from @typescript-eslint/recommended, but we adopted this override accidentally.
29+
// See https://github.com/ni/javascript-styleguide/issues/139
30+
'@typescript-eslint/no-inferrable-types': [
31+
'error',
32+
{ ignoreParameters: true }
33+
],
34+
35+
/*
36+
Overrides to Angular rules outside of the recommended configuration:
37+
*/
38+
39+
/*
40+
Extract templates and styles into a separate files. In rare cases, allow for inline templates of a few
41+
elements with attributes and three minimal CSS declarations.
42+
*/
43+
'@angular-eslint/component-max-inline-declarations': ['error', { animations: 15, styles: 15, template: 15 }],
44+
45+
/* [application-prefix] */
46+
'@angular-eslint/component-selector': 'off',
47+
48+
'@angular-eslint/contextual-decorator': 'error',
49+
50+
/*
51+
Do not require a directive to select an element or attribute exclusively, because there are valid use cases
52+
for both.
53+
*/
54+
'@angular-eslint/directive-selector': 'off',
55+
56+
'@angular-eslint/no-attribute-decorator': 'error',
57+
58+
/*
59+
`forwardRef` is needed for certain Dependency Injection use cases and abuse is not widespread so its use is permitted.
60+
*/
61+
'@angular-eslint/no-forward-ref': 'off',
62+
63+
/*
64+
We don't yet have a general naming conventions so enforcing a convention just for inputs would be inconsistent.
65+
*/
66+
'@angular-eslint/no-input-prefix': 'off',
67+
68+
'@angular-eslint/no-lifecycle-call': 'error',
69+
70+
'@angular-eslint/no-pipe-impure': 'error',
71+
72+
'@angular-eslint/no-queries-metadata-property': 'error',
73+
74+
/* [application-prefix] */
75+
'@angular-eslint/pipe-prefix': 'error',
76+
77+
/*
78+
This rule is for specific applications such as libraries that want to minimize global dependencies or parts
79+
of an application that have specific performance goals.
80+
*/
81+
'@angular-eslint/prefer-on-push-component-change-detection': 'off',
82+
83+
/*
84+
While marking @Output properties as readonly does better capture the intention of how they should generally be used,
85+
it does not appear that there is wide-spread abuse of not marking @Output properties readonly. Marking them readonly
86+
would deviate from the style given in most Angular docs and examples so this rule is not enabled.
87+
*/
88+
'@angular-eslint/prefer-output-readonly': 'off',
89+
90+
'@angular-eslint/relative-url-prefix': 'error',
91+
92+
'@angular-eslint/runtime-localize': 'error',
93+
94+
/*
95+
Generally not expected in practice to sort NgModule metadata arrays. Projects may enable if desired.
96+
*/
97+
'@angular-eslint/sort-ngmodule-metadata-arrays': 'off',
98+
99+
'@angular-eslint/use-component-selector': 'error',
100+
101+
'@angular-eslint/use-component-view-encapsulation': 'error',
102+
103+
/*
104+
Provide root services with the application root injector in the Injectable decorator. However, NgModule
105+
providers are frequently preferred for non-root, module scoped services in applications where tree-shaking
106+
is usually irrelevant. Additionally, libraries commonly export services from modules in order to manage
107+
dependencies. Consider enabling this rule for libraries to ensure proper tree-shaking when appropriate.
108+
*/
109+
'@angular-eslint/use-injectable-provided-in': 'off'
110+
}
111+
},
112+
{
113+
files: ['**/*.spec.ts'],
114+
rules: {
115+
/*
116+
Tests often define helper components and it improves test readability if they are in the same
117+
file as the tests.
118+
*/
119+
'@angular-eslint/component-max-inline-declarations': 'off',
120+
121+
/*
122+
Components defined in tests are typically only used within a single test file so don't need.
123+
a compontent selector.
124+
*/
125+
'@angular-eslint/use-component-selector': 'off',
126+
127+
/*
128+
Tests often define additional classes as mocks or helper components and it improves test readability
129+
if those are in the same file as the tests.
130+
*/
131+
'max-classes-per-file': 'off'
132+
}
114133
},
115-
overrides: [
116-
{
117-
files: ['*.spec.ts'],
118-
rules: {
119-
/*
120-
Tests often define helper components and it improves test readability if they are in the same
121-
file as the tests.
122-
*/
123-
'@angular-eslint/component-max-inline-declarations': 'off',
124-
125-
/*
126-
Components defined in tests are typically only used within a single test file so don't need.
127-
a compontent selector.
128-
*/
129-
'@angular-eslint/use-component-selector': 'off',
130-
131-
/*
132-
Tests often define additional classes as mocks or helper components and it improves test readability
133-
if those are in the same file as the tests.
134-
*/
135-
'max-classes-per-file': 'off'
136-
}
137-
},
138-
]
139-
};
134+
];
Lines changed: 43 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,45 @@
11
{
2-
"name": "@ni/eslint-config-angular",
3-
"version": "9.0.6",
4-
"description": "NI's Angular ESLint Shareable Config",
5-
"main": "index.js",
6-
"scripts": {
7-
"lint": "eslint .",
8-
"pack": "npm pack",
9-
"print-available-rules": "node tools/print-available-rules"
10-
},
11-
"repository": {
12-
"type": "git",
13-
"url": "git+https://github.com/ni/javascript-styleguide.git"
14-
},
15-
"keywords": [
16-
"eslint",
17-
"eslintconfig",
18-
"ni"
19-
],
20-
"author": "National Instruments",
21-
"license": "MIT",
22-
"bugs": {
23-
"url": "https://github.com/ni/javascript-styleguide/issues"
24-
},
25-
"homepage": "https://github.com/ni/javascript-styleguide#readme",
26-
"publishConfig": {
27-
"access": "public"
28-
},
29-
"files": [
30-
"**/*.js",
31-
"!/.*.js",
32-
"!/tools"
33-
],
34-
"peerDependencies": {
35-
"@angular-eslint/builder": "^18.4.3",
36-
"@angular-eslint/eslint-plugin": "^18.4.3",
37-
"@angular-eslint/eslint-plugin-template": "^18.4.3",
38-
"@angular-eslint/schematics": "^18.4.3",
39-
"@angular-eslint/template-parser": "^18.4.3",
40-
"@ni/eslint-config-typescript": "^4.4.3"
41-
}
2+
"type": "module",
3+
"name": "@ni/eslint-config-angular",
4+
"version": "9.0.6",
5+
"description": "NI's Angular ESLint Shareable Config",
6+
"main": "index.js",
7+
"scripts": {
8+
"lint": "eslint .",
9+
"pack": "npm pack",
10+
"print-available-rules": "node tools/print-available-rules"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "git+https://github.com/ni/javascript-styleguide.git"
15+
},
16+
"keywords": [
17+
"eslint",
18+
"eslintconfig",
19+
"ni"
20+
],
21+
"author": "National Instruments",
22+
"license": "MIT",
23+
"bugs": {
24+
"url": "https://github.com/ni/javascript-styleguide/issues"
25+
},
26+
"homepage": "https://github.com/ni/javascript-styleguide#readme",
27+
"publishConfig": {
28+
"access": "public"
29+
},
30+
"files": [
31+
"**/*.js",
32+
"!/.*.js",
33+
"!/tools"
34+
],
35+
"peerDependencies": {
36+
"angular-eslint": "^19.0.0",
37+
"@ni/eslint-config-typescript": "file:../eslint-config-typescript"
38+
},
39+
"exports": {
40+
".": "./index.js",
41+
"./template": "./template.js",
42+
"./requiring-type-checking": "./requiring-type-checking.js",
43+
"./template/options": "./template/options.js"
44+
}
4245
}

0 commit comments

Comments
 (0)