Skip to content

Commit

Permalink
Update spacing rules to be of type style
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Oct 5, 2018
1 parent 8f600a7 commit 4453327
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/rules/rest-spread-spacing.js
Expand Up @@ -11,7 +11,7 @@

module.exports = {
meta: {
type: "suggestion",
type: "style",

docs: {
description: "enforce spacing between rest and spread operators and their expressions",
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/yield-star-spacing.js
Expand Up @@ -11,7 +11,7 @@

module.exports = {
meta: {
type: "suggestion",
type: "style",

docs: {
description: "require or disallow spacing around the `*` in `yield*` expressions",
Expand Down
4 changes: 2 additions & 2 deletions tools/rule-types.json
Expand Up @@ -236,7 +236,7 @@
"require-jsdoc": "style",
"require-unicode-regexp": "suggestion",
"require-yield": "suggestion",
"rest-spread-spacing": "suggestion",
"rest-spread-spacing": "style",
"semi": "style",
"semi-spacing": "style",
"semi-style": "style",
Expand All @@ -261,6 +261,6 @@
"vars-on-top": "suggestion",
"wrap-iife": "suggestion",
"wrap-regex": "style",
"yield-star-spacing": "suggestion",
"yield-star-spacing": "style",
"yoda": "suggestion"
}
7 changes: 6 additions & 1 deletion tools/update-rule-types.js
Expand Up @@ -24,8 +24,13 @@ module.exports = (fileInfo, api) => {

// gather important nodes from the rule
const metaNode = p.node.properties.find(node => node.key.name === "meta");
const typeNode = metaNode.value.properties ? metaNode.value.properties.find(node => node.key.name === "type") : null;

// if there's no properties, just exit
if (!metaNode.value.properties) {
return;
}

const typeNode = metaNode.value.properties.find(node => node.key.name === "type");
const docsNode = metaNode.value.properties.find(node => node.key.name === "docs");
const categoryNode = docsNode.value.properties.find(node => node.key.name === "category").value;

Expand Down

0 comments on commit 4453327

Please sign in to comment.