add eslint

This commit is contained in:
2025-02-23 20:38:00 -05:00
parent 57c7a44256
commit 9ca074ab4e
4 changed files with 1766 additions and 4 deletions

View File

@@ -95,8 +95,22 @@
], ],
"scripts": [] "scripts": []
} }
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
} }
} }
} }
},
"cli": {
"schematicCollections": [
"angular-eslint"
]
} }
} }

50
eslint.config.js Normal file
View File

@@ -0,0 +1,50 @@
// @ts-check
const eslint = require("@eslint/js");
const tseslint = require("typescript-eslint");
const angular = require("angular-eslint");
module.exports = tseslint.config(
{
files: ["**/*.ts"],
extends: [
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
...angular.configs.tsRecommended,
],
processor: angular.processInlineTemplates,
rules: {
"@angular-eslint/directive-selector": [
"error",
{
type: "attribute",
prefix: "app",
style: "camelCase",
},
],
"@angular-eslint/component-selector": [
"error",
{
type: "element",
prefix: "app",
style: "kebab-case",
},
],
'@typescript-eslint/no-explicit-any': ['off'],
'@typescript-eslint/member-ordering': 0,
'@typescript-eslint/naming-convention': 0,
'@angular-eslint/no-host-metadata-property': 'off',
'@angular-eslint/no-output-on-prefix': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
},
},
{
files: ["**/*.html"],
extends: [
...angular.configs.templateRecommended,
...angular.configs.templateAccessibility,
],
rules: {},
}
);

1696
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,8 @@
"start": "ng serve", "start": "ng serve",
"build": "ng build", "build": "ng build",
"watch": "ng build --watch --configuration development", "watch": "ng build --watch --configuration development",
"test": "ng test" "test": "ng test",
"lint": "ng lint"
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
@@ -27,12 +28,15 @@
"@angular/cli": "^19.1.8", "@angular/cli": "^19.1.8",
"@angular/compiler-cli": "^19.1.0", "@angular/compiler-cli": "^19.1.0",
"@types/jasmine": "~5.1.0", "@types/jasmine": "~5.1.0",
"angular-eslint": "19.1.0",
"eslint": "^9.20.0",
"jasmine-core": "~5.5.0", "jasmine-core": "~5.5.0",
"karma": "~6.4.0", "karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0", "karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0", "karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0", "karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0", "karma-jasmine-html-reporter": "~2.1.0",
"typescript": "~5.7.2" "typescript": "~5.7.2",
"typescript-eslint": "8.23.0"
} }
} }