Skip to content

Commit

Permalink
chore(eslint): move to flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
temarusanov committed Sep 26, 2023
1 parent 7374cd0 commit 0b74307
Show file tree
Hide file tree
Showing 21 changed files with 793 additions and 265 deletions.
52 changes: 0 additions & 52 deletions .eslintrc.json

This file was deleted.

10 changes: 0 additions & 10 deletions apps/api-e2e/.eslintrc.json

This file was deleted.

13 changes: 13 additions & 0 deletions apps/api-e2e/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const baseConfig = require('../../eslint.config.js');
module.exports = [
...baseConfig,
{
files: [
'apps/api-e2e/**/*.ts',
'apps/api-e2e/**/*.tsx',
'apps/api-e2e/**/*.js',
'apps/api-e2e/**/*.jsx',
],
rules: {},
},
];
18 changes: 0 additions & 18 deletions apps/api/.eslintrc.json

This file was deleted.

21 changes: 21 additions & 0 deletions apps/api/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const baseConfig = require('../../eslint.config.js');
module.exports = [
...baseConfig,
{
files: [
'apps/api/**/*.ts',
'apps/api/**/*.tsx',
'apps/api/**/*.js',
'apps/api/**/*.jsx',
],
rules: {},
},
{
files: ['apps/api/**/*.ts', 'apps/api/**/*.tsx'],
rules: {},
},
{
files: ['apps/api/**/*.js', 'apps/api/**/*.jsx'],
rules: {},
},
];
18 changes: 0 additions & 18 deletions apps/gateway/.eslintrc.json

This file was deleted.

21 changes: 21 additions & 0 deletions apps/gateway/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const baseConfig = require('../../eslint.config.js');
module.exports = [
...baseConfig,
{
files: [
'apps/gateway/**/*.ts',
'apps/gateway/**/*.tsx',
'apps/gateway/**/*.js',
'apps/gateway/**/*.jsx',
],
rules: {},
},
{
files: ['apps/gateway/**/*.ts', 'apps/gateway/**/*.tsx'],
rules: {},
},
{
files: ['apps/gateway/**/*.js', 'apps/gateway/**/*.jsx'],
rules: {},
},
];
59 changes: 59 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
const { FlatCompat } = require('@eslint/eslintrc');
const nxEslintPlugin = require('@nx/eslint-plugin');
const eslintPluginSimpleImportSort = require('eslint-plugin-simple-import-sort');
const js = require('@eslint/js');
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
});
module.exports = [
{
plugins: {
'@nx': nxEslintPlugin,
'simple-import-sort': eslintPluginSimpleImportSort,
},
},
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
rules: {
'@nx/dependency-checks': 'error',
'@nx/enforce-module-boundaries': [
'error',
{
enforceBuildableLibDependency: true,
allow: [],
depConstraints: [
{
sourceTag: '*',
onlyDependOnLibsWithTags: ['*'],
},
],
},
],
},
},
...compat.config({ extends: ['plugin:@nx/typescript'] }).map((config) => ({
...config,
files: ['**/*.ts', '**/*.tsx'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'simple-import-sort/imports': 'warn',
'simple-import-sort/exports': 'warn',
},
})),
...compat.config({ extends: ['plugin:@nx/javascript'] }).map((config) => ({
...config,
files: ['**/*.js', '**/*.jsx'],
rules: {},
})),
...compat.config({ env: { jest: true } }).map((config) => ({
...config,
files: ['**/*.spec.ts', '**/*.spec.tsx', '**/*.spec.js', '**/*.spec.jsx'],
rules: {},
})),
...compat.config({ parser: 'jsonc-eslint-parser' }).map((config) => ({
...config,
files: ['**/*.json'],
rules: {},
})),
];
18 changes: 0 additions & 18 deletions libs/external/health-checks/.eslintrc.json

This file was deleted.

27 changes: 27 additions & 0 deletions libs/external/health-checks/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const baseConfig = require('../../../eslint.config.js');
module.exports = [
...baseConfig,
{
files: [
'libs/external/health-checks/**/*.ts',
'libs/external/health-checks/**/*.tsx',
'libs/external/health-checks/**/*.js',
'libs/external/health-checks/**/*.jsx',
],
rules: {},
},
{
files: [
'libs/external/health-checks/**/*.ts',
'libs/external/health-checks/**/*.tsx',
],
rules: {},
},
{
files: [
'libs/external/health-checks/**/*.js',
'libs/external/health-checks/**/*.jsx',
],
rules: {},
},
];
18 changes: 0 additions & 18 deletions libs/external/logger/.eslintrc.json

This file was deleted.

21 changes: 21 additions & 0 deletions libs/external/logger/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const baseConfig = require('../../../eslint.config.js');
module.exports = [
...baseConfig,
{
files: [
'libs/external/logger/**/*.ts',
'libs/external/logger/**/*.tsx',
'libs/external/logger/**/*.js',
'libs/external/logger/**/*.jsx',
],
rules: {},
},
{
files: ['libs/external/logger/**/*.ts', 'libs/external/logger/**/*.tsx'],
rules: {},
},
{
files: ['libs/external/logger/**/*.js', 'libs/external/logger/**/*.jsx'],
rules: {},
},
];
18 changes: 0 additions & 18 deletions libs/external/nats/.eslintrc.json

This file was deleted.

21 changes: 21 additions & 0 deletions libs/external/nats/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const baseConfig = require('../../../eslint.config.js');
module.exports = [
...baseConfig,
{
files: [
'libs/external/nats/**/*.ts',
'libs/external/nats/**/*.tsx',
'libs/external/nats/**/*.js',
'libs/external/nats/**/*.jsx',
],
rules: {},
},
{
files: ['libs/external/nats/**/*.ts', 'libs/external/nats/**/*.tsx'],
rules: {},
},
{
files: ['libs/external/nats/**/*.js', 'libs/external/nats/**/*.jsx'],
rules: {},
},
];
25 changes: 0 additions & 25 deletions libs/external/schematics/.eslintrc.json

This file was deleted.

Loading

0 comments on commit 0b74307

Please sign in to comment.