@viclafouch/eslint-config-viclafouch 3.3.0 → 3.3.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/.eslintrc.js CHANGED
@@ -2,9 +2,8 @@ module.exports = {
2
2
  plugins: ['react', 'simple-import-sort'],
3
3
  extends: [
4
4
  'eslint:recommended',
5
- 'plugin:react/recommended',
6
- 'plugin:react-hooks/recommended',
7
- 'plugin:jsx-a11y/recommended',
5
+ 'airbnb',
6
+ 'airbnb/hooks',
8
7
  'plugin:prettier/recommended'
9
8
  ],
10
9
  env: {
package/README.md CHANGED
@@ -4,6 +4,20 @@
4
4
 
5
5
  These are my ESLint and Prettier settings for a React.js project ⚡️
6
6
 
7
+
8
+ # Table of Contents
9
+
10
+ - [Eslint / Prettier Setup of @viclafouch 📦](#eslint--prettier-setup-of-viclafouch-)
11
+ - [Table of Contents](#table-of-contents)
12
+ - [What it does](#what-it-does)
13
+ - [Local / Per Project Install](#local--per-project-install)
14
+ - [If you use JavaScript](#if-you-use-javascript)
15
+ - [Scripts](#scripts)
16
+ - [If you use TypeScript](#if-you-use-typescript)
17
+ - [Scripts](#scripts-1)
18
+ - [With VS Code](#with-vs-code)
19
+ - [With Create React App](#with-create-react-app)
20
+
7
21
  ## What it does
8
22
 
9
23
  * Lints JavaScript based on the latest standards
@@ -24,6 +38,8 @@ npx install-peerdeps --dev @viclafouch/eslint-config-viclafouch
24
38
 
25
39
  4. Create a `.eslintrc` file in the root of your project's directory (it should live where package.json does). Your `.eslintrc` file should look like this:
26
40
 
41
+ ## If you use JavaScript
42
+
27
43
  ```json
28
44
  {
29
45
  "extends": [
@@ -32,12 +48,55 @@ npx install-peerdeps --dev @viclafouch/eslint-config-viclafouch
32
48
  }
33
49
  ```
34
50
 
35
- 5. You can add two scripts to your package.json to lint and/or fix:
51
+ Then, you can remove these unnecessary packages (you don't need the TypeScript support)
52
+
53
+ ```diff
54
+ "devDependencies": {
55
+ - "@typescript-eslint/eslint-plugin": "5.4.0",
56
+ - "@typescript-eslint/parser": "5.4.0",
57
+ - "typescript": "4.5.2"
58
+ },
59
+ ```
60
+
61
+ ### Scripts
62
+
63
+ You can add two scripts to your package.json to lint and/or fix your code:
36
64
 
37
65
  ```json
38
66
  "scripts": {
39
67
  "lint": "eslint .",
40
- "lint:fix": "eslint . --fix"
68
+ "lint:fix": "npm run lint -- --fix",
69
+ },
70
+ ```
71
+ ## If you use TypeScript
72
+
73
+ ```json
74
+ {
75
+ "extends": [
76
+ "@viclafouch/eslint-config-viclafouch/typescript"
77
+ ]
78
+ }
79
+ ```
80
+
81
+ Then, you can remove these unnecessary packages (you don't the Babel parser, we use `@typescript-eslint/parser`).
82
+
83
+
84
+ ```diff
85
+ "devDependencies": {
86
+ - "@babel/core": "7.16.0",
87
+ - "@babel/eslint-parser": "7.16.3"
88
+ ...
89
+ },
90
+ ```
91
+
92
+ ### Scripts
93
+
94
+ You can add two scripts to your package.json to lint and/or fix your code:
95
+
96
+ ```json
97
+ "scripts": {
98
+ "lint": "tsc --noEmit && eslint . --ext .js,.jsx,.ts,.tsx",
99
+ "lint:fix": "npm run lint -- --fix",
41
100
  },
42
101
  ```
43
102
 
@@ -46,7 +105,7 @@ npx install-peerdeps --dev @viclafouch/eslint-config-viclafouch
46
105
  Once you have done. You probably want your editor to lint and fix for you.
47
106
 
48
107
  1. Install the [ESLint package](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
49
- 2. Now we need to setup some VS Code settings via `Code/File` `Preferences` `Settings`. Click to the `{}` icon in the top right corner and add this :
108
+ 2. Now we need to setup some VS Code settings. Create a `.vscode` folder at your root project, and create a `settings.json` file in this folder. Then, add this little config:
50
109
 
51
110
  ```js
52
111
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viclafouch/eslint-config-viclafouch",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "ESLint and Prettier Config from Victor de la Fouchardiere",
5
5
  "main": "index.js",
6
6
  "keywords": [
package/typescript.js CHANGED
@@ -2,17 +2,12 @@ module.exports = {
2
2
  extends: [
3
3
  'airbnb',
4
4
  'airbnb-typescript',
5
- 'airbnb/hooks',
6
5
  'plugin:@typescript-eslint/recommended',
7
- 'plugin:prettier/recommended',
8
6
  './.eslintrc.js'
9
7
  ],
10
8
  parser: '@typescript-eslint/parser',
11
9
  plugins: ['react', '@typescript-eslint', 'simple-import-sort'],
12
10
  rules: {
13
11
  '@typescript-eslint/ban-ts-comment': 'off'
14
- },
15
- parserOptions: {
16
- project: './tsconfig.json'
17
12
  }
18
13
  }