Skip to content

Commit 348166a

Browse files
YuriGorklyburke
authored andcommitted
use prettier as eslint plugin (#170)
* Handlebars replaced by lodash.template(#128) SES region option moved to .env(#124) * Delete .gitignore * keep .gitignore the same in all Chapters * keep `EmailTemplate.js` in main repo the same for now * use prettier as eslint plugin. * bad merge from upstream fixed * try to rollback unnecessary changes
1 parent d0706ff commit 348166a

34 files changed

+287
-67
lines changed

.eslintrc.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module.exports = {
22
parser: 'babel-eslint',
3-
extends: 'airbnb',
3+
extends: ['airbnb', 'plugin:prettier/recommended'],
44
env: {
55
browser: true,
66
jest: true,
77
},
8-
plugins: ['react', 'jsx-a11y', 'import'],
8+
plugins: ['react', 'jsx-a11y', 'import', 'prettier'],
99
rules: {
1010
'max-len': ['error', 100],
1111
'no-underscore-dangle': ['error', { allow: ['_id'] }],
@@ -35,5 +35,14 @@ module.exports = {
3535
extensions: ['.js'],
3636
},
3737
],
38+
'prettier/prettier': [
39+
'error',
40+
{
41+
singleQuote: true,
42+
trailingComma: 'all',
43+
arrowParens: 'always',
44+
printWidth: 100,
45+
},
46+
],
3847
},
3948
};

boilerplate/.eslintrc.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
module.exports = {
22
parser: 'babel-eslint',
3-
extends: 'airbnb',
3+
extends: ['airbnb', 'plugin:prettier/recommended'],
44
env: {
55
browser: true,
66
jest: true,
77
},
8-
plugins: ['react', 'jsx-a11y', 'import'],
8+
plugins: ['react', 'jsx-a11y', 'import', 'prettier'],
99
rules: {
1010
'max-len': ['error', 100],
1111
'no-underscore-dangle': ['error', { allow: ['_id'] }],
12+
'no-mixed-operators': 'off',
1213
'prefer-destructuring': [
1314
'error',
1415
{
@@ -34,5 +35,14 @@ module.exports = {
3435
extensions: ['.js'],
3536
},
3637
],
38+
'prettier/prettier': [
39+
'error',
40+
{
41+
singleQuote: true,
42+
trailingComma: 'all',
43+
arrowParens: 'always',
44+
printWidth: 100,
45+
},
46+
],
3747
},
3848
};

boilerplate/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
"eslint-plugin-import": "^2.14.0",
3535
"eslint-plugin-jsx-a11y": "^6.1.2",
3636
"eslint-plugin-react": "^7.11.1",
37-
"nodemon": "^1.18.4"
37+
"nodemon": "^1.18.4",
38+
"eslint-config-prettier": "^3.3.0",
39+
"eslint-plugin-prettier": "^3.0.0",
40+
"prettier": "^1.15.3"
3841
}
39-
}
42+
}

book/1-end/.eslintrc.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
module.exports = {
22
parser: 'babel-eslint',
3-
extends: 'airbnb',
3+
extends: ['airbnb', 'plugin:prettier/recommended'],
44
env: {
55
browser: true,
66
jest: true,
77
},
8-
plugins: ['react', 'jsx-a11y', 'import'],
8+
plugins: ['react', 'jsx-a11y', 'import', 'prettier'],
99
rules: {
1010
'max-len': ['error', 100],
1111
'no-underscore-dangle': ['error', { allow: ['_id'] }],
12+
'no-mixed-operators': 'off',
1213
'prefer-destructuring': [
1314
'error',
1415
{
@@ -34,5 +35,14 @@ module.exports = {
3435
extensions: ['.js'],
3536
},
3637
],
38+
'prettier/prettier': [
39+
'error',
40+
{
41+
singleQuote: true,
42+
trailingComma: 'all',
43+
arrowParens: 'always',
44+
printWidth: 100,
45+
},
46+
],
3747
},
3848
};

book/1-end/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
"eslint-config-airbnb": "^17.1.0",
2323
"eslint-plugin-import": "^2.14.0",
2424
"eslint-plugin-jsx-a11y": "^6.1.2",
25-
"eslint-plugin-react": "^7.11.1"
25+
"eslint-plugin-react": "^7.11.1",
26+
"eslint-config-prettier": "^3.3.0",
27+
"eslint-plugin-prettier": "^3.0.0",
28+
"prettier": "^1.15.3"
2629
}
27-
}
30+
}

