Regenerating node_modules
This commit is contained in:
parent
09b4a82c83
commit
c96f84308a
5488 changed files with 487362 additions and 60779 deletions
33
node_modules/eslint-plugin-eslint-comments/lib/internal/get-linters.js
generated
vendored
Normal file
33
node_modules/eslint-plugin-eslint-comments/lib/internal/get-linters.js
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/**
|
||||
* @author Toru Nagashima <https://github.com/mysticatea>
|
||||
* See LICENSE file in root directory for full license.
|
||||
*/
|
||||
"use strict"
|
||||
|
||||
const path = require("path")
|
||||
const needle = `${path.sep}node_modules${path.sep}eslint${path.sep}`
|
||||
|
||||
module.exports = () => {
|
||||
const eslintPaths = new Set(
|
||||
Object.keys(require.cache)
|
||||
.filter(id => id.includes(needle))
|
||||
.map(id => id.slice(0, id.indexOf(needle) + needle.length))
|
||||
)
|
||||
const linters = []
|
||||
|
||||
for (const eslintPath of eslintPaths) {
|
||||
try {
|
||||
const linter = require(eslintPath).Linter
|
||||
|
||||
if (linter) {
|
||||
linters.push(linter)
|
||||
}
|
||||
} catch (error) {
|
||||
if (error.code !== "MODULE_NOT_FOUND") {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return linters
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue