Skip to content

Commit

Permalink
add eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
Clinton Werth authored and Clinton Werth committed Jan 3, 2025
1 parent 6030daf commit 32512f9
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions web-app/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [...compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
).map(config => ({
...config,
files: ["**/*.ts"],
})), {
files: ["**/*.ts"],

languageOptions: {
ecmaVersion: 5,
sourceType: "script",

parserOptions: {
project: ["tsconfig.app.json", "tsconfig.spec.json"],
createDefaultProgram: true,
},
},

rules: {
"@angular-eslint/directive-selector": ["error", {
type: "attribute",
prefix: "app",
style: "camelCase",
}],

"@angular-eslint/component-selector": ["error", {
type: "element",
prefix: "app",
style: "kebab-case",
}],
},
}, ...compat.extends("plugin:@angular-eslint/template/recommended").map(config => ({
...config,
files: ["**/*.html"],
})), {
files: ["**/*.html"],
rules: {},
}];

0 comments on commit 32512f9

Please sign in to comment.