-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: import("eslint") doesn't work (#9)
* fix: import("eslint") doesn't work fixes #8 * fix: failing tests * fix: safer import * Update lib/init/config-file.js Co-authored-by: Nicholas C. Zakas <[email protected]> Co-authored-by: Nicholas C. Zakas <[email protected]>
- Loading branch information
1 parent
1026c16
commit 48d8025
Showing
7 changed files
with
47 additions
and
100 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* @fileoverview the file is to mock local-installed eslint for testing | ||
*/ | ||
"use strict"; | ||
const _module = require("module"); | ||
const path = require("path"); | ||
|
||
const { createRequire } = _module; | ||
const root = path.resolve(__dirname, "../../../../../../"); | ||
|
||
const realEslintPath = createRequire(root).resolve("eslint"); | ||
module.exports = require(realEslintPath); |
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,4 +1,5 @@ | ||
{ | ||
"name": "eslint", | ||
"version": "3.18.0" | ||
"version": "3.18.0", | ||
"main": "./lib/api.js" | ||
} |
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