Skip to content

Commit e834e1e

Browse files
fix: remove acorn-import-attributes dependency
1 parent 5d66f95 commit e834e1e

File tree

4 files changed

+5
-23
lines changed

4 files changed

+5
-23
lines changed

package-lock.json

Lines changed: 1 addition & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"@babel/parser": "^7.16.4",
5454
"@babel/preset-env": "^7.14.4",
5555
"acorn": "^8.12.1",
56-
"acorn-import-attributes": "^1.9.5",
5756
"astravel": "^0.5.0",
5857
"ava": "^3.15.0",
5958
"babel-preset-minify": "^0.5.1",

src/tests/astring.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import fs from 'fs'
22
import test from 'ava'
33
import path from 'path'
4-
import { Parser } from 'acorn'
5-
import { importAttributesOrAssertions } from 'acorn-import-attributes'
4+
import * as parser from 'acorn'
65
import * as astravel from 'astravel'
76
import { pick } from 'lodash'
87

@@ -13,8 +12,6 @@ const FIXTURES_FOLDER = path.join(__dirname, 'fixtures')
1312

1413
const ecmaVersion = 13
1514

16-
const parser = Parser.extend(importAttributesOrAssertions)
17-
1815
const stripLocation = astravel.makeTraveler({
1916
go(node, state) {
2017
delete node.start

src/tests/scripts.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import test from 'ava'
22
import fs from 'fs'
33
import path from 'path'
44
import normalizeNewline from 'normalize-newline'
5-
import { Parser } from 'acorn'
6-
import { importAttributes } from 'acorn-import-attributes'
5+
import * as parser from 'acorn'
76
import * as astravel from 'astravel'
87
import glob from 'glob'
98

@@ -41,15 +40,12 @@ test('Script tests', (assert) => {
4140
const code = normalizeNewline(fs.readFileSync(fileName, 'utf8'))
4241
let ast
4342
try {
44-
ast = Parser.extend(importAttributes).parse(code, options)
43+
ast = parser.parse(code, options)
4544
} catch (error) {
4645
return
4746
}
4847
stripLocation.go(ast)
49-
const formattedAst = Parser.extend(importAttributes).parse(
50-
generate(ast),
51-
options,
52-
)
48+
const formattedAst = parser.parse(generate(ast), options)
5349
stripLocation.go(formattedAst)
5450
assert.deepEqual(formattedAst, ast, fileName)
5551
} catch (error) {

0 commit comments

Comments
 (0)