Linting for my angular 10 project is failing wheh running ng lint
node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng lint
It failed with return code 1 and says:
Schema validation failed with the following errors:
Data path "" should have required property 'lintFilePatterns'.
It still lints the files, and prints warnings and errors to the console. But I want to integrate this to into our CI at some point.
Below is my angular.json lint configuration as well as my eslint config
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
},
"configurations": {
"dev": {
"builder": "@angular-eslint/builder:lint",
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
}
}
}
And eslintrc.js
module.exports = {
"root": true,
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json",
"e2e/tsconfig.json"
],
"createDefaultProgram": true,
"tsconfigRootDir": __dirname,
},
"extends": [
"plugin:@angular-eslint/recommended",
// This is required if you use inline templates in Components
"plugin:@angular-eslint/template/process-inline-templates",
'plugin:@typescript-eslint/recommended',
],
"rules": {
/**
* Any TypeScript source code (NOT TEMPLATE) related rules you wish to use/reconfigure over and above the
* recommended set provided by the @angular-eslint project would go here.
*/
"@angular-eslint/directive-selector": [
"error",
{ "type": "attribute", "prefix": "app", "style": "camelCase" }
],
"@angular-eslint/component-selector": [
"error",
{ "type": "element", "prefix": "app", "style": "kebab-case" }
]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended"],
"rules": {
/**
* Any template/HTML related rules you wish to use/reconfigure over and above the
* recommended set provided by the @angular-eslint project would go here.
*/
}
}
]
}
Appreciate any help
After a successful upgrade, while preparing a build, it gives the following error. Data path "should NOT have additional properties (extracts). Option 1. Just remove the "extractCss": true from your production environment, it will resolve the problem. The reason for it is extractCss is deprecated, and its value is true by default.
[ng] Data path "" should NOT have additional properties (es5BrowserSupport). [ERROR] ng has unexpectedly closed (exit code 1). Sorry, something went wrong. For anyone having this problem while updating Ionic from 3 to 4: I had to remove "es5BrowserSupport": true from angular.json
Cannot find "lint" target for the specified project. You should add a package that implements linting capabilities Schema validation failed with the following errors: Data path "" must have required property 'lintFilePatterns'. Both errors can be fixed with proper configuration of your angular.json.
Try replacing or editing the "lint" block in your angular.json file with
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"eslintConfig": ".eslintrc.json",
"lintFilePatterns": ["**/*.spec.ts", "**/*.ts"]
}
}
Or wherever your eslint config file is stored.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With