Skip to content

Commit

Permalink
feature/issue 153 import attributes syntax parsing (#157)
Browse files Browse the repository at this point in the history
* import attributes syntax parsing

* add test case for import attributes

* ESLint support for import attributes

* document custom eslint configuration

* update documentation

* remove .only

* document third party acorn plugin

* clarify spec file
  • Loading branch information
thescientist13 authored Apr 12, 2024
1 parent ef5bb27 commit c97da38
Show file tree
Hide file tree
Showing 11 changed files with 1,490 additions and 33 deletions.
10 changes: 10 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
// need this custom parser configuration until ESLint natively supports import attributes
// https://github.com/eslint/eslint/discussions/15305#discussioncomment-2508948
module.exports = {
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
ecmaFeatures: {
jsx: true
},
requireConfigFile: false,
babelOptions: {
plugins: [
'@babel/plugin-syntax-import-assertions'
],
presets: ['@babel/preset-react']
}
},
env: {
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.12.1
18.20.0
6 changes: 3 additions & 3 deletions docs/pages/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,11 @@ A couple things to observe in the above example:
### Prerequisites

There are of couple things you will need to do to use WCC with JSX:
1. NodeJS version needs to be >= `16.x`
1. NodeJS version needs to be >= `18.20.0`
1. You will need to use the _.jsx_ extension
1. Requires the `--experimental-loaders` flag when invoking NodeJS
1. Requires the `--loader` flag when invoking NodeJS
```shell
$ node --experimental-loader ./node_modules/wc-compiler/src/jsx-loader.js server.js
$ node --loader ./node_modules/wc-compiler/src/jsx-loader.js server.js
```

> _See our [example's page](/examples#jsx) for some usages of WCC + JSX._ 👀
Expand Down
Loading

0 comments on commit c97da38

Please sign in to comment.