@slashnephy/eslint-config 0.1.0 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/common.js CHANGED
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const common = {
4
- extends: [
5
- 'eslint:recommended',
6
- ],
7
- reportUnusedDisableDirectives: true
4
+ extends: ['eslint:recommended'],
5
+ reportUnusedDisableDirectives: true,
8
6
  };
9
7
  module.exports = common;
package/dist/index.js CHANGED
@@ -4,10 +4,19 @@ const path_1 = require("path");
4
4
  const config = {
5
5
  root: true,
6
6
  overrides: [
7
+ {
8
+ files: ['**/*.js'],
9
+ extends: [
10
+ (0, path_1.resolve)(__dirname, 'common.js'),
11
+ (0, path_1.resolve)(__dirname, 'javascript.js'),
12
+ (0, path_1.resolve)(__dirname, 'prettier.js'),
13
+ ],
14
+ },
7
15
  {
8
16
  files: ['**/*.ts'],
9
17
  extends: [
10
18
  (0, path_1.resolve)(__dirname, 'common.js'),
19
+ (0, path_1.resolve)(__dirname, 'javascript.js'),
11
20
  (0, path_1.resolve)(__dirname, 'typescript.js'),
12
21
  (0, path_1.resolve)(__dirname, 'prettier.js'),
13
22
  ],
@@ -16,11 +25,12 @@ const config = {
16
25
  files: ['**/*.tsx'],
17
26
  extends: [
18
27
  (0, path_1.resolve)(__dirname, 'common.js'),
28
+ (0, path_1.resolve)(__dirname, 'javascript.js'),
19
29
  (0, path_1.resolve)(__dirname, 'typescript.js'),
20
30
  (0, path_1.resolve)(__dirname, 'react.js'),
21
31
  (0, path_1.resolve)(__dirname, 'prettier.js'),
22
32
  ],
23
- }
24
- ]
33
+ },
34
+ ],
25
35
  };
26
36
  module.exports = config;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const javascript = {
4
+ extends: ['plugin:import/recommended'],
5
+ plugins: ['promise', 'unused-imports'],
6
+ env: {
7
+ node: true,
8
+ es2022: true,
9
+ browser: true,
10
+ },
11
+ rules: {
12
+ 'import/no-default-export': 'error',
13
+ 'prefer-arrow-callback': 'error',
14
+ 'func-style': [2, 'declaration', { allowArrowFunctions: true }],
15
+ curly: 'error',
16
+ 'prefer-template': 'error',
17
+ eqeqeq: 'error',
18
+ strict: ['error', 'global'],
19
+ 'import/order': [
20
+ 'warn',
21
+ {
22
+ groups: [
23
+ 'builtin',
24
+ 'external',
25
+ ['parent', 'sibling', 'index'],
26
+ 'object',
27
+ 'type',
28
+ 'unknown',
29
+ ],
30
+ 'newlines-between': 'always',
31
+ alphabetize: {
32
+ order: 'asc',
33
+ caseInsensitive: true,
34
+ },
35
+ pathGroups: [
36
+ {
37
+ pattern: '**.css',
38
+ group: 'type',
39
+ position: 'after',
40
+ },
41
+ ],
42
+ warnOnUnassignedImports: true,
43
+ },
44
+ ],
45
+ 'unused-imports/no-unused-imports': 'error',
46
+ },
47
+ };
48
+ module.exports = javascript;
package/dist/prettier.js CHANGED
@@ -1,14 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const prettier = {
4
- extends: [
5
- 'prettier',
6
- ],
4
+ extends: ['prettier'],
7
5
  rules: {
8
- indent: ['error', 2, { 'SwitchCase': 1 }],
9
6
  'linebreak-style': ['error', 'unix'],
10
7
  quotes: ['error', 'single'],
11
8
  semi: ['error', 'never'],
12
- }
9
+ },
13
10
  };
14
11
  module.exports = prettier;
package/dist/react.js CHANGED
@@ -5,18 +5,16 @@ const react = {
5
5
  'next/core-web-vitals',
6
6
  'plugin:css-import-order/recommended',
7
7
  ],
8
- plugins: [
9
- 'css-import-order'
10
- ],
8
+ plugins: ['css-import-order'],
11
9
  parserOptions: {
12
10
  ecmaFeatures: {
13
- jsx: true
11
+ jsx: true,
14
12
  },
15
13
  },
16
14
  settings: {
17
15
  react: {
18
- version: 'detect'
19
- }
16
+ version: 'detect',
17
+ },
20
18
  },
21
19
  rules: {
22
20
  'react/jsx-boolean-value': 'error',
@@ -24,19 +22,19 @@ const react = {
24
22
  'react/self-closing-comp': [
25
23
  'error',
26
24
  {
27
- 'component': true,
28
- 'html': true
29
- }
25
+ component: true,
26
+ html: true,
27
+ },
30
28
  ],
31
29
  'react/jsx-pascal-case': 'error',
32
30
  },
