Skip to content

Commit

Permalink
feat: add more spacing-related rules and other warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkH817 committed Mar 4, 2020
1 parent 3442bb3 commit cecdab2
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 4 deletions.
38 changes: 35 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
"rules": {
"arrow-body-style": "error",
"arrow-parens": ["error", "as-needed"],
"class-methods-use-this": "warn",
"consistent-return": "error",
"curly": ["error", "all"],
"lines-between-class-members": "error",
"max-statements-per-line": "error",
"no-multiple-empty-lines": [
"error",
Expand All @@ -22,18 +25,47 @@
"no-var": "error",
"padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": ["block", "block-like"], "next": "*" },
{ "blankLine": "always", "prev": "*", "next": ["block", "block-like"] }
{
"blankLine": "always",
"prev": ["block", "block-like", "class", "export"],
"next": "*"
},
{
"blankLine": "always",
"prev": "*",
"next": ["block", "block-like", "class", "export"]
},
{ "blankLine": "always", "prev": "expression", "next": ["const", "let"] }
],
"quotes": [
"error",
"single",
{ "avoidEscape": true, "allowTemplateLiterals": true }
],
"require-await": "error",
"sort-imports": [
"error",
{ "ignoreCase": true, "ignoreDeclarationSort": true }
],

"import/dynamic-import-chunkname": "error",
"import/newline-after-import": "error",
"import/no-mutable-exports": "error",
"import/order": "error",
"import/order": [
"error",
{
"alphabetize": { "caseInsensitive": true, "order": "asc" },
"groups": [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index"
],
"newlines-between": "always"
}
],
"react/jsx-fragments": "off",
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
Expand Down
42 changes: 41 additions & 1 deletion test/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,34 @@ Object {
"error",
"as-needed",
],
"class-methods-use-this": "warn",
"consistent-return": "error",
"curly": Array [
"error",
"all",
],
"import/dynamic-import-chunkname": "error",
"import/newline-after-import": "error",
"import/no-mutable-exports": "error",
"import/order": "error",
"import/order": Array [
"error",
Object {
"alphabetize": Object {
"caseInsensitive": true,
"order": "asc",
},
"groups": Array [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
],
"newlines-between": "always",
},
],
"lines-between-class-members": "error",
"max-statements-per-line": "error",
"no-multiple-empty-lines": Array [
"error",
Expand All @@ -55,16 +75,28 @@ Object {
"prev": Array [
"block",
"block-like",
"class",
"export",
],
},
Object {
"blankLine": "always",
"next": Array [
"block",
"block-like",
"class",
"export",
],
"prev": "*",
},
Object {
"blankLine": "always",
"next": Array [
"const",
"let",
],
"prev": "expression",
},
],
"quotes": Array [
"error",
Expand All @@ -79,6 +111,14 @@ Object {
"react/jsx-fragments": "off",
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"require-await": "error",
"sort-imports": Array [
"error",
Object {
"ignoreCase": true,
"ignoreDeclarationSort": true,
},
],
},
"settings": Object {
"react": Object {
Expand Down

0 comments on commit cecdab2

Please sign in to comment.