-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: update source to ES modules Update the source code from CommonJS to ES Modules style. This consists of changing `require`s to `import from` statements, `module.exports` to `export` statements, and in some cases the structure of imports and exports as well. Notably when the old `require` statement also contained some additional logic, which is not possible with import statements. * chore(deps): update meow from ^3.7.0 to ^10.1.1 Update the meow dependency to ^10.1.1 - which is the latest version - and update how it is used in accordance with breaking changes. * refactor: update tests to ES modules * chore: update package manifest Update the exports field for exporting ESM and CJS and set package type to "module". * docs: update JS API example * docs: update config example to use ESM syntax * ci: run tests on Node v12, v14, v16, and v17 * chore: make svglint config file an ESM * fix: loading config files and built-in rules on Windows Use the `"file://"` prefix when loading CLI config and rules to ensure importing always works on Windows. * ci: run CLI on various node versions and operating systems * feat: add CJS version of Node API Add a CommonJS version of the Node API of SVGLint by building it using Rollup. Update the package manifest to allow for importing/requiring ESM and CJS (resp.) and `.gitignore` to ignore the generated CJS file. One "custom" Rollup plugin (provided by Rollup but not included by default) is used, namely `plugin-dynamic-import-vars`. This plugin ensures that dynamic imports are properly handled as the CJS output generated by Rollup cannot dynamically import ESM rules. To make this work the rule-loader had to be updated as well, unfortunately the requirements of this plugin are quite strict and it is required that the `"../rules"` path is hardcoded into the `import` statement. Furthermore it has trouble detecting things that should be ignored, so errors are disabled to prevent errors due to dynamic imports of external plugins. * chore: add .npmrc to enforce `engine-strict` option BREAKING CHANGE: Minimum node version increased to `^12.20.0` or `^14.13.1` or `>=16.0.0`. BREAKING CHANGE: The Node API is now fully `async`.
- Loading branch information
1 parent
8e77613
commit 2d242fe
Showing
37 changed files
with
1,165 additions
and
835 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
.vscode | ||
src/svglint.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
engine-strict=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = { | ||
export default { | ||
rules: { | ||
attr: { | ||
"rule::selector": "path", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.