Skip to content

Commit cf8e277

Browse files
committed
build(prettier): add config file
1 parent 28a10fb commit cf8e277

File tree

6 files changed

+70
-22
lines changed

6 files changed

+70
-22
lines changed

.eslintrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
extends: ['eslint-config-ts-lambdas', 'eslint-config-ts-lambdas/react', 'prettier'],
4+
plugins: ['@typescript-eslint'],
5+
settings: {
6+
react: {
7+
pragma: 'React',
8+
version: 'detect',
9+
},
10+
},
11+
parserOptions: {
12+
project: './tsconfig.json',
13+
ecmaFeatures: {
14+
jsx: true,
15+
},
16+
},
17+
rules: {
18+
indent: 0,
19+
'@typescript-eslint/indent': 0,
20+
'@typescript-eslint/member-delimiter-style': 0,
21+
},
22+
}

.prettierignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.github
2+
.next
3+
.now
4+
.circleci
5+
dist
6+
coverage
7+
public
8+
*.mdx
9+
*.md
10+
*.json
11+
*.d.ts
12+
*.yml

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
semi: false
2+
tabWidth: 2
3+
printWidth: 100
4+
trailingComma: 'all'
5+
singleQuote: true
6+
jsxBracketSameLine: true
7+
endOfLine: 'lf'

.prettierrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
semi: false,
3+
tabWidth: 2,
4+
printWidth: 100,
5+
trailingComma: 'all',
6+
singleQuote: true,
7+
jsxBracketSameLine: true,
8+
endOfLine: 'lf',
9+
}

package.json

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"contributor-collect": "node scripts/collect-contributors.js",
3434
"clear": "rm -rf dist",
3535
"lint": "eslint \"{components,lib}/**/*.{js,ts,tsx}\"",
36+
"prettier": "prettier --write .",
3637
"test": "jest --config .jest.config.js --no-cache",
3738
"test-update": "jest --config .jest.config.js --no-cache --update-snapshot",
3839
"coverage": "yarn test --coverage",
@@ -43,28 +44,6 @@
4344
"files": [
4445
"/dist"
4546
],
46-
"eslintConfig": {
47-
"parser": "@typescript-eslint/parser",
48-
"extends": [
49-
"eslint-config-ts-lambdas",
50-
"eslint-config-ts-lambdas/react"
51-
],
52-
"plugins": [
53-
"@typescript-eslint"
54-
],
55-
"settings": {
56-
"react": {
57-
"pragma": "React",
58-
"version": "detect"
59-
}
60-
},
61-
"parserOptions": {
62-
"project": "./tsconfig.json",
63-
"ecmaFeatures": {
64-
"jsx": true
65-
}
66-
}
67-
},
6847
"devDependencies": {
6948
"@babel/plugin-transform-runtime": "^7.9.0",
7049
"@babel/preset-typescript": "^7.8.3",
@@ -86,12 +65,14 @@
8665
"enzyme": "^3.11.0",
8766
"enzyme-adapter-react-16": "^1.15.2",
8867
"eslint": "^6.8.0",
68+
"eslint-config-prettier": "^6.11.0",
8969
"eslint-config-ts-lambdas": "^1.2.0",
9070
"eslint-plugin-react": "^7.19.0",
9171
"extract-mdx-metadata": "^1.0.0",
9272
"fs-extra": "^8.1.0",
9373
"jest": "^25.3.0",
9474
"next": "^9.3.6",
75+
"prettier": "^2.0.5",
9576
"react": "^16.13.0",
9677
"react-color": "^2.18.0",
9778
"react-dom": "^16.13.0",

yarn.lock

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3745,6 +3745,13 @@ escodegen@^1.11.1:
37453745
optionalDependencies:
37463746
source-map "~0.6.1"
37473747

3748+
eslint-config-prettier@^6.11.0:
3749+
version "6.11.0"
3750+
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz#f6d2238c1290d01c859a8b5c1f7d352a0b0da8b1"
3751+
integrity sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA==
3752+
dependencies:
3753+
get-stdin "^6.0.0"
3754+
37483755
eslint-config-ts-lambdas@^1.2.0:
37493756
version "1.2.0"
37503757
resolved "https://registry.yarnpkg.com/eslint-config-ts-lambdas/-/eslint-config-ts-lambdas-1.2.0.tgz#cf587490b80e6d4cb2d3e07c74716b5aa0663df2"
@@ -4312,6 +4319,11 @@ get-caller-file@^2.0.1:
43124319
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
43134320
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
43144321

4322+
get-stdin@^6.0.0:
4323+
version "6.0.0"
4324+
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b"
4325+
integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==
4326+
43154327
get-stream@^4.0.0:
43164328
version "4.1.0"
43174329
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
@@ -7349,6 +7361,11 @@ prepend-http@^1.0.0:
73497361
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
73507362
integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=
73517363

7364+
prettier@^2.0.5:
7365+
version "2.0.5"
7366+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4"
7367+
integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==
7368+
73527369
pretty-format@^25.2.1, pretty-format@^25.5.0:
73537370
version "25.5.0"
73547371
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.5.0.tgz#7873c1d774f682c34b8d48b6743a2bf2ac55791a"

0 commit comments

Comments
 (0)