Skip to content

Commit

Permalink
style(prettier): adding prettier rules and validations
Browse files Browse the repository at this point in the history
using pretty-quick and lint-staged
  • Loading branch information
roggervalf committed Jun 14, 2020
1 parent 7cc1203 commit 25e4e3d
Show file tree
Hide file tree
Showing 7 changed files with 363 additions and 74 deletions.
20 changes: 7 additions & 13 deletions .eslintrc
@@ -1,24 +1,16 @@
{
"parser": "babel-eslint",
"extends": [
"standard",
"standard-react",
"prettier",
"eslint:recommended"
],
"extends": ["standard", "standard-react", "prettier", "eslint:recommended"],
"env": {
"es6": true,
"jest": true
},
"plugins": [
"react",
"prettier"
],
"plugins": ["react", "prettier"],
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2018,
"ecmaFeatures": {
"impliedStrict": true,
"impliedStrict": true,
"jsx": true,
"arrowFunctions": true,
"blockBindings": true,
Expand All @@ -38,13 +30,15 @@
}
},
"rules": {
"react/jsx-no-bind": "off",
"space-before-function-paren": 0,
"react/jsx-boolean-value": 0,
"max-len": [2, {"code":120,"ignoreComments":true}],
"newline-per-chained-call": 0,
"max-len": [2, { "code": 120, "ignoreComments": true }],
"newline-per-chained-call": 0,
"no-trailing-spaces": ["error"],
"quotes": ["error", "double", { "avoidEscape": true }],
"comma-dangle": ["error", "never"],
"no-template-curly-in-string": "off",
"semi": ["error", "always"],
"object-curly-spacing": ["error", "always"],
"quote-props": ["error", "consistent"],
Expand Down
11 changes: 11 additions & 0 deletions .prettierrc.js
@@ -0,0 +1,11 @@
// prettier.config.js or .prettierrc.js
module.exports = {
singleQuote: true,
trailingComma: "none",
tabWidth: 2,
printWidth: 80,
semi: true,
bracketSpacing: true,
jsxBracketSameLine: false,
endOfLine: "lf"
};
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -21,6 +21,7 @@ script:
- yarn
- yarn build
- cd ..
- commitlint-travis

after_success:
- yarn semantic-release
Expand Down
10 changes: 5 additions & 5 deletions bin/transferSass.js
@@ -1,19 +1,19 @@
var sass = require("node-sass");
var fs = require("fs");
var path = require("path");
const sass = require("node-sass");
const fs = require("fs");
const path = require("path");

function transferSass() {
sass.render(
{
file: path.resolve(__dirname, "../src/index.scss"),
outputStyle: "compressed",
outputStyle: "compressed"
},
function(err, result) {
if (err) {
console.log(err);
return;
}
var cssSource = result.css.toString();
const cssSource = result.css.toString();
fs.writeFile(
path.resolve(__dirname, "../src/style.js"),
"export default '" + cssSource.replace(/\n/g, "") + "'",
Expand Down

0 comments on commit 25e4e3d

Please sign in to comment.