Skip to content

Commit

Permalink
Add anchored component as a linter ES8 exception due to use of async …
Browse files Browse the repository at this point in the history
…/ await on WebXR Anchor Module integration (fix #5381)
  • Loading branch information
dmarcos committed Nov 9, 2023
1 parent 513c5d0 commit 8cb7226
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
14 changes: 10 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

/* These rules are compatible with ES5
However they involve non-trivial code changes
Therefore need more careful review before adopting. */
Therefore need more careful review before adopting. */
"array-callback-return": "off",
"no-mixed-operators": "off",
"no-unreachable-loop": "off",
Expand All @@ -21,7 +21,7 @@

/* These rules are compatible with ES5
However they involve large-scale changes to the codebase, so
careful co-ordination is needed in adopting the rule to avoid
careful co-ordination is needed in adopting the rule to avoid
creating merge issues for other PRs. */
"dot-notation": "off",
"indent": "off",
Expand All @@ -32,10 +32,9 @@
},
"overrides": [
{
/* Code within /src is restricted to using ES5 JavaScript
/* Code within /src is restricted to using ES5 JavaScript
The exception is that ES6 classes are used sparingly - see exceptions below. */
"files": ["./src/**/*.js"],

"parserOptions": {
"sourceType": "script",
"ecmaVersion": 5
Expand All @@ -55,6 +54,13 @@
"ecmaVersion": 6
}
},
{
/* This module uses ES8 async / await due to WebXR Anchor Module integration */
"files": ["./src/components/anchored.js"],
"parserOptions": {
"ecmaVersion": 8
}
},
{
/* This code is external, and the ES5 restrictions do not apply to it. */
"files": ["./src/lib/**/*.js"],
Expand Down
1 change: 0 additions & 1 deletion src/components/anchored.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,3 @@ function anchorsSupported (sceneEl) {
var session = xrManager.getSession();
return (session && session.restorePersistentAnchor);
}

0 comments on commit 8cb7226

Please sign in to comment.