Skip to content

Commit b6a6687

Browse files
Switch from TS to JS (#4000)
* Transform `src/core/prism.ts` * Transform `src/core/stringify.ts` * Transform `src/core/classes/hooks.ts` * Transform `src/core/highlight.ts` * Transform `src/core/highlight-all.ts` * Transform `src/core/highlight-element.ts` * Transform `src/config.ts` * Transform `src/core/tokenize/tokenize.ts` * Transform `src/core/classes/prism.ts` * Transform `src/core.ts` * Transform `src/global.ts` * Transform `src/index.ts` * Transform `src/auto-start.ts` * Transform `src/util` * Transform `src/shared` * Transform `src/prism.global.ts` * Transform `src/shared/languages` * Transform `src/shared/meta` * Transform `src/shared.ts` * Transform `src/core/classes/token.ts` * Transform `src/core/tokenize/util.ts` * Transform `src/core/tokenize/match.js` * Transform `src/core/registry.ts` * Transform `src/load-languages.ts` * Transform `src/core/linked-list.ts` * Transforming `tests/` * Transforming `tests/core` * Transforming `tests/helper` * Partially transform languages * Transform the rest of the languages * Remove TS files from `src/languages` * Remove TS files from `tests/` * Remove TS files from `tests/core` * Remove TS files from `tests/helper` * Transform plugins and remove corresponding TS files * Transform `tests/plugins` * Tests don't depend on TS anymore * Remove TS files from `src/` * Remove TS files from `src/shared` * Remove TS files from `src/shared/languages` * Remove TS files from `src/shared/meta` * Remove TS files from `src/util` * Remove TS files from `src/core` and sub-directories * Fix imports in `types.d.ts` * Transform `scripts` * Transform `benchmark` * Adjust ESLint rules * Build types * Get rid of TS We use it to build types only. * Run `npm run build` We updated the comment in the build script, so it should be updated in the corresponding CSS file. * Improve types for hooks * Improve types for token * Improve types for Prism config * Improve types for registry * Improve types for Prism class * Improve types for highlight methods * Improve types for stringify * Improve types for linked list * Adjust types in tokenize functions * Fix types in `load-languages.js` * Improve types of util functions * Adjust types for shared/languages * Fix types in plugins * Fix types for tests * Fix types for tokenize string * Fix types for language definitions * Another iteration on types * And one more * And a bit more fixes * [plugins] Add missed template specifier * [languages] Add types to `export default`s * Fix types in scripts * Remove `@private` and `@default` to correctly generate types * Some improvements to types in tests * [benchmark] Some tweaks of types * Re-enable types check in JS files - Restore `tsconfig.json` but allow implicit `any` - Add the `typecheck` NPM script - Adjust the build script (use `tsconfig.json` and remove redundant code) * Fix type inconsistencies in core files and plugins * Fix some (fixable) TS errors * Fix the rest of the type errors in language definitions
1 parent 328f579 commit b6a6687

File tree

432 files changed

+4895
-4507
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

432 files changed

+4895
-4507
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,6 @@ jobs:
5454
- run: npm ci
5555
- run: npm run lint:ci
5656

57-
type-check:
58-
runs-on: ubuntu-latest
59-
60-
steps:
61-
- uses: actions/checkout@v3
62-
- name: Use Node.js 18.x
63-
uses: actions/setup-node@v3
64-
with:
65-
node-version: 18.x
66-
- run: npm ci
67-
- run: npm run tsc
68-
6957
coverage:
7058
runs-on: ubuntu-latest
7159

.mocharc.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)