Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 58 additions & 100 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,101 +1,59 @@
import rxjs from "eslint-plugin-rxjs-x";
import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
import tseslint from "@typescript-eslint/eslint-plugin";

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/framework/**/*",
],
}, ...compat.extends(
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates",
"eslint-config-prettier",
).map(config => ({
...config,
files: ["**/*.ts"],
})), {
files: ["**/*.ts"],

plugins: {
rxjs,
"@typescript-eslint": tseslint,
},

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

parserOptions: {
project: ["tsconfig.json", "e2e/tsconfig.json"],
createDefaultProgram: true,
},
import eslint from '@eslint/js';
import { defineConfig } from 'eslint/config';
import rxjsX from 'eslint-plugin-rxjs-x';
import angular from 'angular-eslint';
import tseslint from 'typescript-eslint';
import eslintConfigPrettier from 'eslint-config-prettier/flat';

export default defineConfig({
files: ['**/*.ts'],
linterOptions: {
reportUnusedInlineConfigs: 'warn',
},
extends: [
eslint.configs.recommended,
...tseslint.configs.recommended,
...angular.configs.tsRecommended,
rxjsX.configs.recommended,
eslintConfigPrettier,
],
processor: angular.processInlineTemplates,
plugins: {
'@typescript-eslint': tseslint.plugin,
'@angular-eslint': angular.tsPlugin,
},
ignores: [
'src/framework/**/*',
],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},

rules: {
quotes: "off",
"dot-notation": "off",
"no-restricted-globals": ["error", "fit", "fdescribe"],
"@typescript-eslint/dot-notation": "error",
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error",
"no-underscore-dangle": "off",
"@typescript-eslint/consistent-type-definitions": "error",
"@angular-eslint/prefer-standalone": "off",
"@angular-eslint/prefer-inject": "off",

"rxjs/no-unsafe-takeuntil": ["error", {
allow: [
"count",
"defaultIfEmpty",
"endWith",
"every",
"finalize",
"finally",
"isEmpty",
"last",
"max",
"min",
"publish",
"publishBehavior",
"publishLast",
"publishReplay",
"reduce",
"share",
"shareReplay",
"skipLast",
"takeLast",
"throwIfEmpty",
"toArray",
],
}],
},
}, ...compat.extends("plugin:@angular-eslint/template/recommended", "eslint-config-prettier").map(config => ({
...config,
files: ["**/*.html"],
})), {
files: ["**/*.html"],
rules: {},
}, {
files: ["./*.js"],

languageOptions: {
globals: {
...globals.node,
},

ecmaVersion: 11,
sourceType: "commonjs",
},
}];
},
rules: {
'no-restricted-globals': ['error', 'fit', 'fdescribe'],
'dot-notation': 'off',
'@typescript-eslint/dot-notation': 'error',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/consistent-type-definitions': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@angular-eslint/prefer-standalone': 'off',
'@angular-eslint/prefer-inject': 'off',

'rxjs-x/no-implicit-any-catch': 'off',
'rxjs-x/no-sharereplay': 'off',
'rxjs-x/no-unsafe-takeuntil': 'error',
},
},
{
files: ['**/*.component.html'],
extends: [
...angular.configs.templateRecommended,
],
});
Loading
Loading