33
31
  overrides: [
34
32
  {
35
- files: ['pages/**/*.{ts,tsx}'],
33
+ files: ['**/pages/**/*.{ts,tsx}'],
36
34
  rules: {
37
- 'import/no-default-export': 'off'
38
- }
39
- }
35
+ 'import/no-default-export': 'off',
36
+ },
37
+ },
40
38
  ],
41
39
  };
42
40
  module.exports = react;
@@ -6,73 +6,30 @@ const typescript = {
6
6
  'plugin:@typescript-eslint/recommended-requiring-type-checking',
7
7
  'plugin:import/typescript',
8
8
  ],
9
- plugins: [
10
- '@typescript-eslint',
11
- 'promise',
12
- 'unused-imports',
13
- ],
9
+ plugins: ['@typescript-eslint'],
14
10
  parser: '@typescript-eslint/parser',
15
11
  parserOptions: {
16
12
  sourceType: 'module',
17
13
  ecmaVersion: 'latest',
18
14
  project: './tsconfig.json',
19
15
  },
20
- env: {
21
- node: true,
22
- es2022: true,
23
- browser: true
24
- },
25
16
  rules: {
26
- 'import/order': [
17
+ '@typescript-eslint/no-unused-vars': 'off',
18
+ 'unused-imports/no-unused-vars': [
27
19
  'warn',
28
20
  {
29
- 'groups': [
30
- 'builtin',
31
- 'external',
32
- ['parent', 'sibling', 'index'],
33
- 'object',
34
- 'type',
35
- 'unknown'
36
- ],
37
- 'newlines-between': 'always',
38
- 'alphabetize': {
39
- 'order': 'asc',
40
- 'caseInsensitive': true
41
- },
42
- 'pathGroups': [
43
- {
44
- 'pattern': '**.css',
45
- 'group': 'type',
46
- 'position': 'after'
47
- }
48
- ],
49
- 'warnOnUnassignedImports': true
50
- }
21
+ vars: 'all',
22
+ varsIgnorePattern: '^_',
23
+ args: 'after-used',
24
+ argsIgnorePattern: '^_',
25
+ },
51
26
  ],
52
- 'unused-imports/no-unused-imports': 'error',
53
27
  '@typescript-eslint/consistent-type-imports': [
54
28
  'error',
55
29
  {
56
- 'prefer': 'type-imports'
57
- }
58
- ],
59
- '@typescript-eslint/no-unused-vars': 'off',
60
- 'unused-imports/no-unused-vars': [
61
- 'warn',
62
- {
63
- 'vars': 'all',
64
- 'varsIgnorePattern': '^_',
65
- 'args': 'after-used',
66
- 'argsIgnorePattern': '^_'
67
- }
30
+ prefer: 'type-imports',
31
+ },
68
32
  ],
69
- 'import/no-default-export': 'error',
70
- 'prefer-arrow-callback': 'error',
71
- 'func-style': [2, 'declaration', { 'allowArrowFunctions': true }],
72
- 'curly': 'error',
73
- 'prefer-template': 'error',
74
- eqeqeq: 'error',
75
- strict: ['error', 'global'],
76
33
  '@typescript-eslint/array-type': 'error',
77
34
  '@typescript-eslint/consistent-type-assertions': 'error',
78
35
  '@typescript-eslint/no-floating-promises': 'warn',
@@ -83,17 +40,18 @@ const typescript = {
83
40
  '@typescript-eslint/restrict-template-expressions': 'off',
84
41
  '@typescript-eslint/unbound-method': 'off',
85
42
  '@typescript-eslint/no-unsafe-assignment': 'off',
43
+ '@typescript-eslint/no-unsafe-argument': 'off',
86
44
  '@typescript-eslint/no-unsafe-return': 'off',
87
45
  '@typescript-eslint/no-misused-promises': 'off',
88
- '@typescript-eslint/explicit-member-accessibility': 'error'
46
+ '@typescript-eslint/explicit-member-accessibility': 'error',
89
47
  },
90
48
  overrides: [
91
49
  {
92
50
  files: ['**/webpack.config.ts'],
93
51
  rules: {
94
- 'import/no-default-export': 'off'
95
- }
96
- }
52
+ 'import/no-default-export': 'off',
53
+ },
54
+ },
97
55
  ],
98
56
  };
99
57
  module.exports = typescript;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slashnephy/eslint-config",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
4
  "repository": {
5
5
  "url": "https://github.com/SlashNephy/.github",
6
6
  "directory": "env/eslint"
@@ -45,6 +45,7 @@
45
45
  "typescript": "^4"
46
46
  },
47
47
  "devDependencies": {
48
+ "@slashnephy/prettier-config": "0.1.0",
48
49
  "@types/eslint": "8.4.3",
49
50
  "@types/node": "17.0.41",
50
51
  "@types/prettier": "2.6.3",
@@ -56,7 +57,7 @@
56
57
  "packageManager": "yarn@3.2.1",
57
58
  "eslintConfig": {
58
59
  "extends": [
59
- "./dist/eslintrc.js"
60
+ "./dist/index.js"
60
61
  ]
61
62
  }
62
63
  }