-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: Set default
schema: []
, drop support for function-style rules (
#139) * drop support for function-style rules * implement schema changes * add unit tests for ConfigValidator#getRuleOptionsSchema * add regression tests for ConfigValidator#validateRuleOptions * add tests for error code * update fixture rules to use object-style
- Loading branch information
1 parent
01db002
commit a6c240d
Showing
8 changed files
with
374 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
module.exports = function(context) { | ||
"use strict"; | ||
|
||
"use strict"; | ||
module.exports = { | ||
meta: { | ||
schema: [] | ||
}, | ||
|
||
return { | ||
"Identifier": function(node) { | ||
if (node.name === "foo") { | ||
context.report(node, "Identifier cannot be named 'foo'."); | ||
create(context) { | ||
return { | ||
"Identifier": function(node) { | ||
if (node.name === "foo") { | ||
context.report(node, "Identifier cannot be named 'foo'."); | ||
} | ||
} | ||
} | ||
}; | ||
|
||
}; | ||
} | ||
}; | ||
|
||
module.exports.schema = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
"use strict"; | ||
|
||
module.exports = function(context) { | ||
module.exports = { | ||
create(context) { | ||
return { | ||
|
||
return { | ||
"Literal": function(node) { | ||
if (typeof node.value === 'string') { | ||
context.report(node, "String!"); | ||
} | ||
|
||
"Literal": function(node) { | ||
if (typeof node.value === 'string') { | ||
context.report(node, "String!"); | ||
} | ||
|
||
} | ||
}; | ||
}; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
"use strict"; | ||
|
||
module.exports = function(context) { | ||
module.exports = { | ||
create (context) { | ||
return { | ||
|
||
return { | ||
|
||
"Literal": function(node) { | ||
context.report(node, "Literal!"); | ||
} | ||
}; | ||
"Literal": function(node) { | ||
context.report(node, "Literal!"); | ||
} | ||
}; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
module.exports = function(context) { | ||
return { | ||
Program: function(node) { | ||
context.report({ | ||
node: node, | ||
message: "ERROR", | ||
fix: function(fixer) { | ||
return fixer.insertTextAfter(node, "this is a syntax error."); | ||
} | ||
}); | ||
} | ||
}; | ||
module.exports = { | ||
meta: { | ||
schema: [] | ||
}, | ||
create(context) { | ||
return { | ||
Program: function(node) { | ||
context.report({ | ||
node: node, | ||
message: "ERROR", | ||
fix: function(fixer) { | ||
return fixer.insertTextAfter(node, "this is a syntax error."); | ||
} | ||
}); | ||
} | ||
}; | ||
} | ||
}; | ||
module.exports.schema = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
module.exports = function() { | ||
"use strict"; | ||
|
||
"use strict"; | ||
return (null).something; | ||
module.exports = { | ||
create() { | ||
return (null).something; | ||
} | ||
}; |
Oops, something went wrong.