@aliexme/eslint-config 0.2.6 → 0.3.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/README.md CHANGED
@@ -58,6 +58,25 @@ And add the following lines to your ESLint config file:
58
58
  }
59
59
  ```
60
60
 
61
+ ## React Native
62
+
63
+ Install additional packages:
64
+
65
+ ```
66
+ npm i --save-dev eslint-plugin-react-native
67
+ ```
68
+
69
+ And add the following lines to your ESLint config file:
70
+
71
+ ```
72
+ {
73
+ "extends": [
74
+ "@aliexme/eslint-config",
75
+ "@aliexme/eslint-config/react-native",
76
+ ],
77
+ }
78
+ ```
79
+
61
80
  ## Prettier
62
81
 
63
82
  Install additional packages:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aliexme/eslint-config",
3
- "version": "0.2.6",
3
+ "version": "0.3.0",
4
4
  "description": "Rule set for ESLint",
5
5
  "private": false,
6
6
  "author": "Alexander Smirnov <al.smirnov996@gmail.com>",
@@ -24,6 +24,7 @@
24
24
  "./import": "./rules/import.js",
25
25
  "./typescript": "./rules/typescript.js",
26
26
  "./react": "./rules/react.js",
27
+ "./react-native": "./rules/react-native.js",
27
28
  "./prettier": "./rules/prettier.js"
28
29
  },
29
30
  "publishConfig": {
@@ -43,6 +44,7 @@
43
44
  "eslint-plugin-prettier": "4.2.1",
44
45
  "eslint-plugin-react": "7.32.2",
45
46
  "eslint-plugin-react-hooks": "4.6.0",
47
+ "eslint-plugin-react-native": "4.0.0",
46
48
  "husky": "8.0.3",
47
49
  "lint-staged": "13.1.2",
48
50
  "prettier": "2.8.4",
@@ -57,6 +59,7 @@
57
59
  "eslint-plugin-prettier": "^4.2.1",
58
60
  "eslint-plugin-react": "^7.32.2",
59
61
  "eslint-plugin-react-hooks": "^4.6.0",
62
+ "eslint-plugin-react-native": "^4.0.0",
60
63
  "prettier": "^2.8.4"
61
64
  },
62
65
  "peerDependenciesMeta": {
@@ -78,6 +81,9 @@
78
81
  "eslint-plugin-react-hooks": {
79
82
  "optional": true
80
83
  },
84
+ "eslint-plugin-react-native": {
85
+ "optional": true
86
+ },
81
87
  "prettier": {
82
88
  "optional": true
83
89
  }
@@ -0,0 +1,23 @@
1
+ module.exports = {
2
+ "overrides": [
3
+ {
4
+ "files": ["**/*.{jsx,tsx}"],
5
+ "parserOptions": {
6
+ "ecmaFeatures": {
7
+ "jsx": true,
8
+ },
9
+ },
10
+ "env": {
11
+ "react-native/react-native": true,
12
+ },
13
+ "plugins": ["react-native"],
14
+ "extends": ["plugin:import/react-native"],
15
+ "rules": {
16
+ "react-native/no-unused-styles": "error",
17
+ "react-native/no-inline-styles": "error",
18
+ "react-native/no-raw-text": ["error", { "skip": ["Text", "Button"] }],
19
+ "react-native/no-single-element-style-arrays": "error",
20
+ },
21
+ },
22
+ ],
23
+ }
package/rules/react.js CHANGED
@@ -38,7 +38,7 @@ module.exports = {
38
38
  },
39
39
  },
40
40
  {
41
- "files": ["**/*.{tsx}"],
41
+ "files": ["**/*.tsx"],
42
42
  "rules": {
43
43
  "react/prop-types": "off",
44
44
  },