Skip to content

Commit

Permalink
Add eslint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
kokororin committed Jun 20, 2018
1 parent c7ddfd6 commit 79427f1
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
9 changes: 8 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@
"mocha": true
},
"extends": ["kotori"],
"plugins": ["prettier"],
"globals": {
"autobind": true
},
"rules": {
"new-cap": 0
"new-cap": 0,
"prettier/prettier": [1, {
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": true,
"jsxBracketSameLine": true
}]
}
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"eslint": "^4.5.0",
"eslint-config-kotori": "^0.2.3",
"eslint-loader": "^1.9.0",
"eslint-plugin-prettier": "^2.6.0",
"fetch-mock": "^5.12.2",
"file-loader": "^0.11.2",
"glob": "^7.1.2",
Expand All @@ -79,6 +80,7 @@
"open-browser-webpack-plugin": "^0.0.5",
"optimize-js-plugin": "^0.0.4",
"postcss-loader": "^2.0.6",
"prettier": "^1.13.5",
"puppeteer": "^0.11.0",
"react-hot-loader": "next",
"react-test-renderer": "^16.3.2",
Expand Down
8 changes: 5 additions & 3 deletions src/utils/EmojiParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,11 @@ export default class EmojiParser {
let replaceStr = '';
for (const series of EmojiParser.emojiSeries) {
if (match === `(${series.name})`) {
replaceStr += `<img class="${styles[
'emoji-text'
]}" src="https://source.pixiv.net/common/images/emoji/${series.id}.png" />`;
replaceStr += `<img class="${
styles['emoji-text']
}" src="https://source.pixiv.net/common/images/emoji/${
series.id
}.png" />`;
}
}
return replaceStr === '' ? match : replaceStr;
Expand Down
19 changes: 19 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2852,6 +2852,13 @@ eslint-plugin-babel@>=5.0.0:
dependencies:
eslint-rule-composer "^0.3.0"

eslint-plugin-prettier@^2.6.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.0.tgz#33e4e228bdb06142d03c560ce04ec23f6c767dd7"
dependencies:
fast-diff "^1.1.1"
jest-docblock "^21.0.0"

eslint-plugin-react@>=7.0.0:
version "7.9.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.9.1.tgz#101aadd15e7c7b431ed025303ac7b421a8e3dc15"
Expand Down Expand Up @@ -3160,6 +3167,10 @@ fast-deep-equal@^2.0.1:
version "2.0.1"
resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49"

fast-diff@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154"

fast-json-stable-stringify@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
Expand Down Expand Up @@ -4562,6 +4573,10 @@ istanbul-reports@^1.3.0:
dependencies:
handlebars "^4.0.3"

jest-docblock@^21.0.0:
version "21.2.0"
resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414"

js-base64@^2.1.8:
version "2.4.3"
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.3.tgz#2e545ec2b0f2957f41356510205214e98fad6582"
Expand Down Expand Up @@ -6322,6 +6337,10 @@ preserve@^0.2.0:
version "0.2.0"
resolved "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"

prettier@^1.13.5:
version "1.13.5"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.13.5.tgz#7ae2076998c8edce79d63834e9b7b09fead6bfd0"

pretty-bytes@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9"
Expand Down

0 comments on commit 79427f1

Please sign in to comment.