book/2-end/.eslintrc.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
module.exports = {
22
parser: 'babel-eslint',
3-
extends: 'airbnb',
3+
extends: ['airbnb', 'plugin:prettier/recommended'],
44
env: {
55
browser: true,
66
jest: true,
77
},
8-
plugins: ['react', 'jsx-a11y', 'import'],
8+
plugins: ['react', 'jsx-a11y', 'import', 'prettier'],
99
rules: {
1010
'max-len': ['error', 100],
1111
'no-underscore-dangle': ['error', { allow: ['_id'] }],
12+
'no-mixed-operators': 'off',
1213
'prefer-destructuring': [
1314
'error',
1415
{
@@ -34,5 +35,14 @@ module.exports = {
3435
extensions: ['.js'],
3536
},
3637
],
38+
'prettier/prettier': [
39+
'error',
40+
{
41+
singleQuote: true,
42+
trailingComma: 'all',
43+
arrowParens: 'always',
44+
printWidth: 100,
45+
},
46+
],
3747
},
3848
};

book/2-end/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
"eslint-plugin-import": "^2.14.0",
3333
"eslint-plugin-jsx-a11y": "^6.1.2",
3434
"eslint-plugin-react": "^7.11.1",
35-
"nodemon": "^1.18.4"
35+
"nodemon": "^1.18.4",
36+
"eslint-config-prettier": "^3.3.0",
37+
"eslint-plugin-prettier": "^3.0.0",
38+
"prettier": "^1.15.3"
3639
}
37-
}
40+
}

book/2-start/.eslintrc.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
module.exports = {
22
parser: 'babel-eslint',
3-
extends: 'airbnb',
3+
extends: ['airbnb', 'plugin:prettier/recommended'],
44
env: {
55
browser: true,
66
jest: true,
77
},
8-
plugins: ['react', 'jsx-a11y', 'import'],
8+
plugins: ['react', 'jsx-a11y', 'import', 'prettier'],
99
rules: {
1010
'max-len': ['error', 100],
1111
'no-underscore-dangle': ['error', { allow: ['_id'] }],
12+
'no-mixed-operators': 'off',
1213
'prefer-destructuring': [
1314
'error',
1415
{
@@ -34,5 +35,14 @@ module.exports = {
3435
extensions: ['.js'],
3536
},
3637
],
38+
'prettier/prettier': [
39+
'error',
40+
{
41+
singleQuote: true,
42+
trailingComma: 'all',
43+
arrowParens: 'always',
44+
printWidth: 100,
45+
},
46+
],
3747
},
3848
};

book/2-start/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
"eslint-plugin-import": "^2.14.0",
3232
"eslint-plugin-jsx-a11y": "^6.1.2",
3333
"eslint-plugin-react": "^7.11.1",
34-
"nodemon": "^1.18.4"
34+
"nodemon": "^1.18.4",
35+
"eslint-config-prettier": "^3.3.0",
36+
"eslint-plugin-prettier": "^3.0.0",
37+
"prettier": "^1.15.3"
3538
}
36-
}
39+
}

book/3-end/.eslintrc.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
module.exports = {
22
parser: 'babel-eslint',
3-
extends: 'airbnb',
3+
extends: ['airbnb', 'plugin:prettier/recommended'],
44
env: {
55
browser: true,
66
jest: true,
77
},
8-
plugins: ['react', 'jsx-a11y', 'import'],
8+
plugins: ['react', 'jsx-a11y', 'import', 'prettier'],
99
rules: {
1010
'max-len': ['error', 100],
1111
'no-underscore-dangle': ['error', { allow: ['_id'] }],
12+
'no-mixed-operators': 'off',
1213
'prefer-destructuring': [
1314
'error',
1415
{
@@ -34,5 +35,14 @@ module.exports = {
3435
extensions: ['.js'],
3536
},
3637
],
38+
'prettier/prettier': [
39+
'error',
40+
{
41+
singleQuote: true,
42+
trailingComma: 'all',
43+
arrowParens: 'always',
44+
printWidth: 100,
45+
},
46+
],
3747
},
3848
};

0 commit comments

Comments
 (0)