GeezerVison is showing github.com — tools: add support for import assertions in linter · nodejs/node@abf3b84
File tree
Expand file treeCollapse file tree
Open diff view settings
plugin-syntax-import-assertions node_modules/@babel/helper-plugin-utils
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .eslintrc.js +6Lines changed: 6 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -17,6 +17,7 @@ const hacks = [ |
17 | 17 | 'eslint-plugin-node-core', |
18 | 18 | 'eslint-plugin-markdown', |
19 | 19 | '@babel/eslint-parser', |
| 20 | + '@babel/plugin-syntax-import-assertions', |
20 | 21 | ]; |
21 | 22 | Module._findPath = (request, paths, isMain) => { |
22 | 23 | const r = ModuleFindPath(request, paths, isMain); |
@@ -36,6 +37,11 @@ module.exports = { |
36 | 37 | plugins: ['markdown', 'node-core'], |
37 | 38 | parser: '@babel/eslint-parser', |
38 | 39 | parserOptions: { |
| 40 | + babelOptions: { |
| 41 | + plugins: [ |
| 42 | + Module._findPath('@babel/plugin-syntax-import-assertions'), |
| 43 | + ], |
| 44 | + }, |
39 | 45 | requireConfigFile: false, |
40 | 46 | sourceType: 'script', |
41 | 47 | }, |
|
Collapse file
Copy file name to clipboard +7Lines changed: 7 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 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
Copy file name to clipboardExpand all lines: tools/node_modules/@babel/core/node_modules/browserslist/package.json +5-5Lines changed: 5 additions & 5 deletions Collapse file
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 Collapse file
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 Collapse file
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 Collapse file
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 Collapse file
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 Collapse file
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