├── .github └── workflows │ └── main.yml ├── .gitignore ├── .mocharc.yaml ├── LICENSE ├── README.md ├── babel.config.json ├── package.json ├── post-build.js ├── run_test262.js ├── src └── index.js └── test ├── fixtures ├── assert-keyword │ ├── actual.js │ └── expected.json ├── assertions-type │ ├── actual.js │ └── expected.json ├── attributes-assertions-dynamic-import │ ├── actual.js │ └── expected.json ├── attributes-assertions-export │ ├── actual.js │ └── expected.json ├── attributes-assertions-import │ ├── actual.js │ └── expected.json ├── duplicated-key │ ├── actual.js │ └── expected.json ├── dynamic-import-async-expression │ ├── actual.js │ └── expected.json ├── dynamic-import-with-attributes │ ├── actual.js │ └── expected.json ├── dynamic-import-without-attributes │ ├── actual.js │ └── expected.json ├── export-statement-all-as-quoted-type │ ├── actual.js │ └── expected.json ├── export-statement-all-as-type │ ├── actual.js │ └── expected.json ├── export-statement-all-type │ ├── actual.js │ └── expected.json ├── export-statement-default-as-type │ ├── actual.js │ └── expected.json ├── export-statement-type │ ├── actual.js │ └── expected.json ├── export-statement-without-attributes │ ├── actual.js │ └── expected.json ├── keyword-in-ident │ ├── actual.js │ └── expected.json ├── keyword-without-space │ ├── actual.js │ └── expected.json ├── type │ ├── actual.js │ └── expected.json ├── unsupported-key │ ├── actual.js │ └── expected.json ├── unsupported-value │ ├── actual.js │ └── expected.json ├── with-in-identifier │ ├── actual.js │ └── expected.json ├── with-keyword-export-all │ ├── actual.js │ └── expected.json ├── with-keyword-export-named │ ├── actual.js │ └── expected.json ├── with-keyword-import │ ├── actual.js │ └── expected.json └── without-attributes │ ├── actual.js │ └── expected.json ├── index.js └── test-plugin.js /.github/workflows/main.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/.github/workflows/main.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | lib/ 3 | -------------------------------------------------------------------------------- /.mocharc.yaml: -------------------------------------------------------------------------------- 1 | reporter: tap 2 | require: 3 | - '@babel/register' 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/README.md -------------------------------------------------------------------------------- /babel.config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/babel.config.json -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/package.json -------------------------------------------------------------------------------- /post-build.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/post-build.js -------------------------------------------------------------------------------- /run_test262.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/run_test262.js -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/src/index.js -------------------------------------------------------------------------------- /test/fixtures/assert-keyword/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/assert-keyword/actual.js -------------------------------------------------------------------------------- /test/fixtures/assert-keyword/expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "error": "Unexpected token (1:30)" 3 | } -------------------------------------------------------------------------------- /test/fixtures/assertions-type/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/assertions-type/actual.js -------------------------------------------------------------------------------- /test/fixtures/assertions-type/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/assertions-type/expected.json -------------------------------------------------------------------------------- /test/fixtures/attributes-assertions-dynamic-import/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/attributes-assertions-dynamic-import/actual.js -------------------------------------------------------------------------------- /test/fixtures/attributes-assertions-dynamic-import/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/attributes-assertions-dynamic-import/expected.json -------------------------------------------------------------------------------- /test/fixtures/attributes-assertions-export/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/attributes-assertions-export/actual.js -------------------------------------------------------------------------------- /test/fixtures/attributes-assertions-export/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/attributes-assertions-export/expected.json -------------------------------------------------------------------------------- /test/fixtures/attributes-assertions-import/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/attributes-assertions-import/actual.js -------------------------------------------------------------------------------- /test/fixtures/attributes-assertions-import/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/attributes-assertions-import/expected.json -------------------------------------------------------------------------------- /test/fixtures/duplicated-key/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/duplicated-key/actual.js -------------------------------------------------------------------------------- /test/fixtures/duplicated-key/expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "error": "Duplicated key in attributes (1:63)" 3 | } -------------------------------------------------------------------------------- /test/fixtures/dynamic-import-async-expression/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/dynamic-import-async-expression/actual.js -------------------------------------------------------------------------------- /test/fixtures/dynamic-import-async-expression/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/dynamic-import-async-expression/expected.json -------------------------------------------------------------------------------- /test/fixtures/dynamic-import-with-attributes/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/dynamic-import-with-attributes/actual.js -------------------------------------------------------------------------------- /test/fixtures/dynamic-import-with-attributes/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/dynamic-import-with-attributes/expected.json -------------------------------------------------------------------------------- /test/fixtures/dynamic-import-without-attributes/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/dynamic-import-without-attributes/actual.js -------------------------------------------------------------------------------- /test/fixtures/dynamic-import-without-attributes/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/dynamic-import-without-attributes/expected.json -------------------------------------------------------------------------------- /test/fixtures/export-statement-all-as-quoted-type/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/export-statement-all-as-quoted-type/actual.js -------------------------------------------------------------------------------- /test/fixtures/export-statement-all-as-quoted-type/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/export-statement-all-as-quoted-type/expected.json -------------------------------------------------------------------------------- /test/fixtures/export-statement-all-as-type/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/export-statement-all-as-type/actual.js -------------------------------------------------------------------------------- /test/fixtures/export-statement-all-as-type/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/export-statement-all-as-type/expected.json -------------------------------------------------------------------------------- /test/fixtures/export-statement-all-type/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/export-statement-all-type/actual.js -------------------------------------------------------------------------------- /test/fixtures/export-statement-all-type/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/export-statement-all-type/expected.json -------------------------------------------------------------------------------- /test/fixtures/export-statement-default-as-type/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/export-statement-default-as-type/actual.js -------------------------------------------------------------------------------- /test/fixtures/export-statement-default-as-type/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/export-statement-default-as-type/expected.json -------------------------------------------------------------------------------- /test/fixtures/export-statement-type/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/export-statement-type/actual.js -------------------------------------------------------------------------------- /test/fixtures/export-statement-type/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/export-statement-type/expected.json -------------------------------------------------------------------------------- /test/fixtures/export-statement-without-attributes/actual.js: -------------------------------------------------------------------------------- 1 | export { a } from "./foo.json" 2 | -------------------------------------------------------------------------------- /test/fixtures/export-statement-without-attributes/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/export-statement-without-attributes/expected.json -------------------------------------------------------------------------------- /test/fixtures/keyword-in-ident/actual.js: -------------------------------------------------------------------------------- 1 | function withValidProps() {} 2 | -------------------------------------------------------------------------------- /test/fixtures/keyword-in-ident/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/keyword-in-ident/expected.json -------------------------------------------------------------------------------- /test/fixtures/keyword-without-space/actual.js: -------------------------------------------------------------------------------- 1 | import a from "b" with{ type: "c" }; 2 | -------------------------------------------------------------------------------- /test/fixtures/keyword-without-space/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/keyword-without-space/expected.json -------------------------------------------------------------------------------- /test/fixtures/type/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/type/actual.js -------------------------------------------------------------------------------- /test/fixtures/type/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/type/expected.json -------------------------------------------------------------------------------- /test/fixtures/unsupported-key/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/unsupported-key/actual.js -------------------------------------------------------------------------------- /test/fixtures/unsupported-key/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/unsupported-key/expected.json -------------------------------------------------------------------------------- /test/fixtures/unsupported-value/actual.js: -------------------------------------------------------------------------------- 1 | import json from "./foo.json" with { type: true }; 2 | -------------------------------------------------------------------------------- /test/fixtures/unsupported-value/expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "error": "Only string is supported as an attribute value (1:47)" 3 | } -------------------------------------------------------------------------------- /test/fixtures/with-in-identifier/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/with-in-identifier/actual.js -------------------------------------------------------------------------------- /test/fixtures/with-in-identifier/expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "error": "Unexpected keyword 'with' (2:4)" 3 | } -------------------------------------------------------------------------------- /test/fixtures/with-keyword-export-all/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/with-keyword-export-all/actual.js -------------------------------------------------------------------------------- /test/fixtures/with-keyword-export-all/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/with-keyword-export-all/expected.json -------------------------------------------------------------------------------- /test/fixtures/with-keyword-export-named/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/with-keyword-export-named/actual.js -------------------------------------------------------------------------------- /test/fixtures/with-keyword-export-named/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/with-keyword-export-named/expected.json -------------------------------------------------------------------------------- /test/fixtures/with-keyword-import/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/with-keyword-import/actual.js -------------------------------------------------------------------------------- /test/fixtures/with-keyword-import/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/with-keyword-import/expected.json -------------------------------------------------------------------------------- /test/fixtures/without-attributes/actual.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/without-attributes/actual.js -------------------------------------------------------------------------------- /test/fixtures/without-attributes/expected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/fixtures/without-attributes/expected.json -------------------------------------------------------------------------------- /test/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/index.js -------------------------------------------------------------------------------- /test/test-plugin.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtuc/acorn-import-attributes/HEAD/test/test-plugin.js --------------------------------------------------------------------------------