Skip to content

Commit 25e4e3d

Browse files
committed
style(prettier): adding prettier rules and validations
using pretty-quick and lint-staged
1 parent 7cc1203 commit 25e4e3d

File tree

7 files changed

+363
-74
lines changed

7 files changed

+363
-74
lines changed

.eslintrc

+7-13
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
{
22
"parser": "babel-eslint",
3-
"extends": [
4-
"standard",
5-
"standard-react",
6-
"prettier",
7-
"eslint:recommended"
8-
],
3+
"extends": ["standard", "standard-react", "prettier", "eslint:recommended"],
94
"env": {
105
"es6": true,
116
"jest": true
127
},
13-
"plugins": [
14-
"react",
15-
"prettier"
16-
],
8+
"plugins": ["react", "prettier"],
179
"parserOptions": {
1810
"sourceType": "module",
1911
"ecmaVersion": 2018,
2012
"ecmaFeatures": {
21-
"impliedStrict": true,
13+
"impliedStrict": true,
2214
"jsx": true,
2315
"arrowFunctions": true,
2416
"blockBindings": true,
@@ -38,13 +30,15 @@
3830
}
3931
},
4032
"rules": {
33+
"react/jsx-no-bind": "off",
4134
"space-before-function-paren": 0,
4235
"react/jsx-boolean-value": 0,
43-
"max-len": [2, {"code":120,"ignoreComments":true}],
44-
"newline-per-chained-call": 0,
36+
"max-len": [2, { "code": 120, "ignoreComments": true }],
37+
"newline-per-chained-call": 0,
4538
"no-trailing-spaces": ["error"],
4639
"quotes": ["error", "double", { "avoidEscape": true }],
4740
"comma-dangle": ["error", "never"],
41+
"no-template-curly-in-string": "off",
4842
"semi": ["error", "always"],
4943
"object-curly-spacing": ["error", "always"],
5044
"quote-props": ["error", "consistent"],

.prettierrc.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// prettier.config.js or .prettierrc.js
2+
module.exports = {
3+
singleQuote: true,
4+
trailingComma: "none",
5+
tabWidth: 2,
6+
printWidth: 80,
7+
semi: true,
8+
bracketSpacing: true,
9+
jsxBracketSameLine: false,
10+
endOfLine: "lf"
11+
};

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ script:
2121
- yarn
2222
- yarn build
2323
- cd ..
24+
- commitlint-travis
2425

2526
after_success:
2627
- yarn semantic-release

bin/transferSass.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
var sass = require("node-sass");
2-
var fs = require("fs");
3-
var path = require("path");
1+
const sass = require("node-sass");
2+
const fs = require("fs");
3+
const path = require("path");
44

55
function transferSass() {
66
sass.render(
77
{
88
file: path.resolve(__dirname, "../src/index.scss"),
9-
outputStyle: "compressed",
9+
outputStyle: "compressed"
1010
},
1111
function(err, result) {
1212
if (err) {
1313
console.log(err);
1414
return;
1515
}
16-
var cssSource = result.css.toString();
16+
const cssSource = result.css.toString();
1717
fs.writeFile(
1818
path.resolve(__dirname, "../src/style.js"),
1919
"export default '" + cssSource.replace(/\n/g, "") + "'",

0 commit comments

Comments
 (0)