eslint-config-seek 0.0.0-typescript-config-20221028024455 → 0.0.0-typescriptify-vitest-20251112025901

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/README.md CHANGED
@@ -5,27 +5,31 @@
5
5
 
6
6
  This package includes the shareable ESLint configuration used by [SEEK](https://github.com/seek-oss/).
7
7
 
8
- ## Usage in sku Projects
8
+ ## Usage in sku and skuba Projects
9
9
 
10
- The easiest way to use this configuration is with [sku](https://github.com/seek-oss/sku), which includes it by default.
10
+ The easiest way to use this configuration is with [sku](https://github.com/seek-oss/sku) or [skuba](https://github.com/seek-oss/skuba).
11
11
 
12
- **You don’t need to install it separately in sku projects.**
12
+ **You don’t need to install it separately in sku and skuba projects.**
13
13
 
14
- ## Usage Outside of sku
14
+ ## Usage Outside of sku and skuba
15
15
 
16
- If you want to use this ESLint configuration in a project not built with sku, you can install it with following steps.
16
+ If you want to use this ESLint configuration in a project not built with sku or skuba, you can install it with following steps.
17
17
 
18
- First, install this package, ESLint and the necessary plugins listed in this project's [package.json](package.json).
18
+ First, install this package, and the necessary peer dependencies listed in this project's [package.json](package.json).
19
19
 
20
- Then create a file named `.eslintrc` with following contents in the root folder of your project:
20
+ Then create a file named `eslint.config.js` with the following contents in the root folder of your project:
21
21
 
22
22
  ```js
23
- {
24
- "extends": "seek"
25
- }
23
+ module.exports = require('eslint-config-seek');
26
24
  ```
27
25
 
28
- You can override the settings from `eslint-config-seek` by editing the `.eslintrc` file. Learn more about [configuring ESLint](http://eslint.org/docs/user-guide/configuring) on the ESLint website.
26
+ The default configuration includes support for React projects. For projects that are not based on React, the "base" configuration should be used instead:
27
+
28
+ ```js
29
+ module.exports = require('eslint-config-seek/base');
30
+ ```
31
+
32
+ You can override the settings from `eslint-config-seek` by editing the `eslint.config.js` file. Learn more about [configuring ESLint](https://eslint.org/docs/latest/use/configure/) on the ESLint website.
29
33
 
30
34
  ## License
31
35
 
@@ -0,0 +1,264 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+
23
+ //#endregion
24
+ const require_extensions = require('./extensions-vqCxaxgq.cjs');
25
+ let eslint_config = require("eslint/config");
26
+ let eslint_plugin_import_x = require("eslint-plugin-import-x");
27
+ eslint_plugin_import_x = __toESM(eslint_plugin_import_x);
28
+ let globals = require("globals");
29
+ globals = __toESM(globals);
30
+ let eslint_plugin_cypress = require("eslint-plugin-cypress");
31
+ eslint_plugin_cypress = __toESM(eslint_plugin_cypress);
32
+ let eslint_config_prettier = require("eslint-config-prettier");
33
+ eslint_config_prettier = __toESM(eslint_config_prettier);
34
+ let typescript_eslint = require("typescript-eslint");
35
+ typescript_eslint = __toESM(typescript_eslint);
36
+
37
+ //#region src/base/base.ts
38
+ const OFF = 0;
39
+ const WARN = 1;
40
+ const ERROR = 2;
41
+ const baseRules = {
42
+ "no-console": ERROR,
43
+ "no-unexpected-multiline": ERROR,
44
+ "block-scoped-var": ERROR,
45
+ "default-case": ERROR,
46
+ "dot-notation": ERROR,
47
+ eqeqeq: [
48
+ ERROR,
49
+ "always",
50
+ { null: "ignore" }
51
+ ],
52
+ "guard-for-in": ERROR,
53
+ "no-alert": ERROR,
54
+ "no-caller": ERROR,
55
+ "no-div-regex": ERROR,
56
+ "no-else-return": ERROR,
57
+ "no-eval": ERROR,
58
+ "no-extend-native": ERROR,
59
+ "no-extra-bind": ERROR,
60
+ "no-fallthrough": ERROR,
61
+ "no-floating-decimal": ERROR,
62
+ "no-implicit-coercion": ERROR,
63
+ "no-implied-eval": ERROR,
64
+ "no-iterator": ERROR,
65
+ "no-labels": ERROR,
66
+ "no-lone-blocks": ERROR,
67
+ "no-loop-func": ERROR,
68
+ "no-multi-str": ERROR,
69
+ "no-new-func": ERROR,
70
+ "no-new-wrappers": ERROR,
71
+ "no-new": ERROR,
72
+ "no-octal-escape": ERROR,
73
+ "no-param-reassign": ERROR,
74
+ "no-proto": ERROR,
75
+ "no-return-assign": ERROR,
76
+ "no-script-url": ERROR,
77
+ "no-self-compare": ERROR,
78
+ "no-sequences": ERROR,
79
+ "no-throw-literal": ERROR,
80
+ "no-useless-call": ERROR,
81
+ "no-void": ERROR,
82
+ radix: ERROR,
83
+ "vars-on-top": ERROR,
84
+ yoda: ERROR,
85
+ strict: [ERROR, "never"],
86
+ "no-label-var": ERROR,
87
+ "no-shadow": ERROR,
88
+ "no-undef-init": ERROR,
89
+ "no-unused-vars": [ERROR, {
90
+ argsIgnorePattern: "^_",
91
+ ignoreRestSiblings: true
92
+ }],
93
+ "handle-callback-err": ERROR,
94
+ "no-new-require": ERROR,
95
+ "no-path-concat": ERROR,
96
+ "no-process-exit": ERROR,
97
+ "no-restricted-modules": ERROR,
98
+ "no-restricted-syntax": [
99
+ ERROR,
100
+ {
101
+ selector: "MethodDefinition[kind = \"get\"]",
102
+ message: "Custom getters can cause confusion, particularly if they throw errors. Remove the `get` syntax to specify a regular method instead."
103
+ },
104
+ {
105
+ selector: "MethodDefinition[kind = \"set\"]",
106
+ message: "Custom setters can cause confusion, particularly if they throw errors. Remove the `set` syntax to specify a regular method instead."
107
+ },
108
+ {
109
+ selector: "Property[kind = \"get\"]",
110
+ message: "Custom getters can cause confusion, particularly if they throw errors. Remove the `get` syntax to specify a regular property instead."
111
+ },
112
+ {
113
+ selector: "Property[kind = \"set\"]",
114
+ message: "Custom setters can cause confusion, particularly if they throw errors. Remove the `set` syntax to specify a regular property instead."
115
+ }
116
+ ],
117
+ "no-sync": ERROR,
118
+ "linebreak-style": [ERROR, "unix"],
119
+ "new-cap": ERROR,
120
+ "no-lonely-if": ERROR,
121
+ "no-nested-ternary": ERROR,
122
+ "no-unneeded-ternary": ERROR,
123
+ "spaced-comment": [ERROR, "always"],
124
+ "no-var": ERROR,
125
+ "object-shorthand": ERROR,
126
+ "prefer-const": ERROR,
127
+ "prefer-spread": ERROR,
128
+ "prefer-template": ERROR,
129
+ "no-return-await": OFF
130
+ };
131
+ const eslintConfigPrettierOverrideRules = { curly: [ERROR, "all"] };
132
+ const allExtensions = [...require_extensions.js, ...require_extensions.ts];
133
+ const settings = { "import-x/resolver": {
134
+ typescript: true,
135
+ node: true
136
+ } };
137
+ var base_default = (0, eslint_config.defineConfig)([
138
+ { plugins: {
139
+ cypress: eslint_plugin_cypress.default,
140
+ "@typescript-eslint": typescript_eslint.default.plugin
141
+ } },
142
+ eslint_plugin_import_x.default.flatConfigs.typescript,
143
+ {
144
+ rules: eslint_plugin_import_x.default.flatConfigs.errors.rules,
145
+ files: [`**/*.{${require_extensions.js}}`]
146
+ },
147
+ {
148
+ rules: eslint_plugin_import_x.default.flatConfigs.warnings.rules,
149
+ files: [`**/*.{${require_extensions.js}}`]
150
+ },
151
+ {
152
+ languageOptions: {
153
+ globals: { ...globals.default.node },
154
+ parserOptions: {
155
+ requireConfigFile: false,
156
+ ecmaVersion: "latest",
157
+ sourceType: "module"
158
+ }
159
+ },
160
+ settings,
161
+ rules: baseRules
162
+ },
163
+ eslint_config_prettier.default,
164
+ {
165
+ languageOptions: {
166
+ globals: { ...globals.default.node },
167
+ parserOptions: {
168
+ requireConfigFile: false,
169
+ ecmaVersion: "latest",
170
+ sourceType: "module"
171
+ }
172
+ },
173
+ settings,
174
+ rules: eslintConfigPrettierOverrideRules
175
+ },
176
+ ...[...typescript_eslint.default.configs.recommended, ...typescript_eslint.default.configs.stylistic].map((config) => ({
177
+ ...config,
178
+ files: [`**/*.{${require_extensions.ts}}`]
179
+ })),
180
+ {
181
+ files: [`**/*.{${require_extensions.ts}}`],
182
+ languageOptions: {
183
+ parser: typescript_eslint.default.parser,
184
+ parserOptions: {
185
+ projectService: true,
186
+ warnOnUnsupportedTypeScriptVersion: false
187
+ }
188
+ },
189
+ settings,
190
+ rules: {
191
+ "@typescript-eslint/array-type": [ERROR, { default: "array-simple" }],
192
+ "@typescript-eslint/consistent-type-definitions": OFF,
193
+ "@typescript-eslint/no-unused-expressions": ERROR,
194
+ "@typescript-eslint/no-unused-vars": [ERROR, {
195
+ argsIgnorePattern: "^_",
196
+ ignoreRestSiblings: true
197
+ }],
198
+ "@typescript-eslint/no-use-before-define": OFF,
199
+ "@typescript-eslint/no-non-null-assertion": OFF,
200
+ "@typescript-eslint/ban-ts-comment": OFF,
201
+ "@typescript-eslint/no-explicit-any": OFF,
202
+ "@typescript-eslint/explicit-function-return-type": OFF,
203
+ "@typescript-eslint/naming-convention": [
204
+ WARN,
205
+ {
206
+ selector: "typeLike",
207
+ format: ["PascalCase"],
208
+ leadingUnderscore: "allow"
209
+ },
210
+ {
211
+ selector: "enum",
212
+ format: null
213
+ }
214
+ ],
215
+ "@typescript-eslint/no-empty-function": OFF,
216
+ "@typescript-eslint/no-empty-interface": OFF,
217
+ "@typescript-eslint/no-inferrable-types": [ERROR, { ignoreParameters: true }],
218
+ "default-case": OFF,
219
+ "arrow-body-style": [ERROR, "as-needed"],
220
+ "no-shadow": OFF,
221
+ "@typescript-eslint/no-shadow": ERROR,
222
+ "@typescript-eslint/consistent-type-imports": [ERROR, { fixStyle: "inline-type-imports" }],
223
+ "@typescript-eslint/consistent-type-exports": [ERROR, { fixMixedExportsWithInlineTypeSpecifier: true }],
224
+ "@typescript-eslint/no-import-type-side-effects": ERROR,
225
+ "import-x/no-duplicates": [ERROR, { "prefer-inline": true }],
226
+ "import-x/export": ERROR
227
+ }
228
+ },
229
+ {
230
+ files: [`**/*.{${require_extensions.js}}`],
231
+ languageOptions: { globals: {} },
232
+ settings,
233
+ rules: {
234
+ "no-undef": ERROR,
235
+ "no-use-before-define": [ERROR, { functions: false }],
236
+ "no-unused-expressions": ERROR,
237
+ "import-x/no-unresolved": [ERROR, {
238
+ commonjs: true,
239
+ amd: true,
240
+ ignore: [".svg$", "^file?"]
241
+ }],
242
+ "import-x/no-duplicates": ERROR,
243
+ "import-x/export": ERROR
244
+ }
245
+ },
246
+ {
247
+ ...eslint_plugin_cypress.default.configs.recommended,
248
+ files: [`**/cypress/**/*.{${allExtensions}}`]
249
+ }
250
+ ]);
251
+
252
+ //#endregion
253
+ Object.defineProperty(exports, '__toESM', {
254
+ enumerable: true,
255
+ get: function () {
256
+ return __toESM;
257
+ }
258
+ });
259
+ Object.defineProperty(exports, 'base_default', {
260
+ enumerable: true,
261
+ get: function () {
262
+ return base_default;
263
+ }
264
+ });
@@ -0,0 +1,15 @@
1
+ const require_base = require('./base-DwcraiZA.cjs');
2
+ let eslint_config = require("eslint/config");
3
+ let __vitest_eslint_plugin = require("@vitest/eslint-plugin");
4
+ __vitest_eslint_plugin = require_base.__toESM(__vitest_eslint_plugin);
5
+
6
+ //#region src/vitest/base.ts
7
+ var base_default$1 = (0, eslint_config.defineConfig)([...require_base.base_default, { plugins: { vitest: __vitest_eslint_plugin.default } }]);
8
+
9
+ //#endregion
10
+ Object.defineProperty(exports, 'base_default', {
11
+ enumerable: true,
12
+ get: function () {
13
+ return base_default$1;
14
+ }
15
+ });
package/dist/base.cjs ADDED
@@ -0,0 +1,25 @@
1
+ const require_base = require('./base-DwcraiZA.cjs');
2
+ const require_extensions = require('./extensions-vqCxaxgq.cjs');
3
+ let eslint_config = require("eslint/config");
4
+ let globals = require("globals");
5
+ globals = require_base.__toESM(globals);
6
+ let eslint_plugin_jest = require("eslint-plugin-jest");
7
+ eslint_plugin_jest = require_base.__toESM(eslint_plugin_jest);
8
+
9
+ //#region src/base.ts
10
+ const allExtensions = [...require_extensions.js, ...require_extensions.ts];
11
+ var base_default = (0, eslint_config.defineConfig)([
12
+ ...require_base.base_default,
13
+ { plugins: { jest: eslint_plugin_jest.default } },
14
+ {
15
+ ...eslint_plugin_jest.default.configs["flat/recommended"],
16
+ files: [`**/__tests__/**/*.{${allExtensions}}`, `**/*.@(spec|test).{${allExtensions}}`]
17
+ },
18
+ {
19
+ files: [`**/__tests__/**/*.{${allExtensions}}`, `**/*.@(spec|test).{${allExtensions}}`],
20
+ languageOptions: { globals: { ...globals.default.jest } }
21
+ }
22
+ ]);
23
+
24
+ //#endregion
25
+ module.exports = base_default;
@@ -0,0 +1,5 @@
1
+ import * as eslint_config0 from "eslint/config";
2
+
3
+ //#region src/base.d.ts
4
+ declare const _default: eslint_config0.Config[];
5
+ export = _default;
@@ -0,0 +1,28 @@
1
+
2
+ //#region src/extensions.ts
3
+ const js = [
4
+ "js",
5
+ "cjs",
6
+ "mjs",
7
+ "jsx"
8
+ ];
9
+ const ts = [
10
+ "ts",
11
+ "cts",
12
+ "mts",
13
+ "tsx"
14
+ ];
15
+
16
+ //#endregion
17
+ Object.defineProperty(exports, 'js', {
18
+ enumerable: true,
19
+ get: function () {
20
+ return js;
21
+ }
22
+ });
23
+ Object.defineProperty(exports, 'ts', {
24
+ enumerable: true,
25
+ get: function () {
26
+ return ts;
27
+ }
28
+ });
@@ -0,0 +1,4 @@
1
+ const require_extensions = require('./extensions-vqCxaxgq.cjs');
2
+
3
+ exports.js = require_extensions.js;
4
+ exports.ts = require_extensions.ts;
@@ -0,0 +1,5 @@
1
+ //#region src/extensions.d.ts
2
+ declare const js: string[];
3
+ declare const ts: string[];
4
+ //#endregion
5
+ export { js, ts };
package/dist/index.cjs ADDED
@@ -0,0 +1,10 @@
1
+ const require_base = require('./base-DwcraiZA.cjs');
2
+ require('./extensions-vqCxaxgq.cjs');
3
+ const require_react = require('./react-Cl1LnxEk.cjs');
4
+ let eslint_config = require("eslint/config");
5
+
6
+ //#region src/index.ts
7
+ var src_default = (0, eslint_config.defineConfig)([...require_base.base_default, ...require_react.react_default]);
8
+
9
+ //#endregion
10
+ module.exports = src_default;
@@ -0,0 +1,5 @@
1
+ import * as eslint_config0 from "eslint/config";
2
+
3
+ //#region src/index.d.ts
4
+ declare const _default: eslint_config0.Config[];
5
+ export = _default;
@@ -0,0 +1,56 @@
1
+ const require_base = require('./base-DwcraiZA.cjs');
2
+ let eslint_config = require("eslint/config");
3
+ let globals = require("globals");
4
+ globals = require_base.__toESM(globals);
5
+ let eslint_plugin_react = require("eslint-plugin-react");
6
+ eslint_plugin_react = require_base.__toESM(eslint_plugin_react);
7
+ let eslint_plugin_react_hooks = require("eslint-plugin-react-hooks");
8
+ eslint_plugin_react_hooks = require_base.__toESM(eslint_plugin_react_hooks);
9
+
10
+ //#region src/base/react.ts
11
+ const OFF = 0;
12
+ const ERROR = 2;
13
+ const reactRules = {
14
+ "react/prefer-es6-class": [ERROR, "always"],
15
+ "react/self-closing-comp": ERROR,
16
+ "react/jsx-pascal-case": ERROR,
17
+ "react-hooks/rules-of-hooks": ERROR,
18
+ "react-hooks/exhaustive-deps": ERROR,
19
+ "react/no-children-prop": ERROR,
20
+ "react/display-name": OFF,
21
+ "react/prop-types": OFF,
22
+ "react/jsx-curly-brace-presence": [ERROR, {
23
+ props: "never",
24
+ children: "ignore",
25
+ propElementValues: "always"
26
+ }]
27
+ };
28
+ var react_default = (0, eslint_config.defineConfig)([
29
+ eslint_plugin_react.default.configs.flat.recommended,
30
+ eslint_plugin_react.default.configs.flat["jsx-runtime"],
31
+ {
32
+ plugins: {
33
+ react: eslint_plugin_react.default,
34
+ "react-hooks": eslint_plugin_react_hooks.default
35
+ },
36
+ languageOptions: { globals: globals.default.browser },
37
+ settings: { react: { version: "detect" } },
38
+ rules: reactRules
39
+ },
40
+ {
41
+ files: ["**/*.tsx"],
42
+ rules: { "@typescript-eslint/no-unused-vars": [ERROR, {
43
+ argsIgnorePattern: "^_",
44
+ ignoreRestSiblings: true,
45
+ varsIgnorePattern: "^React$"
46
+ }] }
47
+ }
48
+ ]);
49
+
50
+ //#endregion
51
+ Object.defineProperty(exports, 'react_default', {
52
+ enumerable: true,
53
+ get: function () {
54
+ return react_default;
55
+ }
56
+ });
@@ -0,0 +1,5 @@
1
+ require('../base-DwcraiZA.cjs');
2
+ require('../extensions-vqCxaxgq.cjs');
3
+ const require_base$1 = require('../base-l4o8Antj.cjs');
4
+
5
+ module.exports = require_base$1.base_default;
@@ -0,0 +1,5 @@
1
+ import * as eslint_config2 from "eslint/config";
2
+
3
+ //#region src/vitest/base.d.ts
4
+ declare const _default: eslint_config2.Config[];
5
+ export = _default;
@@ -0,0 +1,11 @@
1
+ const require_base = require('../base-DwcraiZA.cjs');
2
+ require('../extensions-vqCxaxgq.cjs');
3
+ const require_react = require('../react-Cl1LnxEk.cjs');
4
+ const require_base$1 = require('../base-l4o8Antj.cjs');
5
+ let eslint_config = require("eslint/config");
6
+
7
+ //#region src/vitest/index.ts
8
+ var vitest_default = (0, eslint_config.defineConfig)([...require_base$1.base_default, ...require_react.react_default]);
9
+
10
+ //#endregion
11
+ module.exports = vitest_default;
@@ -0,0 +1,5 @@
1
+ import * as eslint_config1 from "eslint/config";
2
+
3
+ //#region src/vitest/index.d.ts
4
+ declare const _default: eslint_config1.Config[];
5
+ export = _default;
package/package.json CHANGED
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "name": "eslint-config-seek",
3
- "version": "0.0.0-typescript-config-20221028024455",
3
+ "version": "0.0.0-typescriptify-vitest-20251112025901",
4
+ "type": "module",
4
5
  "description": "ESLint configuration used by SEEK",
5
- "main": ".eslintrc.js",
6
- "files": [
7
- ".eslintrc.js"
8
- ],
9
6
  "repository": {
10
7
  "type": "git",
11
8
  "url": "https://github.com/seek-oss/eslint-config-seek.git"
@@ -15,40 +12,59 @@
15
12
  "bugs": {
16
13
  "url": "https://github.com/seek-oss/eslint-config-seek/issues"
17
14
  },
15
+ "main": "./dist/index.cjs",
16
+ "types": "./dist/index.d.cts",
17
+ "exports": {
18
+ ".": "./dist/index.cjs",
19
+ "./base": "./dist/base.cjs",
20
+ "./extensions": "./dist/extensions.cjs",
21
+ "./vitest": "./dist/vitest/index.cjs",
22
+ "./vitest/base": "./dist/vitest/base.cjs",
23
+ "./package.json": "./package.json"
24
+ },
25
+ "files": [
26
+ "dist"
27
+ ],
18
28
  "homepage": "https://github.com/seek-oss/eslint-config-seek#readme",
19
29
  "dependencies": {
20
- "@babel/core": "^7.19.6",
21
- "@babel/eslint-parser": "^7.19.1",
22
- "@babel/preset-react": "^7.18.6",
23
- "@typescript-eslint/eslint-plugin": "^5.41.0",
24
- "@typescript-eslint/parser": "^5.41.0",
25
- "eslint-config-prettier": "^8.5.0",
26
- "eslint-import-resolver-typescript": "3.5.2",
27
- "eslint-plugin-cypress": "^2.12.1",
28
- "eslint-plugin-import": "^2.26.0",
29
- "eslint-plugin-jest": "^27.1.3",
30
- "eslint-plugin-react": "^7.31.10",
31
- "eslint-plugin-react-hooks": "^4.6.0",
32
- "find-root": "^1.1.0"
30
+ "@vitest/eslint-plugin": "^1.4.2",
31
+ "eslint-config-prettier": "^10.0.0",
32
+ "eslint-import-resolver-typescript": "^4.0.0",
33
+ "eslint-plugin-cypress": "^5.0.0",
34
+ "eslint-plugin-import-x": "^4.9.0",
35
+ "eslint-plugin-jest": "^29.0.0",
36
+ "eslint-plugin-react": "^7.35.0",
37
+ "eslint-plugin-react-hooks": "^5.0.0",
38
+ "globals": "^16.0.0",
39
+ "typescript-eslint": "^8.6.0"
33
40
  },
34
41
  "devDependencies": {
35
- "@changesets/cli": "2.25.0",
36
- "@changesets/get-github-info": "0.5.1",
37
- "eslint": "8.26.0",
38
- "prettier": "2.7.1",
39
- "typescript": "^4.8.4"
42
+ "@changesets/cli": "^2.27.7",
43
+ "@changesets/get-github-info": "^0.6.0",
44
+ "@tsconfig/node22": "^22.0.2",
45
+ "eslint": "^9.8.0",
46
+ "jiti": "^2.6.1",
47
+ "prettier": "^3.3.3",
48
+ "tsdown": "^0.16.3",
49
+ "typescript": "~5.9.0"
40
50
  },
41
51
  "peerDependencies": {
42
- "eslint": ">=6",
43
- "typescript": ">=3.3"
52
+ "eslint": ">=9.9.1",
53
+ "typescript": ">=5.5.4"
44
54
  },
45
- "packageManager": "pnpm@7.14.0",
46
- "volta": {
47
- "node": "16.18.0"
55
+ "engines": {
56
+ "node": ">=22.21.1"
48
57
  },
49
58
  "scripts": {
50
- "release": "changeset publish",
51
- "test": "eslint .",
52
- "changeset-version": "changeset version && prettier --write ."
59
+ "lint": "pnpm run '/^lint:.*/'",
60
+ "format": "pnpm run '/^format:.*/'",
61
+ "format:eslint": "eslint --fix .",
62
+ "format:prettier": "prettier --write .",
63
+ "lint:eslint": "eslint .",
64
+ "lint:tsc": "tsc --noEmit",
65
+ "build": "tsdown",
66
+ "lint:prettier": "prettier --check .",
67
+ "version": "changeset version && prettier --write .",
68
+ "release": "changeset publish"
53
69
  }
54
70
  }
package/.eslintrc.js DELETED
@@ -1,216 +0,0 @@
1
- const path = require('path');
2
- const root = require('find-root')(process.cwd());
3
-
4
- const OFF = 0;
5
- const ERROR = 2;
6
-
7
- const baseRules = {
8
- // Possible Errors
9
- 'no-console': ERROR,
10
- 'no-unexpected-multiline': ERROR,
11
- 'block-scoped-var': ERROR,
12
- curly: [ERROR, 'all'],
13
- 'default-case': ERROR,
14
- 'dot-notation': ERROR,
15
- eqeqeq: [ERROR, 'always', { null: 'ignore' }],
16
- 'guard-for-in': ERROR,
17
- 'no-alert': ERROR,
18
- 'no-caller': ERROR,
19
- 'no-div-regex': ERROR,
20
- 'no-else-return': ERROR,
21
- 'no-eval': ERROR,
22
- 'no-extend-native': ERROR,
23
- 'no-extra-bind': ERROR,
24
- 'no-floating-decimal': ERROR,
25
- 'no-implicit-coercion': ERROR,
26
- 'no-implied-eval': ERROR,
27
- 'no-iterator': ERROR,
28
- 'no-labels': ERROR,
29
- 'no-lone-blocks': ERROR,
30
- 'no-loop-func': ERROR,
31
- 'no-multi-str': ERROR,
32
- 'no-new-func': ERROR,
33
- 'no-new-wrappers': ERROR,
34
- 'no-new': ERROR,
35
- 'no-octal-escape': ERROR,
36
- 'no-param-reassign': ERROR,
37
- 'no-proto': ERROR,
38
- 'no-return-assign': ERROR,
39
- 'no-script-url': ERROR,
40
- 'no-self-compare': ERROR,
41
- 'no-sequences': ERROR,
42
- 'no-throw-literal': ERROR,
43
- 'no-useless-call': ERROR,
44
- 'no-void': ERROR,
45
- radix: ERROR,
46
- 'vars-on-top': ERROR,
47
- yoda: ERROR,
48
- strict: [ERROR, 'never'],
49
- 'no-label-var': ERROR,
50
- 'no-shadow': ERROR,
51
- 'no-undef-init': ERROR,
52
- 'no-unused-vars': [
53
- ERROR,
54
- { argsIgnorePattern: '^_', ignoreRestSiblings: true },
55
- ],
56
- 'handle-callback-err': ERROR,
57
- 'no-new-require': ERROR,
58
- 'no-path-concat': ERROR,
59
- 'no-process-exit': ERROR,
60
- 'no-restricted-modules': ERROR,
61
- 'no-sync': ERROR,
62
- 'linebreak-style': [ERROR, 'unix'],
63
- 'new-cap': ERROR,
64
- 'no-lonely-if': ERROR,
65
- 'no-nested-ternary': ERROR,
66
- 'no-unneeded-ternary': ERROR,
67
- 'spaced-comment': [ERROR, 'always'],
68
- 'no-var': ERROR,
69
- 'object-shorthand': ERROR,
70
- 'prefer-const': ERROR,
71
- 'prefer-spread': ERROR,
72
- 'prefer-template': ERROR,
73
- // Allow devs to choose between performance and richer stack traces
74
- // https://eslint.org/docs/rules/no-return-await#when-not-to-use-it
75
- // https://github.com/goldbergyoni/nodebestpractices/blob/master@%7B2022-01-01T00:00:00Z%7D/sections/errorhandling/returningpromises.md
76
- 'no-return-await': OFF,
77
- };
78
-
79
- const reactRules = {
80
- 'react/prefer-es6-class': [ERROR, 'always'],
81
- 'react/self-closing-comp': ERROR,
82
- 'react/jsx-pascal-case': ERROR,
83
- 'react-hooks/rules-of-hooks': ERROR,
84
- 'react-hooks/exhaustive-deps': ERROR,
85
- 'react/no-children-prop': ERROR,
86
- 'react/display-name': OFF,
87
- 'react/prop-types': OFF,
88
- };
89
-
90
- /** @type {import('eslint').Linter.Config} */
91
- const baseConfig = {
92
- parser: '@babel/eslint-parser',
93
- parserOptions: {
94
- babelOptions: {
95
- presets: ['@babel/preset-react'],
96
- },
97
- requireConfigFile: false,
98
- sourceType: 'module',
99
- },
100
- root: true,
101
- env: {
102
- browser: true,
103
- node: true,
104
- },
105
- settings: {
106
- react: {
107
- version: 'detect',
108
- },
109
- },
110
- plugins: ['react', 'react-hooks', 'import'],
111
- extends: [
112
- 'plugin:react/recommended',
113
- // this config enables eslint-plugin-import to resolve JavaScript and TypeScript files
114
- // https://github.com/import-js/eslint-plugin-import/blob/v2.26.0/config/typescript.js
115
- // Some rules provided by eslint-plugin-import e.g. `import/no-duplicates` don't work without it
116
- 'plugin:import/typescript',
117
- 'prettier',
118
- ],
119
- rules: {
120
- ...baseRules,
121
- ...reactRules,
122
- },
123
- overrides: [
124
- {
125
- // TypeScript config
126
- files: ['**/*.ts', '**/*.tsx'],
127
- parser: '@typescript-eslint/parser',
128
- parserOptions: {
129
- ecmaVersion: 2018,
130
- sourceType: 'module',
131
- },
132
- extends: [
133
- 'plugin:@typescript-eslint/eslint-recommended',
134
- 'plugin:@typescript-eslint/recommended',
135
- 'prettier',
136
- ],
137
- settings: {
138
- // adds comprehensive TypeScript support to eslint-plugin-import
139
- // https://github.com/import-js/eslint-import-resolver-typescript
140
- 'import/resolver': {
141
- typescript: {},
142
- },
143
- },
144
- rules: {
145
- '@typescript-eslint/no-unused-expressions': ERROR,
146
- '@typescript-eslint/no-unused-vars': [
147
- ERROR,
148
- { argsIgnorePattern: '^_', ignoreRestSiblings: true },
149
- ],
150
- '@typescript-eslint/no-use-before-define': OFF,
151
- '@typescript-eslint/no-non-null-assertion': OFF,
152
- '@typescript-eslint/ban-ts-comment': OFF,
153
- '@typescript-eslint/no-explicit-any': OFF,
154
- '@typescript-eslint/explicit-function-return-type': OFF,
155
- '@typescript-eslint/no-empty-function': OFF,
156
- '@typescript-eslint/no-empty-interface': OFF,
157
- '@typescript-eslint/no-inferrable-types': [
158
- ERROR,
159
- { ignoreParameters: true },
160
- ],
161
- // prefer TypeScript exhaustiveness checking
162
- // https://www.typescriptlang.org/docs/handbook/advanced-types.html#exhaustiveness-checking
163
- 'default-case': OFF,
164
- 'arrow-body-style': [ERROR, 'as-needed'],
165
- // Use `typescript-eslint`'s no-shadow to avoid false positives with enums
166
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-shadow.md
167
- 'no-shadow': OFF,
168
- '@typescript-eslint/no-shadow': ERROR,
169
- },
170
- },
171
- {
172
- // JavaScript config
173
- files: ['**/*.js', '**/*.jsx'],
174
- env: {
175
- es6: true,
176
- },
177
- extends: ['plugin:import/errors', 'plugin:import/warnings'],
178
- settings: {
179
- 'import/resolver': {
180
- node: {
181
- moduleDirectory: [root, path.join(root, 'node_modules')],
182
- },
183
- },
184
- },
185
- rules: {
186
- 'no-use-before-define': [ERROR, { functions: false }],
187
- 'no-unused-expressions': ERROR,
188
- 'import/no-unresolved': [
189
- ERROR,
190
- { commonjs: true, amd: true, ignore: ['.svg$', '^file?'] },
191
- ],
192
- 'import/no-duplicates': ERROR,
193
- },
194
- },
195
- {
196
- // Jest config
197
- files: ['**/__tests__/**/*.{js,ts,tsx}', '**/*.@(spec|test).{js,ts,tsx}'],
198
- env: {
199
- jest: true,
200
- },
201
- extends: ['plugin:jest/recommended'],
202
- plugins: ['jest'],
203
- },
204
- {
205
- // Cypress config
206
- files: ['cypress/**/*.{js,ts,tsx}'],
207
- env: {
208
- 'cypress/globals': true,
209
- },
210
- extends: ['plugin:cypress/recommended'],
211
- plugins: ['cypress'],
212
- },
213
- ],
214
- };
215
-
216
- module.exports = baseConfig;