Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit abf3b84

Browse filesBrowse files
aduh95targos
authored andcommitted
tools: add support for import assertions in linter
PR-URL: #39924 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
1 parent 621266a commit abf3b84
Copy full SHA for abf3b84

File tree

Expand file treeCollapse file tree

27 files changed

+353
-2429
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

27 files changed

+353
-2429
lines changed
Open diff view settings
Collapse file

‎.eslintrc.js‎

Copy file name to clipboardExpand all lines: .eslintrc.js
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const hacks = [
1717
'eslint-plugin-node-core',
1818
'eslint-plugin-markdown',
1919
'@babel/eslint-parser',
20+
'@babel/plugin-syntax-import-assertions',
2021
];
2122
Module._findPath = (request, paths, isMain) => {
2223
const r = ModuleFindPath(request, paths, isMain);
@@ -36,6 +37,11 @@ module.exports = {
3637
plugins: ['markdown', 'node-core'],
3738
parser: '@babel/eslint-parser',
3839
parserOptions: {
40+
babelOptions: {
41+
plugins: [
42+
Module._findPath('@babel/plugin-syntax-import-assertions'),
43+
],
44+
},
3945
requireConfigFile: false,
4046
sourceType: 'script',
4147
},
Collapse file
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Flags: --experimental-json-modules --harmony-import-assertions
2+
import '../common/index.mjs';
3+
import { strictEqual } from 'assert';
4+
5+
import secret from '../fixtures/experimental.json' assert { type: 'json' };
6+
7+
strictEqual(secret.ofLife, 42);
Collapse file

‎tools/node_modules/@babel/core/node_modules/browserslist/package.json‎

Copy file name to clipboardExpand all lines: tools/node_modules/@babel/core/node_modules/browserslist/package.json
+5-5Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎tools/node_modules/@babel/core/node_modules/caniuse-lite/data/features/sharedarraybuffer.js‎

Copy file name to clipboardExpand all lines: tools/node_modules/@babel/core/node_modules/caniuse-lite/data/features/sharedarraybuffer.js
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎tools/node_modules/@babel/core/node_modules/caniuse-lite/package.json‎

Copy file name to clipboardExpand all lines: tools/node_modules/@babel/core/node_modules/caniuse-lite/package.json
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎tools/node_modules/@babel/core/node_modules/electron-to-chromium/full-chromium-versions.js‎

Copy file name to clipboardExpand all lines: tools/node_modules/@babel/core/node_modules/electron-to-chromium/full-chromium-versions.js
+9-3Lines changed: 9 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎tools/node_modules/@babel/core/node_modules/electron-to-chromium/full-versions.js‎

Copy file name to clipboardExpand all lines: tools/node_modules/@babel/core/node_modules/electron-to-chromium/full-versions.js
+7-1Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎tools/node_modules/@babel/core/node_modules/electron-to-chromium/package.json‎

Copy file name to clipboardExpand all lines: tools/node_modules/@babel/core/node_modules/electron-to-chromium/package.json
+2-2Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎tools/node_modules/@babel/core/node_modules/node-releases/README.md‎

Copy file name to clipboardExpand all lines: tools/node_modules/@babel/core/node_modules/node-releases/README.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.