質問編集履歴

7

修正

2018/05/27 08:00

投稿

退会済みユーザー
test CHANGED
@@ -1 +1 @@
1
- eslintとprettierの併用方法を教えてください。
1
+ eslintとprettierの併用ほうほう
test CHANGED
@@ -1 +1 @@
1
- eslintとprettierの併用方法教えてただけないでか。
1
+ eslintとprettierをようてして使方法につきまして

6

修正

2018/05/27 08:00

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -1,5 +1 @@
1
- eslintを実行時に、prettierでコードフォーマットしからeslintを実行したいすが、
1
+ eslintprettierの併用方法教えだけないでしょうか。
2
-
3
- いまいちやり方がわからず困っています。
4
-
5
- 教えていただけないでしょうか?

5

修正

2018/05/27 07:59

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -3,165 +3,3 @@
3
3
  いまいちやり方がわからず困っています。
4
4
 
5
5
  教えていただけないでしょうか?
6
-
7
-
8
-
9
- 下記はpackage.jsonとeslintとprettierの設定になります。
10
-
11
- ```package.json
12
-
13
- // package.json
14
-
15
-
16
-
17
- {
18
-
19
- "name": "hogehoge",
20
-
21
- "version": "1.0.0",
22
-
23
- "description": "",
24
-
25
- "main": "index.js",
26
-
27
- "scripts": {
28
-
29
- "eslint:fix": "eslint --fix src",
30
-
31
- "format": "onchange 'src/**/*.js' -- npm run eslint:fix"
32
-
33
- },
34
-
35
- "keywords": [],
36
-
37
- "author": "",
38
-
39
- "license": "ISC",
40
-
41
- "dependencies": {},
42
-
43
- "devDependencies": {
44
-
45
- "eslint": "^4.19.1",
46
-
47
- "eslint-config-prettier": "^2.9.0",
48
-
49
- "eslint-loader": "^2.0.0",
50
-
51
- "eslint-plugin-import": "^2.11.0",
52
-
53
- "eslint-plugin-node": "^6.0.1",
54
-
55
- "eslint-plugin-prettier": "^2.6.0",
56
-
57
- "eslint-plugin-standard": "^3.1.0",
58
-
59
- "onchange": "^3.3.0",
60
-
61
- "prettier": "^1.12.1"
62
-
63
- }
64
-
65
- }
66
-
67
- ```
68
-
69
-
70
-
71
- ```.json
72
-
73
- // .eslintrc.json
74
-
75
-
76
-
77
- {
78
-
79
- "extends": [
80
-
81
- "standard",
82
-
83
- "prettier",
84
-
85
- ],
86
-
87
- "env": {
88
-
89
- "browser": true,
90
-
91
- "node": true,
92
-
93
- "es6": true
94
-
95
- },
96
-
97
- "plugins": [
98
-
99
- "prettier",
100
-
101
- "standard"
102
-
103
- ],
104
-
105
- "parserOptions": {
106
-
107
- "sourceType": "module",
108
-
109
- "ecmaFeatures": {
110
-
111
- "jsx": true
112
-
113
- }
114
-
115
- },
116
-
117
- "rules": {
118
-
119
- "import/no-unresolved": "off",
120
-
121
- "react/prop-types": "off",
122
-
123
- "no-console": "off"
124
-
125
- }
126
-
127
- }
128
-
129
- ```
130
-
131
-
132
-
133
- ```.prettierrc
134
-
135
- // .prettierrc
136
-
137
-
138
-
139
- {
140
-
141
- "semi": false,
142
-
143
- "overrides": [
144
-
145
- {
146
-
147
- "files": "src/**/*.js",
148
-
149
- "options": {
150
-
151
- "printWidth": 10,
152
-
153
- "bracketSpacing": true,
154
-
155
- "semi": false,
156
-
157
- "singleQuote": false
158
-
159
- }
160
-
161
- }
162
-
163
- ]
164
-
165
- }
166
-
167
- ```

4

修正

2018/05/27 07:58

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -28,7 +28,7 @@
28
28
 
29
29
  "eslint:fix": "eslint --fix src",
30
30
 
31
- "format": "onchange 'src/**/*.js' -- npm run eslint:fix" // これだとeslint実行後にterminalが終了してしまいます。
31
+ "format": "onchange 'src/**/*.js' -- npm run eslint:fix"
32
32
 
33
33
  },
34
34
 

3

修正

2018/05/27 07:47

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -44,25 +44,15 @@
44
44
 
45
45
  "eslint": "^4.19.1",
46
46
 
47
- "eslint-config-airbnb": "^16.1.0",
48
-
49
47
  "eslint-config-prettier": "^2.9.0",
50
-
51
- "eslint-config-standard": "^11.0.0",
52
48
 
53
49
  "eslint-loader": "^2.0.0",
54
50
 
55
51
  "eslint-plugin-import": "^2.11.0",
56
52
 
57
- "eslint-plugin-jsx-a11y": "^6.0.3",
58
-
59
53
  "eslint-plugin-node": "^6.0.1",
60
54
 
61
55
  "eslint-plugin-prettier": "^2.6.0",
62
-
63
- "eslint-plugin-promise": "^3.7.0",
64
-
65
- "eslint-plugin-react": "^7.7.0",
66
56
 
67
57
  "eslint-plugin-standard": "^3.1.0",
68
58
 
@@ -90,15 +80,7 @@
90
80
 
91
81
  "standard",
92
82
 
93
- "airbnb",
94
-
95
- "plugin:react/recommended",
96
-
97
83
  "prettier",
98
-
99
- "prettier/react",
100
-
101
- "prettier/standard"
102
84
 
103
85
  ],
104
86
 
@@ -113,10 +95,6 @@
113
95
  },
114
96
 
115
97
  "plugins": [
116
-
117
- "react",
118
-
119
- "jsx-a11y",
120
98
 
121
99
  "prettier",
122
100
 

2

修正

2018/05/27 07:40

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -26,9 +26,9 @@
26
26
 
27
27
  "scripts": {
28
28
 
29
- "lint": "eslint --fix src",
29
+ "eslint:fix": "eslint --fix src",
30
30
 
31
- "format": "onchange 'src/**/*.js' -- npm run lint" // これだとeslint実行後にterminalが終了してしまいます。
31
+ "format": "onchange 'src/**/*.js' -- npm run eslint:fix" // これだとeslint実行後にterminalが終了してしまいます。
32
32
 
33
33
  },
34
34
 
@@ -140,57 +140,9 @@
140
140
 
141
141
  "import/no-unresolved": "off",
142
142
 
143
- "react/jsx-filename-extension": [
144
-
145
- 1,
146
-
147
- {
148
-
149
- "extensions": [
150
-
151
- ".js",
152
-
153
- ".jsx"
154
-
155
- ]
156
-
157
- }
158
-
159
- ],
160
-
161
- "no-magic-numbers": [
162
-
163
- "error",
164
-
165
- {
166
-
167
- "ignore": [
168
-
169
- -1,
170
-
171
- 0,
172
-
173
- 1
174
-
175
- ]
176
-
177
- }
178
-
179
- ],
180
-
181
143
  "react/prop-types": "off",
182
144
 
183
- "no-console": "off",
145
+ "no-console": "off"
184
-
185
- "yoda": 0
186
-
187
- },
188
-
189
- "globals": {
190
-
191
- "$": false,
192
-
193
- "google": true
194
146
 
195
147
  }
196
148
 

1

修正

2018/05/27 07:38

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  {
18
18
 
19
- "name": "gourmeet",
19
+ "name": "hogehoge",
20
20
 
21
21
  "version": "1.0.0",
22
22