-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: rewrite by typescript and esm only
BREAKING CHANGE: This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required. And remove preLangClass option.
- Loading branch information
1 parent
e802421
commit 7ea69f0
Showing
39 changed files
with
695 additions
and
283 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
# mili upgrade type: cover | ||
extends: | ||
- '@commitlint/config-conventional' |
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 +1,3 @@ | ||
{ "path": "cz-conventional-changelog" } | ||
{ | ||
"path": "cz-conventional-changelog" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/lib | ||
/es | ||
/dist |
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,202 @@ | ||
extends: | ||
- eslint:recommended | ||
parserOptions: | ||
ecmaVersion: 2017 | ||
sourceType: module | ||
env: | ||
es6: true | ||
node: true | ||
rules: | ||
object-shorthand: error | ||
eqeqeq: error | ||
no-floating-decimal: error | ||
no-var: error | ||
no-implicit-coercion: | ||
- error | ||
- allow: | ||
- '!!' | ||
no-multi-spaces: error | ||
no-useless-return: error | ||
no-undef-init: error | ||
no-trailing-spaces: error | ||
no-unneeded-ternary: error | ||
no-whitespace-before-property: error | ||
nonblock-statement-body-position: error | ||
space-infix-ops: error | ||
space-unary-ops: error | ||
switch-colon-spacing: error | ||
arrow-body-style: error | ||
arrow-spacing: error | ||
generator-star-spacing: error | ||
no-useless-computed-key: error | ||
no-useless-rename: error | ||
new-cap: error | ||
no-lonely-if: error | ||
prefer-const: error | ||
prefer-spread: error | ||
prefer-template: error | ||
rest-spread-spacing: error | ||
sort-imports: 'off' | ||
template-curly-spacing: error | ||
yield-star-spacing: error | ||
multiline-comment-style: | ||
- error | ||
- separate-lines | ||
indent: | ||
- error | ||
- 2 | ||
semi: | ||
- error | ||
- never | ||
func-call-spacing: | ||
- error | ||
- never | ||
yoda: | ||
- error | ||
- never | ||
curly: | ||
- error | ||
- multi-line | ||
- consistent | ||
quotes: | ||
- error | ||
- single | ||
- avoidEscape: true | ||
dot-location: | ||
- error | ||
- property | ||
array-bracket-spacing: | ||
- error | ||
- never | ||
array-bracket-newline: | ||
- error | ||
- consistent | ||
block-spacing: | ||
- error | ||
- always | ||
brace-style: | ||
- error | ||
- 1tbs | ||
comma-dangle: | ||
- error | ||
- always-multiline | ||
comma-style: | ||
- error | ||
- last | ||
computed-property-spacing: | ||
- error | ||
- never | ||
function-paren-newline: | ||
- error | ||
- multiline | ||
implicit-arrow-linebreak: | ||
- error | ||
- beside | ||
key-spacing: | ||
- error | ||
- afterColon: true | ||
beforeColon: false | ||
mode: strict | ||
keyword-spacing: | ||
- error | ||
- before: true | ||
after: true | ||
line-comment-position: | ||
- error | ||
- above | ||
linebreak-style: | ||
- error | ||
- unix | ||
lines-between-class-members: | ||
- error | ||
- always | ||
- exceptAfterSingleLine: true | ||
no-multiple-empty-lines: | ||
- error | ||
- max: 2 | ||
no-empty: | ||
- error | ||
- allowEmptyCatch: true | ||
object-curly-newline: | ||
- error | ||
- multiline: true | ||
consistent: true | ||
object-curly-spacing: | ||
- error | ||
- always | ||
one-var-declaration-per-line: | ||
- error | ||
- initializations | ||
padded-blocks: | ||
- error | ||
- never | ||
quote-props: | ||
- error | ||
- as-needed | ||
space-before-blocks: | ||
- error | ||
- always | ||
space-before-function-paren: | ||
- error | ||
- never | ||
space-in-parens: | ||
- error | ||
- never | ||
spaced-comment: | ||
- error | ||
- always | ||
arrow-parens: | ||
- error | ||
- as-needed | ||
no-unused-vars: error | ||
overrides: | ||
- files: | ||
- '**/*.ts' | ||
- '**/*.tsx' | ||
extends: | ||
- plugin:@typescript-eslint/recommended | ||
- plugin:@typescript-eslint/recommended-requiring-type-checking | ||
parser: '@typescript-eslint/parser' | ||
parserOptions: | ||
project: | ||
- ./tsconfig.json | ||
- ./tests/tsconfig.json | ||
plugins: | ||
- '@typescript-eslint' | ||
rules: | ||
'@typescript-eslint/no-unsafe-call': 'off' | ||
'@typescript-eslint/no-unsafe-member-access': 'off' | ||
'@typescript-eslint/no-unsafe-assignment': 'off' | ||
new-cap: | ||
- error | ||
- capIsNew: false | ||
'@typescript-eslint/no-floating-promises': error | ||
semi: 'off' | ||
'@typescript-eslint/semi': | ||
- error | ||
- never | ||
indent: 'off' | ||
'@typescript-eslint/indent': | ||
- error | ||
- 2 | ||
'@typescript-eslint/explicit-member-accessibility': | ||
- error | ||
- overrides: | ||
accessors: 'off' | ||
constructors: 'off' | ||
properties: no-public | ||
'@typescript-eslint/explicit-function-return-type': | ||
- error | ||
- allowHigherOrderFunctions: true | ||
allowExpressions: true | ||
allowTypedFunctionExpressions: true | ||
'@typescript-eslint/member-delimiter-style': | ||
- error | ||
- multiline: | ||
delimiter: none | ||
no-unused-vars: 'off' | ||
'@typescript-eslint/no-unused-vars': error | ||
func-call-spacing: 'off' | ||
'@typescript-eslint/func-call-spacing': | ||
- error | ||
- never |
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,17 +1,13 @@ | ||
**IMPORTANT: Please do not create a Pull Request without creating an issue first.** | ||
Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request. | ||
<!-- IMPORTANT: Please do not create a Pull Request without creating an issue first --> | ||
<!-- Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request. --> | ||
|
||
|
||
**Close issues** | ||
List the issues solved.(e.g. 'close #xxx, close #xxx and close #xxx') | ||
|
||
|
||
**Additional context** | ||
Please provide enough information so that others can review your pull request. | ||
|
||
|
||
**Please check if the PR fulfills these requirements** | ||
|
||
- [ ] Have you followed the guidelines in our [Contributing document](https://github.com/Val-istar-Guo/mili/blob/master/.github/CODE_OF_CONDUCT.md)? | ||
- [ ] Have you followed the guidelines in our [Contributing document](https://github.com/Val-istar-Guo/rehype-prism/blob/master/.github/CODE_OF_CONDUCT.md)? | ||
- [ ] Have you written new tests for your core changes, as applicable? | ||
- [ ] Have you successfully ran tests with your changes locally? | ||
- [ ] Have you written or modified docs for your core changes, as applicable? |
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,43 @@ | ||
name: "CodeQL analysis" | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
branches: | ||
- master | ||
- main | ||
schedule: | ||
- cron: '0 4 * * 1' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: | ||
- javascript | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: ${{matrix.language}} | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v1 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 |
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,29 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
name: Release | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: GoogleCloudPlatform/release-please-action@v2 | ||
id: release | ||
with: | ||
token: ${{secrets.RELEASE_TOKEN}} | ||
release-type: node | ||
package-name: "rehype-prism" | ||
- uses: actions/checkout@v2 | ||
if: ${{ steps.release.outputs.release_created }} | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
registry-url: 'https://registry.npmjs.org' | ||
if: ${{ steps.release.outputs.release_created }} | ||
- run: npm i | ||
if: ${{ steps.release.outputs.release_created }} | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | ||
if: ${{ steps.release.outputs.release_created }} |
Oops, something went wrong.