Skip to content

Commit 6b81ab0

Browse files
authored
build(deps-dev): migrate to eslint-config-toolkit (#250)
1 parent c124cb1 commit 6b81ab0

16 files changed

Lines changed: 6015 additions & 7423 deletions

bin/cli.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const {
3333
) {
3434
return 'Only "loader" and "tsconfig" options can be used with "standalone".';
3535
}
36+
3637
return true;
3738
})
3839
.option('e', {
@@ -126,6 +127,7 @@ OPTIONS._set = {
126127
},
127128
isCreateTsConfig: function () {
128129
const isBaseTsConfig = typeof baseTsConfig === 'string';
130+
129131
return (loader === 'ts' && isBaseTsConfig) || isBaseTsConfig;
130132
},
131133
isCreateTsConfigOnly: function () {
@@ -134,6 +136,7 @@ OPTIONS._set = {
134136
return false;
135137
}
136138
const isBaseTsConfig = typeof baseTsConfig === 'string';
139+
137140
return (loader !== 'ts' && isBaseTsConfig) || false;
138141
},
139142
isMergeTsConfig: function () {

eslint.config.mjs

Lines changed: 6 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
1-
import { join } from 'node:path';
2-
import { includeIgnoreFile } from '@eslint/compat';
3-
import eslintPluginJs from '@eslint/js';
4-
import importPlugin from 'eslint-plugin-import';
5-
import jestPlugin from 'eslint-plugin-jest';
6-
import jsdocPlugin from 'eslint-plugin-jsdoc';
7-
import nodePlugin from 'eslint-plugin-n';
8-
import prettierPlugin from 'eslint-plugin-prettier/recommended';
1+
import { node, jest } from '@cdcabrera/eslint-config-toolkit';
92

103
export default [
11-
includeIgnoreFile(join(process.cwd(), '.gitignore')),
12-
jestPlugin.configs['flat/recommended'],
13-
jsdocPlugin.configs['flat/recommended'],
14-
nodePlugin.configs['flat/recommended'],
15-
importPlugin.flatConfigs.recommended,
16-
eslintPluginJs.configs.recommended,
17-
prettierPlugin,
4+
...node,
5+
...jest,
186
{
19-
ignores: ['src/__fixtures__/**/*'],
207
languageOptions: {
218
globals: {
229
cleanConfigurationPaths: 'readonly',
@@ -26,67 +13,11 @@ export default [
2613
removeFixture: 'readonly',
2714
setMockResourceFunctions: 'readonly',
2815
tempFixturePath: 'readonly'
29-
},
30-
ecmaVersion: 2022
16+
}
3117
},
3218
rules: {
33-
'arrow-parens': ['error', 'as-needed'],
34-
'comma-dangle': 0,
35-
'consistent-return': 1,
36-
'jsdoc/no-undefined-types': 2,
37-
'jsdoc/no-defaults': 0,
38-
'jsdoc/require-jsdoc': 2,
39-
'jsdoc/require-param': 2,
40-
'jsdoc/require-param-description': 0,
41-
'jsdoc/require-param-name': 2,
42-
'jsdoc/require-param-type': 2,
43-
'jsdoc/require-property': 2,
44-
'jsdoc/require-property-description': 0,
45-
'jsdoc/require-property-name': 2,
46-
'jsdoc/require-property-type': 2,
47-
'jsdoc/require-returns': 2,
48-
'jsdoc/require-returns-description': 0,
49-
'jsdoc/require-returns-type': 2,
50-
'jsdoc/tag-lines': [
51-
'warn',
52-
'always',
53-
{
54-
count: 0,
55-
applyToEndTag: false,
56-
startLines: 1
57-
}
58-
],
59-
'max-len': [
60-
'error',
61-
{
62-
code: 240,
63-
ignoreUrls: true
64-
}
65-
],
66-
'n/no-unsupported-features/es-syntax': 1,
67-
'n/shebang': 0,
68-
'n/no-unpublished-bin': 0,
69-
'no-console': 0,
70-
'no-debugger': 1,
71-
'no-plusplus': 0,
72-
'no-unused-vars': [
73-
'error',
74-
{
75-
caughtErrors: 'none'
76-
}
77-
],
78-
'no-unsafe-optional-chaining': 1,
79-
'no-var': 2,
80-
'padded-blocks': 0,
81-
'prettier/prettier': [
82-
'error',
83-
{
84-
arrowParens: 'avoid',
85-
singleQuote: true,
86-
trailingComma: 'none',
87-
printWidth: 120
88-
}
89-
]
19+
'@stylistic/quotes': [2, 'single', { avoidEscape: true, allowTemplateLiterals: true }],
20+
'import/no-dynamic-require': 0
9021
}
9122
}
9223
];

0 commit comments

Comments
 (0)