72 lines
1.6 KiB
JavaScript
72 lines
1.6 KiB
JavaScript
import { FlatCompat } from '@eslint/eslintrc';
|
|
import js from '@eslint/js';
|
|
import nxEslintPlugin from '@nx/eslint-plugin';
|
|
import { dirname } from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
|
|
const compat = new FlatCompat({
|
|
baseDirectory: dirname(fileURLToPath(import.meta.url)),
|
|
recommendedConfig: js.configs.recommended,
|
|
});
|
|
|
|
export default [
|
|
{
|
|
ignores: ['**/dist'],
|
|
},
|
|
{ plugins: { '@nx': nxEslintPlugin } },
|
|
{
|
|
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
|
|
rules: {
|
|
'@angular-eslint/no-input-rename': 'off',
|
|
'@nx/enforce-module-boundaries': [
|
|
'error',
|
|
{
|
|
enforceBuildableLibDependency: true,
|
|
allow: [],
|
|
depConstraints: [
|
|
{
|
|
sourceTag: '*',
|
|
onlyDependOnLibsWithTags: ['*'],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
...compat
|
|
.config({
|
|
extends: ['plugin:@nx/typescript'],
|
|
})
|
|
.map((config) => ({
|
|
...config,
|
|
files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],
|
|
rules: {
|
|
...config.rules,
|
|
},
|
|
})),
|
|
...compat
|
|
.config({
|
|
extends: ['plugin:@nx/javascript'],
|
|
})
|
|
.map((config) => ({
|
|
...config,
|
|
files: ['**/*.js', '**/*.jsx', '**/*.cjs', '**/*.mjs'],
|
|
rules: {
|
|
...config.rules,
|
|
},
|
|
})),
|
|
...compat
|
|
.config({
|
|
env: {
|
|
jest: true,
|
|
},
|
|
})
|
|
.map((config) => ({
|
|
...config,
|
|
files: ['**/*.spec.ts', '**/*.spec.tsx', '**/*.spec.js', '**/*.spec.jsx'],
|
|
rules: {
|
|
...config.rules,
|
|
},
|
|
})),
|
|
];
|