@seanblonien/eslint-config-react 0.0.1
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 +21 -0
- package/README.md +46 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +61 -0
- package/dist/index.js.map +1 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Sean Blonien
|
|
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,46 @@
|
|
|
1
|
+
# @seanblonien/eslint-config-react
|
|
2
|
+
|
|
3
|
+
ESLint flat config for React projects, extending the base config.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add -D eslint @seanblonien/eslint-config-react
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
You'll also need to install the peer dependencies:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add -D @seanblonien/eslint-config-base eslint-plugin-import eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
Create an `eslint.config.js` file in your project root:
|
|
20
|
+
|
|
21
|
+
```javascript
|
|
22
|
+
import reactConfig from '@seanblonien/eslint-config-react';
|
|
23
|
+
|
|
24
|
+
export default [...reactConfig];
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or with TypeScript (`eslint.config.ts`):
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import reactConfig from '@seanblonien/eslint-config-react';
|
|
31
|
+
|
|
32
|
+
export default [...reactConfig];
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## What's Included
|
|
36
|
+
|
|
37
|
+
This config extends `@seanblonien/eslint-config-base` and adds:
|
|
38
|
+
|
|
39
|
+
- `eslint-plugin-react` with recommended rules
|
|
40
|
+
- `eslint-plugin-react-hooks` for React Hooks rules
|
|
41
|
+
- `eslint-plugin-jsx-a11y` for accessibility rules
|
|
42
|
+
- Automatic React version detection
|
|
43
|
+
|
|
44
|
+
## License
|
|
45
|
+
|
|
46
|
+
MIT © Sean Blonien
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import baseConfig from "@seanblonien/eslint-config-base";
|
|
3
|
+
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
4
|
+
import reactPlugin from "eslint-plugin-react";
|
|
5
|
+
import reactCompilerPlugin from "eslint-plugin-react-compiler";
|
|
6
|
+
import reactHooks from "eslint-plugin-react-hooks";
|
|
7
|
+
import reactHooksAddonsPlugin from "eslint-plugin-react-hooks-addons";
|
|
8
|
+
var config = [
|
|
9
|
+
// Spread base config
|
|
10
|
+
...baseConfig,
|
|
11
|
+
// React compiler and hooks addons
|
|
12
|
+
reactCompilerPlugin.configs.recommended,
|
|
13
|
+
reactHooksAddonsPlugin.configs.recommended,
|
|
14
|
+
reactPlugin.configs.flat.recommended,
|
|
15
|
+
reactHooks.configs.flat.recommended,
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- incorrect type definition from package
|
|
17
|
+
jsxA11y.flatConfigs.recommended,
|
|
18
|
+
// React plugin configuration
|
|
19
|
+
{
|
|
20
|
+
files: ["**/*.jsx", "**/*.tsx"],
|
|
21
|
+
languageOptions: {
|
|
22
|
+
parserOptions: {
|
|
23
|
+
ecmaFeatures: {
|
|
24
|
+
jsx: true
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
settings: {
|
|
29
|
+
react: {
|
|
30
|
+
version: "detect"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
rules: {
|
|
34
|
+
// Custom React rules
|
|
35
|
+
"react/prop-types": "off",
|
|
36
|
+
// TypeScript handles this
|
|
37
|
+
"react/react-in-jsx-scope": "off",
|
|
38
|
+
// Not needed with new JSX transform
|
|
39
|
+
"react/jsx-uses-react": "off",
|
|
40
|
+
// Not needed with new JSX transform
|
|
41
|
+
"react/jsx-curly-brace-presence": [
|
|
42
|
+
"error",
|
|
43
|
+
{ props: "never", children: "never" }
|
|
44
|
+
],
|
|
45
|
+
"react/self-closing-comp": "error",
|
|
46
|
+
"react/jsx-boolean-value": ["error", "never"],
|
|
47
|
+
"react/function-component-definition": [
|
|
48
|
+
"error",
|
|
49
|
+
{
|
|
50
|
+
namedComponents: "arrow-function",
|
|
51
|
+
unnamedComponents: "arrow-function"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
];
|
|
57
|
+
var index_default = config;
|
|
58
|
+
export {
|
|
59
|
+
index_default as default
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention -- config file */\nimport baseConfig from '@seanblonien/eslint-config-base';\n// @ts-expect-error - no types available\nimport jsxA11y from 'eslint-plugin-jsx-a11y';\nimport reactPlugin from 'eslint-plugin-react';\nimport reactCompilerPlugin from 'eslint-plugin-react-compiler';\nimport reactHooks from 'eslint-plugin-react-hooks';\nimport reactHooksAddonsPlugin from 'eslint-plugin-react-hooks-addons';\nimport type { Linter } from 'eslint';\n\nconst config: Linter.Config[] = [\n // Spread base config\n ...baseConfig,\n\n // React compiler and hooks addons\n reactCompilerPlugin.configs.recommended,\n reactHooksAddonsPlugin.configs.recommended,\n reactPlugin.configs.flat.recommended,\n (reactHooks.configs as unknown as { flat: { recommended: Linter.Config } }\n ).flat.recommended,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- incorrect type definition from package\n jsxA11y.flatConfigs.recommended as Linter.Config,\n\n // React plugin configuration\n {\n files: ['**/*.jsx', '**/*.tsx'],\n languageOptions: {\n parserOptions: {\n ecmaFeatures: {\n jsx: true,\n },\n },\n },\n settings: {\n react: {\n version: 'detect',\n },\n },\n rules: {\n // Custom React rules\n 'react/prop-types': 'off', // TypeScript handles this\n 'react/react-in-jsx-scope': 'off', // Not needed with new JSX transform\n 'react/jsx-uses-react': 'off', // Not needed with new JSX transform\n 'react/jsx-curly-brace-presence': [\n 'error',\n { props: 'never', children: 'never' },\n ],\n 'react/self-closing-comp': 'error',\n 'react/jsx-boolean-value': ['error', 'never'],\n 'react/function-component-definition': [\n 'error',\n {\n namedComponents: 'arrow-function',\n unnamedComponents: 'arrow-function',\n },\n ],\n },\n },\n];\n\nexport default config;\n\n/* eslint-enable @typescript-eslint/naming-convention */\n"],"mappings":";AACA,OAAO,gBAAgB;AAEvB,OAAO,aAAa;AACpB,OAAO,iBAAiB;AACxB,OAAO,yBAAyB;AAChC,OAAO,gBAAgB;AACvB,OAAO,4BAA4B;AAGnC,IAAM,SAA0B;AAAA;AAAA,EAE9B,GAAG;AAAA;AAAA,EAGH,oBAAoB,QAAQ;AAAA,EAC5B,uBAAuB,QAAQ;AAAA,EAC/B,YAAY,QAAQ,KAAK;AAAA,EACxB,WAAW,QACV,KAAK;AAAA;AAAA,EAEP,QAAQ,YAAY;AAAA;AAAA,EAGpB;AAAA,IACE,OAAO,CAAC,YAAY,UAAU;AAAA,IAC9B,iBAAiB;AAAA,MACf,eAAe;AAAA,QACb,cAAc;AAAA,UACZ,KAAK;AAAA,QACP;AAAA,MACF;AAAA,IACF;AAAA,IACA,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,OAAO;AAAA;AAAA,MAEL,oBAAoB;AAAA;AAAA,MACpB,4BAA4B;AAAA;AAAA,MAC5B,wBAAwB;AAAA;AAAA,MACxB,kCAAkC;AAAA,QAChC;AAAA,QACA,EAAE,OAAO,SAAS,UAAU,QAAQ;AAAA,MACtC;AAAA,MACA,2BAA2B;AAAA,MAC3B,2BAA2B,CAAC,SAAS,OAAO;AAAA,MAC5C,uCAAuC;AAAA,QACrC;AAAA,QACA;AAAA,UACE,iBAAiB;AAAA,UACjB,mBAAmB;AAAA,QACrB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,gBAAQ;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@seanblonien/eslint-config-react",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "ESLint flat config for React projects, extending base config",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"keywords": [
|
|
18
|
+
"eslint",
|
|
19
|
+
"eslint-config",
|
|
20
|
+
"flat-config",
|
|
21
|
+
"react",
|
|
22
|
+
"jsx",
|
|
23
|
+
"typescript"
|
|
24
|
+
],
|
|
25
|
+
"author": "Sean Blonien",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"eslint": "^9.0.0",
|
|
29
|
+
"eslint-plugin-import": "^2.31.0",
|
|
30
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
31
|
+
"eslint-plugin-react": "^7.37.2",
|
|
32
|
+
"eslint-plugin-react-hooks": "^5.1.0",
|
|
33
|
+
"@seanblonien/eslint-config-base": "0.0.1"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@types/node": "^24.10.1",
|
|
37
|
+
"eslint": "^9.39.1",
|
|
38
|
+
"eslint-plugin-import": "^2.32.0",
|
|
39
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
40
|
+
"eslint-plugin-react": "^7.37.5",
|
|
41
|
+
"eslint-plugin-react-compiler": "19.1.0-rc.2",
|
|
42
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
43
|
+
"eslint-plugin-react-hooks-addons": "^0.5.0",
|
|
44
|
+
"tsup": "^8.5.1",
|
|
45
|
+
"typescript": "^5.9.3",
|
|
46
|
+
"vitest": "^4.0.9",
|
|
47
|
+
"@seanblonien/eslint-config-base": "0.0.1"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsup",
|
|
54
|
+
"clean": "rm -rf dist",
|
|
55
|
+
"lint": "eslint . --fix",
|
|
56
|
+
"test": "vitest run"
|
|
57
|
+
}
|
|
58
|
+
}
|