You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+60-6Lines changed: 60 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ Modern JavaScript builds assume proper transpilation via tools like Babel. ES Ch
80
80
81
81
## What features does ES Check check for?
82
82
83
-
ES Check validates syntax by default. Add `--checkFeatures` for ES version-specific feature checking. View supported [features](./constants.js).
83
+
ES Check validates syntax by default. Add `--checkFeatures` for ES version-specific feature checking. View supported [features](./lib/helpers/detectFeatures/constants/es-features/).
84
84
85
85
---
86
86
@@ -638,15 +638,69 @@ ES Check is a small utility using powerful tools that [Isaac Z. Schlueter](https
638
638
639
639
---
640
640
641
-
## Contributing
641
+
## Source Maps
642
642
643
-
ES Check has 7 dependencies: [acorn and acorn-walk](https://github.com/ternjs/acorn/), [fast-glob](https://github.com/mrmlnc/fast-glob), [supports-color](https://github.com/chalk/supports-color), [winston](https://github.com/winstonjs/winston), [browserslist](https://github.com/browserslist/browserslist), and [commander](https://github.com/tj/commander). To contribute, file an [issue](https://github.com/yowainwright/es-check/issues) or submit a pull request.
643
+
ES Check supports source maps for better error reporting. When a `.map` file exists alongside your JavaScript file, ES Check will automatically map error positions from transpiled code back to the original source:
644
644
645
-
To update es versions, check out these lines of code [here](https://github.com/yowainwright/es-check/blob/main/index.js#L92-L153) and [here (in acorn.js)](https://github.com/acornjs/acorn/blob/3221fa54f9dea30338228b97210c4f1fd332652d/acorn/src/acorn.d.ts#L586).
645
+
```sh
646
+
es-check es5 './dist/bundle.js'
647
+
```
646
648
647
-
To update es feature detection, update these files [here](./utils.js) and [here](./constants.js) as enabled feature testing using [acorn walk](https://github.com/acornjs/acorn/blob/master/acorn-walk/README.md).
649
+
If `bundle.js.map` exists, errors will reference the original source file and line numbers instead of the minified positions. This helps quickly identify issues in your source code.
650
+
651
+
## Contributing
648
652
649
-
[tests](./test.js) to go with new version and/or feature detection updates are great to have!
653
+
ES Check has only 4 core dependencies: [acorn](https://github.com/ternjs/acorn/) for JavaScript parsing, [fast-brake](https://github.com/stackblitz/fast-brake) for lightweight feature detection, [fast-glob](https://github.com/mrmlnc/fast-glob) for file globbing, and [browserslist](https://github.com/browserslist/browserslist) for browser targeting.
654
+
655
+
The CLI, logging, and source map support are implemented with custom lightweight solutions using Node.js built-ins to minimize dependencies. To contribute, file an [issue](https://github.com/yowainwright/es-check/issues) or submit a pull request.
656
+
657
+
### Codebase Architecture
658
+
659
+
ES Check follows a modular architecture with clear separation of concerns:
660
+
661
+
```
662
+
lib/
663
+
├── cli/
664
+
│ ├── index.js
665
+
│ ├── handler.js
666
+
│ ├── utils.js
667
+
│ └── constants.js
668
+
├── check-runner/
669
+
│ ├── index.js
670
+
│ └── utils.js
671
+
├── constants/
672
+
│ ├── versions.js
673
+
│ └── index.js
674
+
├── helpers/
675
+
│ ├── detectFeatures/
676
+
│ │ ├── index.js
677
+
│ │ └── constants/
678
+
│ │ ├── es-features/
679
+
│ │ ├── polyfills.js
680
+
│ │ └── index.js
681
+
│ ├── ast.js
682
+
│ ├── files.js
683
+
│ ├── logger.js
684
+
│ ├── parsers.js
685
+
│ └── sourcemap.js
686
+
├── browserslist.js
687
+
├── cache.js
688
+
├── config.js
689
+
└── index.js
690
+
```
691
+
692
+
### Contributing to ES Features
693
+
694
+
To update ES version support:
695
+
- Update [ES version mappings](./lib/constants/versions.js)
696
+
- Reference [Acorn ES version support](https://github.com/acornjs/acorn/blob/3221fa54f9dea30338228b97210c4f1fd332652d/acorn/src/acorn.d.ts#L586)
697
+
698
+
To update ES feature detection:
699
+
- Add features to [version-specific files](./lib/helpers/detectFeatures/constants/es-features/) (e.g., `6.js` for ES6 features)
700
+
- Update [polyfill patterns](./lib/helpers/detectFeatures/constants/polyfills.js) if needed
0 commit comments