Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for Import Attributes and RegExp Modifiers #639

Merged
merged 3 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions packages/eslint-visitor-keys/lib/visitor-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,17 @@ const KEYS = {
],
ExportAllDeclaration: [
"exported",
"source"
"source",
"attributes"
],
ExportDefaultDeclaration: [
"declaration"
],
ExportNamedDeclaration: [
"declaration",
"specifiers",
"source"
"source",
"attributes"
],
ExportSpecifier: [
"exported",
Expand Down Expand Up @@ -136,15 +138,21 @@ const KEYS = {
"consequent",
"alternate"
],
ImportAttribute: [
"key",
"value"
],
ImportDeclaration: [
"specifiers",
"source"
"source",
"attributes"
],
ImportDefaultSpecifier: [
"local"
],
ImportExpression: [
"source"
"source",
"options"
],
ImportNamespaceSpecifier: [
"local"
Expand Down
2 changes: 1 addition & 1 deletion packages/espree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"funding": "https://opencollective.com/eslint",
"license": "BSD-2-Clause",
"dependencies": {
"acorn": "^8.12.0",
"acorn": "^8.14.0",
"acorn-jsx": "^5.3.2",
"eslint-visitor-keys": "^4.1.0"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"index": 41,
"lineNumber": 1,
"column": 42,
"message": "Duplicate attribute key 'type'"
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"index": 0,
"lineNumber": 1,
"column": 1,
"message": "'import' and 'export' may appear only with 'sourceType: module'"
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "./foo.json" with { type: "json", type: "html" };
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"index": 19,
"lineNumber": 1,
"column": 20,
"message": "Unexpected token ,"
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import("foo.json", , );
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"index": 41,
"lineNumber": 1,
"column": 42,
"message": "Unexpected token ,"
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"index": 0,
"lineNumber": 1,
"column": 1,
"message": "'import' and 'export' may appear only with 'sourceType: module'"
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "./foo.json" with { type: "json", , };
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"index": 27,
"lineNumber": 1,
"column": 28,
"message": "Unexpected token 42"
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"index": 0,
"lineNumber": 1,
"column": 1,
"message": "'import' and 'export' may appear only with 'sourceType: module'"
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "./foo.json" with { 42: "s" };
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"index": 33,
"lineNumber": 1,
"column": 34,
"message": "Unexpected token 42"
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"index": 0,
"lineNumber": 1,
"column": 1,
"message": "'import' and 'export' may appear only with 'sourceType: module'"
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "./foo.json" with { type: 42 };
Loading