-
Notifications
You must be signed in to change notification settings - Fork 489
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Migrate to Mocha 10 - Rename src/*.js to src/*.mjs and test/*.js to test/*.spec.mjs - Move misplaced "eslint-plugin-local-rules" to devDependencies - Remove unused reify now that we are fully .mjs - Deprecate load*/download functions and remove associated tests - Remove dead code (private load*() function, isNode/isBrowser...) - Support multiple test runner: ```sh npx mocha npx bun test npx jasmine "**/*.spec.mjs" # may fail on strict compare ``` * Rework eslint rules There are currently 3 local rules: - ban forEach => migrate to a "selector" rule - prevent import loop => did nothing - force import extension => esbuild enforce it already This halves (226 => 139) our NPM dependencies * Use eslint@9 Use new configuration format since package.json based configuration have been droped * Apply remarks
- Loading branch information
Showing
122 changed files
with
1,116 additions
and
3,724 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
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,9 +1,9 @@ | ||
|
||
import opentype from '../../dist/opentype.module' | ||
import opentype from '../../dist/opentype.mjs' | ||
console.log(opentype) | ||
// or | ||
import { load } from '../../dist/opentype.module' | ||
import { load } from '../../dist/opentype.mjs' | ||
console.log(load) | ||
// or | ||
import * as mySpecialOpentype from '../../dist/opentype.module' | ||
import * as mySpecialOpentype from '../../dist/opentype.mjs' | ||
console.log(mySpecialOpentype) |
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
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 @@ | ||
<script type="module"> | ||
import * as ot from '/dist/opentype.module.js'; | ||
import * as ot from '/dist/opentype.mjs'; | ||
console.log(ot) | ||
</script> |
This file was deleted.
Oops, something went wrong.
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,50 @@ | ||
import js from "@eslint/js"; | ||
|
||
export default [ | ||
js.configs.recommended, | ||
{ | ||
languageOptions: { | ||
ecmaVersion: 2018, | ||
sourceType: "module", | ||
globals: { | ||
console: "readonly", | ||
// ugly platform-dependant classes and objects | ||
DecompressionStream: "readonly", | ||
Response: "readonly", | ||
TextDecoder: "readonly", | ||
SVGPathElement: "readonly", | ||
DOMParser: "readonly", | ||
Image: "readonly", | ||
document: "readonly", | ||
} | ||
}, | ||
rules: { | ||
"indent": [ | ||
"error", | ||
4, | ||
{ | ||
"SwitchCase": 1 | ||
} | ||
], | ||
"linebreak-style": [ | ||
"error", | ||
"unix" | ||
], | ||
"quotes": [ | ||
"error", | ||
"single" | ||
], | ||
"semi": [ | ||
"error", | ||
"always" | ||
], | ||
"no-restricted-syntax": [ | ||
"error", | ||
{ | ||
"message": "For consistency, Use `for()` loops instead of `.forEach()`", | ||
"selector": "MemberExpression > Identifier[name=\"forEach\"]" | ||
} | ||
] | ||
} | ||
} | ||
] |
Oops, something went wrong.