Skip to content

Commit

Permalink
build: adding Prettier to the mix
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat616 committed Sep 3, 2020
1 parent 44beef4 commit ca4ed2a
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 11 deletions.
23 changes: 12 additions & 11 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ module.exports = {
parserOptions: {
parser: 'babel-eslint',
ecmaVersion: 2018,
sourceType: 'module'
sourceType: 'module',
},
plugins: ['html'],
extends: ['plugin:prettier/recommended'],
env: {
browser: true,
node: true
node: true,
},

rules: {
Expand All @@ -18,8 +19,8 @@ module.exports = {
2,
{
beforeColon: false,
afterColon: true
}
afterColon: true,
},
],
'no-octal': 2,
'no-redeclare': 2,
Expand All @@ -31,18 +32,18 @@ module.exports = {
'single',
{
avoidEscape: true,
allowTemplateLiterals: true
}
]
allowTemplateLiterals: true,
},
],
},
overrides: [
{
files: ['**/*.ts'],
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended' // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint',
],

}
]
},
],
}
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"trailingComma": "all",
"singleQuote": true
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,15 @@
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"eslint": "^7.8.1",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-html": "6.0.3",
"eslint-plugin-prettier": "^3.1.4",
"husky": "4.2.5",
"intelli-espower-loader": "1.0.1",
"lint-staged": "10.2.11",
"mocha": "8.1.3",
"power-assert": "1.6.1",
"prettier": "^2.1.1",
"typescript": "^4.0.2"
}
}
36 changes: 36 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1010,13 +1010,27 @@ escope@^3.3.0:
esrecurse "^4.1.0"
estraverse "^4.1.1"

eslint-config-prettier@^6.11.0:
version "6.11.0"
resolved "https://registry.npm.taobao.org/eslint-config-prettier/download/eslint-config-prettier-6.11.0.tgz#f6d2238c1290d01c859a8b5c1f7d352a0b0da8b1"
integrity sha1-9tIjjBKQ0ByFmotcH301KgsNqLE=
dependencies:
get-stdin "^6.0.0"

[email protected]:
version "6.0.3"
resolved "https://registry.npm.taobao.org/eslint-plugin-html/download/eslint-plugin-html-6.0.3.tgz?cache=0&sync_timestamp=1596891051341&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-plugin-html%2Fdownload%2Feslint-plugin-html-6.0.3.tgz#8d9d2c187d1a48ed78d84f45e29820f102425e51"
integrity sha1-jZ0sGH0aSO142E9F4pgg8QJCXlE=
dependencies:
htmlparser2 "^4.1.0"

eslint-plugin-prettier@^3.1.4:
version "3.1.4"
resolved "https://registry.npm.taobao.org/eslint-plugin-prettier/download/eslint-plugin-prettier-3.1.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-plugin-prettier%2Fdownload%2Feslint-plugin-prettier-3.1.4.tgz#168ab43154e2ea57db992a2cd097c828171f75c2"
integrity sha1-Foq0MVTi6lfbmSos0JfIKBcfdcI=
dependencies:
prettier-linter-helpers "^1.0.0"

eslint-scope@^5.0.0, eslint-scope@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.0.tgz#d0f971dfe59c69e0cada684b23d49dbf82600ce5"
Expand Down Expand Up @@ -1291,6 +1305,11 @@ fast-deep-equal@^3.1.1:
resolved "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
integrity sha1-On1WtVnWy8PrUSMlJE5hmmXGxSU=

fast-diff@^1.1.2:
version "1.2.0"
resolved "https://registry.npm.taobao.org/fast-diff/download/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03"
integrity sha1-c+4RmC2Gyq95WYKNUZz+kn+sXwM=

fast-glob@^3.1.1:
version "3.2.4"
resolved "https://registry.npm.taobao.org/fast-glob/download/fast-glob-3.2.4.tgz?cache=0&sync_timestamp=1592290365180&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffast-glob%2Fdownload%2Ffast-glob-3.2.4.tgz#d20aefbf99579383e7f3cc66529158c9b98554d3"
Expand Down Expand Up @@ -1486,6 +1505,11 @@ get-own-enumerable-property-symbols@^3.0.0:
resolved "https://registry.npm.taobao.org/get-own-enumerable-property-symbols/download/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664"
integrity sha1-tf3nfyLL4185C04ImSLFC85u9mQ=

get-stdin@^6.0.0:
version "6.0.0"
resolved "https://registry.npm.taobao.org/get-stdin/download/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b"
integrity sha1-ngm/cSs2CrkiXoEgSPcf3pyJZXs=

get-stream@^5.0.0:
version "5.1.0"
resolved "https://registry.npm.taobao.org/get-stream/download/get-stream-5.1.0.tgz#01203cdc92597f9b909067c3e656cc1f4d3c4dc9"
Expand Down Expand Up @@ -2575,6 +2599,18 @@ prelude-ls@~1.1.2:
resolved "https://registry.npm.taobao.org/prelude-ls/download/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=

prettier-linter-helpers@^1.0.0:
version "1.0.0"
resolved "https://registry.npm.taobao.org/prettier-linter-helpers/download/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b"
integrity sha1-0j1B/hN1ZG3i0BBNNFSjAIgCz3s=
dependencies:
fast-diff "^1.1.2"

prettier@^2.1.1:
version "2.1.1"
resolved "https://registry.npm.taobao.org/prettier/download/prettier-2.1.1.tgz?cache=0&sync_timestamp=1598414052614&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fprettier%2Fdownload%2Fprettier-2.1.1.tgz#d9485dd5e499daa6cb547023b87a6cf51bee37d6"
integrity sha1-2Uhd1eSZ2qbLVHAjuHps9RvuN9Y=

progress@^2.0.0:
version "2.0.3"
resolved "https://registry.npm.taobao.org/progress/download/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
Expand Down

0 comments on commit ca4ed2a

Please sign in to comment.