Skip to content

Commit

Permalink
Merge pull request #2156 from fecgov/feature/eslint-update
Browse files Browse the repository at this point in the history
Feature/1549 - Update ESlint
  • Loading branch information
toddlees authored Sep 20, 2024
2 parents b270bb0 + 59d32b5 commit 2d8c857
Show file tree
Hide file tree
Showing 11 changed files with 858 additions and 2,325 deletions.
56 changes: 0 additions & 56 deletions front-end/.eslintrc.json

This file was deleted.

70 changes: 70 additions & 0 deletions front-end/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
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 [
{
ignores: ['src/**/*.png', 'src/**/*.json', 'src/**/*.scss', 'src/**/*.woff', 'src/**/*.svg'],
},
...compat
.extends(
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@angular-eslint/recommended',
'plugin:@angular-eslint/template/process-inline-templates',
)
.map((config) => ({
...config,
files: ['**/*.ts'],
})),
{
files: ['**/*.ts'],

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

parserOptions: {
project: ['tsconfig.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: {},
},
];
Loading

0 comments on commit 2d8c857

Please sign in to comment.