@thermarthae/eslint-config 5.0.0 → 6.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/.yarn/sdks/eslint/lib/types/index.d.ts +32 -0
- package/README.md +2 -2
- package/base.js +0 -1
- package/index.js +3 -15
- package/package.json +32 -22
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const {existsSync} = require(`fs`);
|
|
4
|
+
const {createRequire, register} = require(`module`);
|
|
5
|
+
const {resolve} = require(`path`);
|
|
6
|
+
const {pathToFileURL} = require(`url`);
|
|
7
|
+
|
|
8
|
+
const relPnpApiPath = "../../../../../.pnp.cjs";
|
|
9
|
+
|
|
10
|
+
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
|
11
|
+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
|
12
|
+
const absRequire = createRequire(absPnpApiPath);
|
|
13
|
+
|
|
14
|
+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
|
15
|
+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
|
16
|
+
|
|
17
|
+
if (existsSync(absPnpApiPath)) {
|
|
18
|
+
if (!process.versions.pnp) {
|
|
19
|
+
// Setup the environment to be able to require eslint
|
|
20
|
+
require(absPnpApiPath).setup();
|
|
21
|
+
if (isPnpLoaderEnabled && register) {
|
|
22
|
+
register(pathToFileURL(absPnpLoaderPath));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
|
28
|
+
? exports => absRequire(absUserWrapperPath)(exports)
|
|
29
|
+
: exports => exports;
|
|
30
|
+
|
|
31
|
+
// Defer to the real eslint your application uses
|
|
32
|
+
module.exports = wrapWithUserWrapper(absRequire(`eslint`));
|
package/README.md
CHANGED
|
@@ -20,9 +20,9 @@ yarn add -D @thermarthae/eslint-config @eslint/js typescript-eslint eslint-plugi
|
|
|
20
20
|
|
|
21
21
|
### 2) Configure ESLint
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
An example `eslint.config.js`:
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
**Note**: You may have to set the `tsconfigRootDir` path!
|
|
26
26
|
|
|
27
27
|
```js
|
|
28
28
|
// If you don't need React support:
|
package/base.js
CHANGED
package/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import react from 'eslint-plugin-react';
|
|
2
|
-
// @ts-expect-error no types :/
|
|
3
2
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
4
3
|
import stylistic from '@stylistic/eslint-plugin';
|
|
5
4
|
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
|
@@ -7,7 +6,6 @@ import jsxA11y from 'eslint-plugin-jsx-a11y';
|
|
|
7
6
|
import base from './base.js';
|
|
8
7
|
|
|
9
8
|
const stylisticCustomizedWithJSX = stylistic.configs.customize({
|
|
10
|
-
flat: true,
|
|
11
9
|
indent: 'tab',
|
|
12
10
|
semi: true,
|
|
13
11
|
jsx: true,
|
|
@@ -25,11 +23,8 @@ const main = [
|
|
|
25
23
|
//
|
|
26
24
|
// react
|
|
27
25
|
//
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
// TODO: wait for a types fix
|
|
31
|
-
/** @type {typeof import('typescript-eslint').configs.base} */ (react.configs.flat.recommended),
|
|
32
|
-
/** @type {typeof import('typescript-eslint').configs.base} */ (react.configs.flat['jsx-runtime']),
|
|
26
|
+
react.configs.flat.recommended,
|
|
27
|
+
react.configs.flat['jsx-runtime'],
|
|
33
28
|
{
|
|
34
29
|
settings: {
|
|
35
30
|
react: {
|
|
@@ -56,14 +51,7 @@ const main = [
|
|
|
56
51
|
//
|
|
57
52
|
// react-hooks
|
|
58
53
|
//
|
|
59
|
-
|
|
60
|
-
{
|
|
61
|
-
files: ['**/**/*.{js,ts,jsx,tsx}'],
|
|
62
|
-
plugins: {
|
|
63
|
-
'react-hooks': reactHooks,
|
|
64
|
-
},
|
|
65
|
-
rules: reactHooks.configs.recommended.rules,
|
|
66
|
-
},
|
|
54
|
+
reactHooks.configs['recommended-latest'],
|
|
67
55
|
//
|
|
68
56
|
// jsx-a11y
|
|
69
57
|
//
|
package/package.json
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thermarthae/eslint-config",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
3
|
+
"version": "6.0.0",
|
|
4
|
+
"exports": {
|
|
5
|
+
".": {
|
|
6
|
+
"types": "./index.d.ts",
|
|
7
|
+
"import": "./index.js",
|
|
8
|
+
"default": "./index.js"
|
|
9
|
+
},
|
|
10
|
+
"./base": {
|
|
11
|
+
"types": "./base.d.ts",
|
|
12
|
+
"import": "./base.js",
|
|
13
|
+
"default": "./base.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
5
16
|
"description": "Just a personal eslint config",
|
|
6
17
|
"type": "module",
|
|
7
18
|
"license": "MIT",
|
|
@@ -16,34 +27,33 @@
|
|
|
16
27
|
"index.js",
|
|
17
28
|
"index.d.ts"
|
|
18
29
|
],
|
|
19
|
-
"packageManager": "yarn@4.
|
|
30
|
+
"packageManager": "yarn@4.9.2+sha512.1fc009bc09d13cfd0e19efa44cbfc2b9cf6ca61482725eb35bbc5e257e093ebf4130db6dfe15d604ff4b79efd8e1e8e99b25fa7d0a6197c9f9826358d4d65c3c",
|
|
20
31
|
"scripts": {
|
|
21
32
|
"pnpify": "yarn dlx @yarnpkg/sdks vscode"
|
|
22
33
|
},
|
|
23
34
|
"devDependencies": {
|
|
24
|
-
"@eslint/js": "^9.
|
|
25
|
-
"@stylistic/eslint-plugin": "^
|
|
26
|
-
"@types/eslint-plugin-jsx-a11y": "^6.
|
|
27
|
-
"@types/
|
|
28
|
-
"
|
|
29
|
-
"eslint": "^
|
|
30
|
-
"eslint-plugin-
|
|
31
|
-
"eslint-plugin-react": "^
|
|
32
|
-
"eslint-plugin-react-hooks": "^5.0.0",
|
|
35
|
+
"@eslint/js": "^9.29.0",
|
|
36
|
+
"@stylistic/eslint-plugin": "^4.4.1",
|
|
37
|
+
"@types/eslint-plugin-jsx-a11y": "^6.10.0",
|
|
38
|
+
"@types/node": "^24.0.3",
|
|
39
|
+
"eslint": "^9.29.0",
|
|
40
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
41
|
+
"eslint-plugin-react": "^7.37.5",
|
|
42
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
33
43
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
34
|
-
"typescript": "^5.
|
|
35
|
-
"typescript-eslint": "^8.
|
|
44
|
+
"typescript": "^5.8.3",
|
|
45
|
+
"typescript-eslint": "^8.34.1"
|
|
36
46
|
},
|
|
37
47
|
"peerDependencies": {
|
|
38
|
-
"@eslint/js": "^9.
|
|
39
|
-
"@stylistic/eslint-plugin": "^
|
|
40
|
-
"eslint": "^9.
|
|
41
|
-
"eslint-plugin-jsx-a11y": "^6.10.
|
|
42
|
-
"eslint-plugin-react": "^7.37.
|
|
43
|
-
"eslint-plugin-react-hooks": "^5.
|
|
48
|
+
"@eslint/js": "^9.29.0",
|
|
49
|
+
"@stylistic/eslint-plugin": "^4.4.1 || ^5.0.0",
|
|
50
|
+
"eslint": "^9.29.0",
|
|
51
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
52
|
+
"eslint-plugin-react": "^7.37.5",
|
|
53
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
44
54
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
45
|
-
"typescript": "^5.
|
|
46
|
-
"typescript-eslint": "^8.
|
|
55
|
+
"typescript": "^5.8.3",
|
|
56
|
+
"typescript-eslint": "^8.34.1"
|
|
47
57
|
},
|
|
48
58
|
"peerDependenciesMeta": {
|
|
49
59
|
"eslint-plugin-jsx-a11y": {
|