67 lines
2 KiB
JavaScript
67 lines
2 KiB
JavaScript
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
import { FlatCompat } from '@eslint/eslintrc';
|
|
import js from '@eslint/js';
|
|
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
|
import htmlEslint from '@html-eslint/eslint-plugin';
|
|
import tsParser from '@typescript-eslint/parser';
|
|
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
import globals from 'globals';
|
|
|
|
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/app/core/server'],
|
|
},
|
|
...compat.extends('eslint:recommended', 'plugin:@typescript-eslint/strict'),
|
|
{
|
|
plugins: {
|
|
'simple-import-sort': simpleImportSort,
|
|
'@typescript-eslint': typescriptEslint,
|
|
'@html-eslint': htmlEslint,
|
|
},
|
|
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.browser,
|
|
},
|
|
|
|
parser: tsParser,
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
},
|
|
|
|
rules: {
|
|
indent: ['error', 4],
|
|
'linebreak-style': ['error', 'unix'],
|
|
quotes: ['error', 'single'],
|
|
semi: ['error', 'always'],
|
|
strict: 'error',
|
|
'array-bracket-newline': 'error',
|
|
yoda: 'error',
|
|
|
|
'@typescript-eslint/array-type': [
|
|
'error',
|
|
{
|
|
default: 'generic',
|
|
},
|
|
],
|
|
|
|
'@typescript-eslint/ban-tslint-comment': 'off',
|
|
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
'@typescript-eslint/no-extraneous-class': 'off',
|
|
'simple-import-sort/imports': 'error',
|
|
'simple-import-sort/exports': 'error',
|
|
'no-mixed-spaces-and-tabs': 'off',
|
|
'@html-eslint/no-inline-styles': 'error'
|
|
},
|
|
},
|
|
];
|