@lionstone-digital/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 ADDED
@@ -0,0 +1,7 @@
1
+ Copyright © 2024-present, Lionstone Digital
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.MD ADDED
@@ -0,0 +1,3 @@
1
+ # ESLint Config for React
2
+
3
+ Helpful eslint config for projects with React.
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@lionstone-digital/eslint-config-react",
3
+ "version": "0.0.1",
4
+ "description": "Helpful eslint config for projects with React",
5
+ "keywords": [
6
+ "eslint",
7
+ "eslint-config",
8
+ "react",
9
+ "dev-toolkit",
10
+ "lionstone-digital"
11
+ ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/lionstone-digital/dev-toolkit"
15
+ },
16
+ "license": "MIT",
17
+ "author": "Frederick Chan",
18
+ "type": "module",
19
+ "exports": {
20
+ ".": "./src/index.js"
21
+ },
22
+ "main": "src/index.js",
23
+ "files": [
24
+ "src"
25
+ ],
26
+ "dependencies": {
27
+ "eslint-plugin-jsx-a11y": "^6.10.2",
28
+ "eslint-plugin-react": "^7.37.5",
29
+ "eslint-plugin-react-hooks": "^5.2.0",
30
+ "eslint-plugin-react-refresh": "^0.4.20",
31
+ "@lionstone-digital/eslint-config": "0.0.1"
32
+ },
33
+ "peerDependencies": {
34
+ "eslint": ">= 9.25.1",
35
+ "prettier": ">= 3.5.3",
36
+ "react": ">= 18.3.1"
37
+ },
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
41
+ "scripts": {}
42
+ }
package/src/index.js ADDED
@@ -0,0 +1,55 @@
1
+ import eslintConfigBaseCore from '@lionstone-digital/eslint-config/core'
2
+ import eslintConfigBasePrettier from '@lionstone-digital/eslint-config/prettier'
3
+ import eslintJsxA11y from 'eslint-plugin-jsx-a11y'
4
+ import eslintReact from 'eslint-plugin-react'
5
+ import eslintPluginReactHooks from 'eslint-plugin-react-hooks'
6
+ import eslintReactRefresh from 'eslint-plugin-react-refresh'
7
+
8
+ export default [
9
+ // Core
10
+ ...eslintConfigBaseCore,
11
+
12
+ // For React
13
+ eslintReact.configs.flat.recommended,
14
+ {
15
+ settings: {
16
+ react: {
17
+ // Dev should explicitly override/set the version on each project to improve performance
18
+ version: 'detect'
19
+ }
20
+ },
21
+ rules: {
22
+ 'react/react-in-jsx-scope': 'off',
23
+ 'react/no-unknown-property': 'warn',
24
+ 'react/prop-types': 'off'
25
+ }
26
+ },
27
+ {
28
+ plugins: {
29
+ 'react-refresh': eslintReactRefresh
30
+ },
31
+ rules: {
32
+ 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }]
33
+ }
34
+ },
35
+ eslintPluginReactHooks.configs['recommended-latest'],
36
+ eslintJsxA11y.flatConfigs.recommended,
37
+ {
38
+ rules: {
39
+ 'jsx-a11y/alt-text': [
40
+ 'warn',
41
+ {
42
+ elements: ['img']
43
+ }
44
+ ],
45
+ 'jsx-a11y/aria-props': 'warn',
46
+ 'jsx-a11y/aria-proptypes': 'warn',
47
+ 'jsx-a11y/aria-unsupported-elements': 'warn',
48
+ 'jsx-a11y/role-has-required-aria-props': 'warn',
49
+ 'jsx-a11y/role-supports-aria-props': 'warn'
50
+ }
51
+ },
52
+
53
+ // Base Prettier
54
+ ...eslintConfigBasePrettier
55
+ ]