Regenerating node_modules
This commit is contained in:
parent
09b4a82c83
commit
c96f84308a
5488 changed files with 487362 additions and 60779 deletions
47
node_modules/eslint-plugin-eslint-comments/lib/rules/no-aggregating-enable.js
generated
vendored
Normal file
47
node_modules/eslint-plugin-eslint-comments/lib/rules/no-aggregating-enable.js
generated
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/**
|
||||
* @author Toru Nagashima <https://github.com/mysticatea>
|
||||
* See LICENSE file in root directory for full license.
|
||||
*/
|
||||
"use strict"
|
||||
|
||||
const DisabledArea = require("../internal/disabled-area")
|
||||
const utils = require("../internal/utils")
|
||||
|
||||
module.exports = {
|
||||
meta: {
|
||||
docs: {
|
||||
description:
|
||||
"disallow a `eslint-enable` comment for multiple `eslint-disable` comments",
|
||||
category: "Best Practices",
|
||||
recommended: true,
|
||||
url:
|
||||
"https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-aggregating-enable.html",
|
||||
},
|
||||
fixable: null,
|
||||
schema: [],
|
||||
type: "suggestion",
|
||||
},
|
||||
|
||||
create(context) {
|
||||
const sourceCode = context.getSourceCode()
|
||||
const disabledArea = DisabledArea.get(sourceCode)
|
||||
|
||||
return {
|
||||
Program() {
|
||||
for (const entry of disabledArea.numberOfRelatedDisableDirectives) {
|
||||
const comment = entry[0]
|
||||
const count = entry[1]
|
||||
|
||||
if (count >= 2) {
|
||||
context.report({
|
||||
loc: utils.toForceLocation(comment.loc),
|
||||
message:
|
||||
"This `eslint-enable` comment affects {{count}} `eslint-disable` comments. An `eslint-enable` comment should be for an `eslint-disable` comment.",
|
||||
data: { count },
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue