-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add "eslint/universal" to export
Linter
(#18883)
* feat: add "eslint/universal" to export `Linter` fixes #18715 * fix: add lib/universal.js * feat: add typings * chore: add tests for "eslint/universal" types * Update lib/types/universal.d.ts Co-authored-by: Francesco Trotta <github@fasttime.org> * chore: update types tests --------- Co-authored-by: Francesco Trotta <github@fasttime.org>
- Loading branch information
1 parent
c591da6
commit ec30c73
Showing
6 changed files
with
44 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* @fileoverview typings for "eslint/universal" module | ||
* @author 唯然<weiran.zsd@outlook.com> | ||
*/ | ||
|
||
export { Linter } from "./index"; |
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,10 @@ | ||
/** | ||
* @fileoverview exports for browsers | ||
* @author 唯然<weiran.zsd@outlook.com> | ||
*/ | ||
|
||
"use strict"; | ||
|
||
const { Linter } = require("./linter/linter"); | ||
|
||
module.exports = { Linter }; |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* @fileoverview Tests for "eslint/universal". | ||
* @author 唯然<weiran.zsd@outlook.com> | ||
*/ | ||
|
||
"use strict"; | ||
const assert = require("node:assert/strict"); | ||
|
||
describe("universal", () => { | ||
it("should have Linter exported", () => { | ||
const { Linter } = require("eslint/universal"); | ||
|
||
assert.ok(Linter); | ||
assert.ok(typeof Linter === "function"); | ||
|
||
|
||
const linter = new Linter(); | ||
|
||
assert.ok(linter); | ||
}); | ||
}); |