@slashnephy/eslint-config 1.0.6 → 2.0.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 SlashNephy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # eslint-config
2
+
3
+ [![Check](https://github.com/SlashNephy/eslint-config/actions/workflows/check.yml/badge.svg)](https://github.com/SlashNephy/eslint-config/actions/workflows/check.yml?query=branch%3Amaster)
4
+ ![npm](https://img.shields.io/npm/v/%40slashnephy%2Feslint-config)
5
+
6
+ ## Install
7
+
8
+ ```console
9
+ $ yarn add @slashnephy/eslint-config
10
+ ```
11
+
12
+ ## Usage
13
+
14
+ `.eslintrc.json`
15
+ ```json
16
+ {
17
+ "extends": ["@slashnephy/eslint-config"]
18
+ }
19
+ ```
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@slashnephy/eslint-config",
3
- "version": "1.0.6",
3
+ "version": "2.0.0",
4
4
  "type": "commonjs",
5
- "main": "dist/index.js",
5
+ "main": "./src/index.js",
6
6
  "author": "SlashNephy <spica@starry.blue> (https://spica.starry.blue/)",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/SlashNephy/.github",
10
- "directory": "env/eslint"
9
+ "url": "https://github.com/SlashNephy/eslint-config"
11
10
  },
12
11
  "license": "MIT",
13
12
  "files": [
14
- "package.json",
15
- "dist/**/*.js"
13
+ "./package.json",
14
+ "./src/**/*.js",
15
+ "./README.md"
16
16
  ],
17
17
  "publishConfig": {
18
18
  "access": "public"
@@ -20,8 +20,8 @@
20
20
  "scripts": {
21
21
  "build": "tsc",
22
22
  "bump-version": "ts-node bin/bump-version.ts",
23
- "clean": "rm -rf dist/",
24
- "format": "concurrently -n format: 'yarn:format:*'",
23
+ "clean": "rm -rf src/**/*.js",
24
+ "format": "concurrently -m 1 -n format: 'yarn:format:*'",
25
25
  "format:eslint": "yarn build && yarn lint:eslint --fix",
26
26
  "format:prettier": "yarn lint:prettier --write",
27
27
  "lint": "concurrently -n lint: 'yarn:lint:*'",
@@ -39,6 +39,7 @@
39
39
  "eslint-config-next": "13.4.12",
40
40
  "eslint-config-prettier": "8.9.0",
41
41
  "eslint-config-standard": "17.1.0",
42
+ "eslint-gitignore": "0.1.0",
42
43
  "eslint-import-resolver-node": "0.3.7",
43
44
  "eslint-import-resolver-typescript": "3.5.5",
44
45
  "eslint-plugin-css-import-order": "1.1.0",
@@ -56,9 +57,10 @@
56
57
  "eslint-plugin-node": "11.1.0",
57
58
  "eslint-plugin-package-json": "0.1.4",
58
59
  "eslint-plugin-promise": "6.1.1",
59
- "eslint-plugin-react": "7.33.0",
60
+ "eslint-plugin-react": "7.33.1",
60
61
  "eslint-plugin-react-hooks": "4.6.0",
61
62
  "eslint-plugin-react-refresh": "0.4.3",
63
+ "eslint-plugin-relay": "1.8.3",
62
64
  "eslint-plugin-storybook": "0.6.13",
63
65
  "eslint-plugin-tsdoc": "0.2.17",
64
66
  "eslint-plugin-unused-imports": "3.0.0",
@@ -81,9 +83,9 @@
81
83
  "prettier": "3.0.0",
82
84
  "ts-node": "10.9.1"
83
85
  },
84
- "packageManager": "yarn@3.6.1",
86
+ "packageManager": "yarn@3.6.3",
85
87
  "eslintConfig": {
86
- "extends": "./dist"
88
+ "extends": "./src"
87
89
  },
88
90
  "keywords": [
89
91
  "eslint",
@@ -11,7 +11,7 @@ module.exports = {
11
11
  'plugin:import/recommended',
12
12
  'plugin:xss/recommended',
13
13
  ],
14
- plugins: ['import', 'promise', 'n', 'unused-imports'],
14
+ plugins: ['import', 'promise', 'n', 'unused-imports', 'deprecation'],
15
15
  env: {
16
16
  node: true,
17
17
  es2022: true,
@@ -94,6 +94,7 @@ module.exports = {
94
94
  camelcase: 'off',
95
95
  'default-case': 'off',
96
96
  'import/prefer-default-export': 'off',
97
+ 'import/no-cycle': 'error',
97
98
  'no-continue': 'off',
98
99
  'no-underscore-dangle': 'off',
99
100
  'no-use-before-define': 'off',
@@ -101,5 +102,30 @@ module.exports = {
101
102
  'no-nested-ternary': 'off',
102
103
  'no-plusplus': 'off',
103
104
  'consistent-return': 'off',
105
+ 'padding-line-between-statements': [
106
+ 'warn',
107
+ { blankLine: 'always', prev: '*', next: 'return' },
108
+ { blankLine: 'always', prev: 'directive', next: '*' },
109
+ { blankLine: 'any', prev: 'directive', next: 'directive' },
110
+ ],
111
+ 'no-void': 'off',
112
+ yoda: [
113
+ 'error',
114
+ 'never',
115
+ {
116
+ exceptRange: true,
117
+ },
118
+ ],
119
+ 'deprecation/deprecation': 'error',
120
+ 'unused-imports/no-unused-vars': [
121
+ 'warn',
122
+ {
123
+ vars: 'all',
124
+ varsIgnorePattern: '^_',
125
+ args: 'after-used',
126
+ argsIgnorePattern: '^_',
127
+ },
128
+ ],
129
+ 'import/no-anonymous-default-export': 'off',
104
130
  },
105
131
  };
@@ -8,7 +8,7 @@ module.exports = {
8
8
  'plugin:no-void-return-type/recommended',
9
9
  'plugin:storybook/recommended',
10
10
  ],
11
- plugins: ['@typescript-eslint', 'deprecation', 'tsdoc'],
11
+ plugins: ['@typescript-eslint', 'tsdoc'],
12
12
  parser: '@typescript-eslint/parser',
13
13
  parserOptions: {
14
14
  sourceType: 'module',
@@ -66,7 +66,12 @@ module.exports = {
66
66
  },
67
67
  {
68
68
  selector: ['property'],
69
- format: ['strictCamelCase', 'snake_case', 'UPPER_CASE'],
69
+ format: [
70
+ 'strictCamelCase',
71
+ 'snake_case',
72
+ 'UPPER_CASE',
73
+ 'StrictPascalCase',
74
+ ],
70
75
  },
71
76
  {
72
77
  selector: ['variable'],
@@ -135,23 +140,14 @@ module.exports = {
135
140
  '@typescript-eslint/type-annotation-spacing': 'error',
136
141
  '@typescript-eslint/unbound-method': 'off',
137
142
  '@typescript-eslint/no-unused-vars': 'off',
138
- 'unused-imports/no-unused-vars': [
139
- 'warn',
140
- {
141
- vars: 'all',
142
- varsIgnorePattern: '^_',
143
- args: 'after-used',
144
- argsIgnorePattern: '^_',
145
- },
146
- ],
147
143
  '@typescript-eslint/no-unsafe-assignment': 'off',
148
144
  '@typescript-eslint/no-unsafe-call': 'off',
149
145
  '@typescript-eslint/no-unsafe-member-access': 'off',
150
146
  '@typescript-eslint/no-unsafe-return': 'off',
151
147
  '@typescript-eslint/no-unsafe-argument': 'off',
148
+ '@typescript-eslint/no-unsafe-enum-comparison': 'off',
152
149
  '@typescript-eslint/restrict-template-expressions': 'off',
153
150
  '@typescript-eslint/strict-boolean-expressions': 'off',
154
- 'deprecation/deprecation': 'error',
155
151
  'import/extensions': [
156
152
  'warn',
157
153
  'always',
@@ -160,5 +156,11 @@ module.exports = {
160
156
  },
161
157
  ],
162
158
  'tsdoc/syntax': 'warn',
159
+ '@typescript-eslint/prefer-literal-enum-member': [
160
+ 'error',
161
+ {
162
+ allowBitwiseExpressions: true,
163
+ },
164
+ ],
163
165
  },
164
166
  };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ module.exports = {
4
+ extends: ['plugin:relay/recommended'],
5
+ plugins: ['relay'],
6
+ rules: {
7
+ 'relay/unused-fields': 'error',
8
+ },
9
+ };
@@ -2,9 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const path_1 = require("path");
4
4
  require("@rushstack/eslint-patch/modern-module-resolution.js");
5
+ const eslint_gitignore_1 = require("eslint-gitignore");
5
6
  module.exports = {
6
7
  root: true,
7
8
  extends: ['eslint:recommended'],
9
+ ignorePatterns: [
10
+ '**/node_modules/**',
11
+ '**/.yarn/**',
12
+ '**/dist/**',
13
+ ...(0, eslint_gitignore_1.readGitignoreFiles)(),
14
+ ],
8
15
  overrides: [
9
16
  {
10
17
  files: '**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}',
@@ -26,6 +33,10 @@ module.exports = {
26
33
  files: '**/*.{jsx,tsx}',
27
34
  extends: (0, path_1.resolve)(__dirname, 'framework/react.js'),
28
35
  },
36
+ {
37
+ files: '**/*.{js,jsx,ts,tsx}',
38
+ extends: (0, path_1.resolve)(__dirname, 'framework/relay.js'),
39
+ },
29
40
  {
30
41
  files: [
31
42
  '**/pages/**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}',
@@ -59,13 +70,18 @@ module.exports = {
59
70
  files: '**/bin/**/*.{js,mjs,cjs,ts,mts,cts}',
60
71
  extends: (0, path_1.resolve)(__dirname, 'presets/node.js'),
61
72
  },
73
+ {
74
+ files: ['**/src/worker.{js,ts}', '**/functions/**/*.{js,ts}'],
75
+ extends: (0, path_1.resolve)(__dirname, 'presets/allow-default-export.js'),
76
+ },
62
77
  {
63
78
  files: [
64
79
  '**/{webpack,rollup,vite}.config.{js,mjs,cjs,ts,mts,cts}',
65
80
  '**/codegen.{js,mjs,cjs,ts,mts,cts}',
66
81
  ],
67
82
  extends: [
68
- (0, path_1.resolve)(__dirname, 'presets/config.js'),
83
+ (0, path_1.resolve)(__dirname, 'presets/allow-default-export.js'),
84
+ (0, path_1.resolve)(__dirname, 'presets/build-configuration.js'),
69
85
  (0, path_1.resolve)(__dirname, 'presets/node.js'),
70
86
  ],
71
87
  },
@@ -82,5 +98,4 @@ module.exports = {
82
98
  extends: (0, path_1.resolve)(__dirname, 'presets/style.js'),
83
99
  },
84
100
  ],
85
- ignorePatterns: ['**/node_modules/**'],
86
101
  };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ module.exports = {
4
+ rules: {
5
+ 'import/no-default-export': 'off',
6
+ },
7
+ };
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  module.exports = {
4
4
  rules: {
5
- 'import/no-default-export': 'off',
6
5
  'import/no-extraneous-dependencies': [
7
6
  'error',
8
7
  {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes