-
-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support eslint new configuration style "flat file" #1280
Comments
Seems like I forgot to mention why I want to use the new flat config style. This is because it would help a lot to configure the rule Right now my {
"root": true,
"overrides": [
{
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended"],
"rules": {
"@angular-eslint/template/i18n": [
"error",
{
"checkId": false,
"ignoreAttributes": [
"formArrayName",
"formControlName",
"formGroupName",
// ... suuuuuper long list of default values truncated for sake of brevity
"my-single-custom-attribute-that-should-not-be-i18n-ed"
]
}
]
}
}
]
} But with flat config file, I would avoid the trouble of keeping the list of default value up to date, and instead use: import {i18nDefaultConfiguration} from '@angular-eslint/eslint-plugin-template';
export default [
{
files: ["*.html"],
rules: {
"@angular-eslint/template/i18n": [
"error",
{
"checkId": false,
"ignoreAttributes": [
...i18nDefaultConfiguration.ignoreAttributes,
"my-single-custom-attribute-that-should-not-be-i18n-ed"
]
}
]
}
}
] |
+1 for that feature. Also I use this rule for marking untranslated strings but not use native angular i18n feature. Prefer to using |
v16 is now the latest release and |
I am using Angular 16 and am trying to upgrade to use the new ESLint flat config files. I have a monorepo where each project extends a base config file, and the non-Angular projects are working just fine. In my Angular project I have this at import tseslint from "typescript-eslint";
import baseAngularConfig from "../shared/ide-configs/eslint-angular.config.mjs";
export default tseslint.config(
...baseAngularConfig,
{
files: ["**/*.ts"],
languageOptions: {
parserOptions: {
project: ["./tsconfig.app.json", "./tsconfig.spec.json"],
},
},
},
{
files: ["**/*.html"],
languageOptions: {
parserOptions: {
project: ["./tsconfig.app.json", "./tsconfig.spec.json"],
},
},
},
); when I run
When I move the config file to the If I open the
Ok, so now it can see the file but I have to mark my project as a module, so I add
ok, so let's change this to a
I just can't win here. Is this a limitation of Angular v16 that v17 has fixed? |
I'm running into the exact same issue. Troubling, as it seems that from eslint version 9 they encourage using the new flat config format. |
Same here. The automatic eslint migration created an |
Just ran
Has the end of year 2023 been postponed? Or is there something I am missing?
|
The eslintConfig file is now specified in angular.json However angular-eslint/angular-eslint#1280 remains
More eslint rules were activated and the problem of inline warnings inside VSCode was fixed. However the update to the new "flat" config was reverted due to angular-eslint/angular-eslint#1280 (comment) Some strict null check issues were addressed. But the check is disabled because it would require a major refactoring of the solver logic.
I have managed upgrade one of my angular project to eslint 9.0's new config format, please reffer beginor/net-core-app-client, but I think there is no any convert tools yet. |
Description and reproduction of the issue
In a brand new project, I would like to use eslint new configuration style "flat file". This does not to work when running through
ng lint
, as shown with reproduction step below.I am assuming there is something in
@angular-eslint/builder
that should be updated to support that new config style, but I might be wrong...Content of
eslint.config.js
, straight from the documentation:And the error output would be:
Moving
eslint.config.js
intomy-app/src/app/
will not change anything at all.Versions
@angular-eslint/builder
15.2.0
ESLint
8.32.0
node
16.19.0
ng version
output per the instructions given here.The text was updated successfully, but these errors were encountered: