Skip to content

Commit

Permalink
chore: add prettier and linting on commit
Browse files Browse the repository at this point in the history
  • Loading branch information
samtjo committed Nov 2, 2020
1 parent cc89a46 commit adfe0f0
Show file tree
Hide file tree
Showing 7 changed files with 879 additions and 195 deletions.
118 changes: 58 additions & 60 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,92 +2,92 @@
"parser": "babel-eslint",
"rules": {
"strict": 0,
"array-bracket-spacing": ["error", "never"],
"array-bracket-spacing": "off",
"arrow-body-style": "off",
"class-methods-use-this": "off",
"comma-dangle": ["error", "never"],
"comma-dangle": "off",
"func-names": "off",
"function-paren-newline": ["error", "consistent"],
"function-paren-newline": "off",
"guard-for-in": "off",
"import/extensions": ["off", "never"],
"import/no-extraneous-dependencies": "off",
"import/no-unresolved": "off",
"indent": ["error", 2, {
"VariableDeclarator": 2,
"SwitchCase": 1
}],
"indent": "off",
"jsx-a11y/anchor-is-valid": "warn",
"jsx-a11y/click-events-have-key-events": "warn",
"jsx-a11y/label-has-for": "warn",
"jsx-a11y/mouse-events-have-key-events": "warn",
"jsx-a11y/no-noninteractive-element-interactions": "warn",
"jsx-a11y/no-static-element-interactions": "warn",
"jsx-quotes": ["error", "prefer-single"],
"linebreak-style": ["error", "unix"],
"max-len": ["error", 120],
"jsx-quotes": "off",
"linebreak-style": "off",
"max-len": "off",
"max-params": ["error", 5],
"multiline-ternary": ["error", "never"],
"multiline-ternary": "off",
"no-param-reassign": ["error", { "props": false }],
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }],
"no-restricted-syntax": "off",
"no-trailing-spaces": ["error"],
"no-trailing-spaces": "off",
"no-underscore-dangle": "off",
"no-use-before-define": ["error", { "functions": false, "classes": false }],
"one-var": "off",
"one-var-declaration-per-line": "off",
"prefer-const": ["error", {"destructuring": "any"}],
"prefer-destructuring": ["error", {
"VariableDeclarator": {
"array": false,
"object": true
},
"AssignmentExpression": {
"array": false,
"object": false
"prefer-const": ["error", { "destructuring": "any" }],
"prefer-destructuring": [
"error",
{
"VariableDeclarator": {
"array": false,
"object": true
},
"AssignmentExpression": {
"array": false,
"object": false
}
}
}],
"react/jsx-one-expression-per-line": 0,
],
"react/jsx-one-expression-per-line": "off",
"react/destructuring-assignment": 0,
"react/no-this-in-sfc": 0,
"react/jsx-curly-spacing": ["error", "always"],
"react/no-unescaped-entities": "off",
"react/jsx-curly-spacing": "off",
"react/jsx-filename-extension": "off",
"react/jsx-max-props-per-line": ["error", { "maximum": 2 }],
"react/jsx-max-props-per-line": "off",
"react/jsx-uses-react": "warn",
"react/jsx-uses-vars": "warn",
"react/jsx-wrap-multilines": ["error", {
"declaration": "parens-new-line",
"assignment": "parens-new-line",
"return": "parens-new-line",
"arrow": "parens-new-line",
"condition": "parens-new-line",
"logical": "parens-new-line",
"prop": "parens-new-line"
}],
"react/jsx-wrap-multilines": "off",
"react/forbid-prop-types": "off",
"react/no-array-index-key": "warn",
"react/prop-types": "warn",
"react/require-default-props": "off",
"react/sort-comp": ["error", {
"order": [
"static-methods",
"lifecycle",
"/^on.+$/",
"/^(?!(InitialState$|DefaultProps$|ChildContext$)).+$/",
"everything-else",
"/^render.+$/",
"render"
]
}],
"semi": ["error", "always"],
"semi-spacing": ["error", {"before": false, "after": true}],
"react/sort-comp": [
"error",
{
"order": [
"static-methods",
"lifecycle",
"/^on.+$/",
"/^(?!(InitialState$|DefaultProps$|ChildContext$)).+$/",
"everything-else",
"/^render.+$/",
"render"
]
}
],
"semi": "off",
"semi-spacing": "off",
"space-before-function-paren": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
// Copy from airbnb with UNSAFE_ ignore added
"camelcase": ["error", {
"allow": ["^UNSAFE_"],
"properties": "never",
"ignoreDestructuring": false
}],
// Copy from airbnb with UNSAFE_ ignore added
"camelcase": [
"error",
{
"allow": ["^UNSAFE_"],
"properties": "never",
"ignoreDestructuring": false
}
],
"no-restricted-imports": ["error", { "paths": [{
"name": "styled-system",
"importNames": ["color"],
Expand All @@ -101,18 +101,16 @@
"jasmine": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"airbnb"
],
"plugins": [
"react",
"react-hooks"
"airbnb",
"prettier",
"prettier/react"
],
"plugins": ["react", "react-hooks"],
"globals": {
"jest": false,
"global": false,
"process": false,
"test": false
}
}

1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
with:
node-version: '12'
- run: npm ci
- run: npx prettier --check './src/**/*.js'
- run: npm run lint
- run: npm run lint-ts
test:
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
coverage/
package-lock.json
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
14 changes: 8 additions & 6 deletions cypress/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{
"extends": "airbnb-base",
"plugins": [
"cypress"
],
"plugins": ["cypress"],
"env": {
"cypress/globals": true
},
"rules": {
"import/prefer-default-export": false,
"no-unused-vars": ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }]
"import/prefer-default-export": "off",
"no-unused-vars": [
"error",
{ "vars": "all", "args": "after-used", "ignoreRestSiblings": false }
]
},
"globals": {
"Given": true,
"When": true,
"Then": true
}
}
}

Loading

0 comments on commit adfe0f0

Please sign in to comment.