Skip to content

Commit 96819d1

Browse files
committed
refactor: extract eslint & prettier configs to pkg
Signed-off-by: Andres Correa Casablanca <castarco@coderspirit.xyz>
1 parent 9e30c24 commit 96819d1

File tree

5 files changed

+33
-51
lines changed

5 files changed

+33
-51
lines changed

.eslintrc.cjs

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
module.exports = {
24
root: true,
35
env: {
@@ -12,56 +14,15 @@ module.exports = {
1214
project: ['./tsconfig.json'],
1315
},
1416
plugins: [
15-
'@typescript-eslint',
16-
'import',
17-
'prettier',
1817
'react-refresh',
19-
'sonarjs',
20-
'unicorn',
2118
],
2219
extends: [
23-
'eslint:recommended',
24-
'plugin:@typescript-eslint/strict-type-checked',
25-
'plugin:@typescript-eslint/stylistic-type-checked',
26-
'plugin:import/recommended',
27-
'plugin:import/typescript',
20+
'@coderspirit',
2821
'plugin:react/recommended',
2922
'plugin:react/jsx-runtime',
3023
'plugin:react-hooks/recommended',
31-
"plugin:sonarjs/recommended",
3224
'plugin:storybook/recommended',
33-
'plugin:unicorn/recommended',
34-
'prettier',
3525
],
36-
rules: {
37-
// Base ESLint rules
38-
'curly': 'error',
39-
'sort-imports': 'error',
40-
41-
// TypeScript-related rules
42-
'@typescript-eslint/consistent-type-exports': 'error',
43-
'@typescript-eslint/consistent-type-imports': 'error',
44-
"@typescript-eslint/explicit-function-return-type": "error",
45-
"@typescript-eslint/explicit-member-accessibility": "error",
46-
"@typescript-eslint/explicit-module-boundary-types": "error",
47-
"@typescript-eslint/no-import-type-side-effects": "error",
48-
'@typescript-eslint/no-misused-promises': 'error',
49-
"@typescript-eslint/no-unnecessary-qualifier": "error",
50-
"@typescript-eslint/prefer-readonly": "error",
51-
"@typescript-eslint/prefer-readonly-parameter-types": "error",
52-
"@typescript-eslint/promise-function-async": "error",
53-
"@typescript-eslint/require-array-sort-compare": "error",
54-
"@typescript-eslint/sort-type-constituents": "error",
55-
"@typescript-eslint/switch-exhaustiveness-check": "error",
56-
"no-shadow": "off", // replaced by @typescript-eslint/no-shadow
57-
"@typescript-eslint/no-shadow": "error",
58-
"no-return-await": "off", // replaced by @typescript-eslint/return-await
59-
"@typescript-eslint/return-await": "error",
60-
61-
// Unicorn Rules
62-
'unicorn/filename-case': 'off',
63-
'unicorn/prevent-abbreviations': 'off',
64-
},
6526
settings: {
6627
react: {
6728
version: 'detect'

.prettierrc.mjs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
const config = {
2-
semi: false,
3-
singleQuote: true,
4-
parser: 'typescript',
5-
trailingComma: 'all',
6-
options: {
7-
editorconfig: true
8-
},
9-
}
1+
import config from '@coderspirit/eslint-config/prettier'
102

113
export default config

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"test:watch": "vitest"
3939
},
4040
"devDependencies": {
41+
"@coderspirit/eslint-config": "1.0.0",
4142
"@rollup/plugin-commonjs": "^25.0.4",
4243
"@rollup/plugin-node-resolve": "^15.1.0",
4344
"@rollup/plugin-terser": "^0.4.3",

pnpm-lock.yaml

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tsconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
"skipLibCheck": true
4444
},
4545
"exclude": [
46+
".github/**/*",
47+
".hooks/**/*",
4648
"coverage/**/*",
4749
"dist/**/*",
4850
"node_modules/**/*",

0 commit comments

Comments
 (0)