Skip to content
Permalink
Browse files

Update: remove default overrides in keyword-spacing (fixes #12369) (#…

…12411)

* Update: remove default property in override scheme

* Chore: Add a "missing after in overrides" test case for keyword-spacing
  • Loading branch information
yeonjuan authored and platinumazure committed Oct 18, 2019
1 parent 18a0b0e commit 84f71de0e686e0fe37b83d6728ce1825caaa44fb
Showing with 4 additions and 2 deletions.
  1. +2 −2 lib/rules/keyword-spacing.js
  2. +2 −0 tests/lib/rules/keyword-spacing.js
@@ -86,8 +86,8 @@ module.exports = {
retv[key] = {
type: "object",
properties: {
before: { type: "boolean", default: true },
after: { type: "boolean", default: true }
before: { type: "boolean" },
after: { type: "boolean" }
},
additionalProperties: false
};
@@ -545,6 +545,8 @@ ruleTester.run("keyword-spacing", rule, {
{ code: "if (a) {}else{}", options: [override("else", NEITHER)] },
"if (a) {}\nelse\n{}",
{ code: "if(a) {}\nelse\n{}", options: [NEITHER] },
{ code: "if(a){ }else{ }", options: [{ before: false, after: true, overrides: { else: { after: false }, if: { after: false } } }] },
{ code: "if(a){ }else{ }", options: [{ before: true, after: false, overrides: { else: { before: false }, if: { before: false } } }] },

// not conflict with `semi-spacing`
"if (a);else;",

0 comments on commit 84f71de

Please sign in to comment.
You can’t perform that action at this time.