Skip to content

Commit

Permalink
chore: 🤖 remove prettier and use antfu's eslint config (Milkdown#825)
Browse files Browse the repository at this point in the history
* chore: 🤖 remove prettier and use antfu's eslint config

* test: 💍 optimize test

* test: 💍 remove prettier test

* chore: 🤖 remove prettier in dev contaienr extension
  • Loading branch information
Saul-Mirone authored Nov 15, 2022
1 parent c2ff055 commit 5819548
Show file tree
Hide file tree
Showing 504 changed files with 23,247 additions and 22,305 deletions.
1 change: 0 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"dbaeumer.vscode-eslint",
"eamodio.gitlens",
"eg2.vscode-npm-scrip",
"esbenp.prettier-vscode",
"gruntfuggly.todo-tree",
"visualstudioexptteam.vscodeintellicode",
"mhutchie.git-graph"
Expand Down
7 changes: 4 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
94 changes: 34 additions & 60 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,66 +1,40 @@
/* Copyright 2021, Milkdown by Mirone. */

module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:promise/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:prettier/recommended',
'plugin:react-hooks/recommended',
],
plugins: ['simple-import-sort', 'header', 'eslint-plugin-tsdoc'],
env: {
browser: true,
node: true,
extends: ['@antfu/eslint-config-ts', 'plugin:react-hooks/recommended'],
plugins: ['header', 'eslint-plugin-tsdoc'],
rules: {
'tsdoc/syntax': 'warn',
'yml/no-empty-mapping-value': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
settings: {
react: {
version: 'detect',
},
rules: {
'no-console': ['error', { allow: ['warn', 'error'] }],

'import/prefer-default-export': 'off',
'import/no-default-export': 'error',
'import/no-unresolved': ['error', { ignore: ['@milkdown/prose/*', 'mdast', 'unist', 'vitest'] }],

'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': 'off',

'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',

'tsdoc/syntax': 'warn',

'header/header': ['error', 'block', ' Copyright 2021, Milkdown by Mirone. '],
},
overrides: [
{
files: ['**/vue/**/*.tsx'],
rules: {
'react-hooks/rules-of-hooks': 'off',
},
},
{
files: ['**/table/**/*.ts'],
rules: {
eqeqeq: 'off',
},
},
settings: {
react: {
version: 'detect',
},
{
files: ['**/*.ts', '**/*.tsx', '**/*.js'],
rules: {
'header/header': [
'error',
'block',
' Copyright 2021, Milkdown by Mirone. ',
],
},
},
overrides: [
{
files: ['**/*.js'],
rules: {
'global-require': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/naming-convention': 'off',
'import/no-default-export': 'off',
},
},
{
files: ['**/vue/**/*.tsx'],
rules: {
'react-hooks/rules-of-hooks': 'off',
},
},
{
files: ['shim.d.ts', 'vite.config.ts', 'playwright.config.ts', 'cypress.config.ts'],
rules: {
'import/no-default-export': 'off',
},
},
],
};
],
}
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ body:
label: Link to runnable example
description: |
Link to repository or sandbox with runnable example of the issue.
> You can also use a [share link](https://milkdown.dev/online-demo?text=VAB5AHAAZQAgAHkAbwB1AHIAIABjAG8AbgB0AGUAbgB0ACAAaABlAHIAZQAuAC4ALgAKAAoA) of online playground if the issue is about markdown parse/serialize.
Some starters:
Expand Down
12 changes: 6 additions & 6 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: 💬 Github Discussions
url: https://github.com/Saul-Mirone/milkdown/discussions
about: Use github issues for bug reports and feature requests. For questions please use discussions.
- name: 🏙 Discord Community
url: https://discord.gg/SdMnrSMyBX
about: Ask for help in the Discord community.
- name: 💬 Github Discussions
url: https://github.com/Saul-Mirone/milkdown/discussions
about: Use github issues for bug reports and feature requests. For questions please use discussions.
- name: 🏙 Discord Community
url: https://discord.gg/SdMnrSMyBX
about: Ask for help in the Discord community.
12 changes: 6 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
open-pull-requests-limit: 10
schedule:
interval: 'weekly'
day: 'monday'
- package-ecosystem: github-actions
directory: /
open-pull-requests-limit: 10
schedule:
interval: weekly
day: monday
2 changes: 1 addition & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": ["config:base", ":preserveSemverRanges", "group:all"]
"extends": ["config:base", ":preserveSemverRanges", "group:all"]
}
16 changes: 8 additions & 8 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ daysUntilStale: 14
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
- planned
- blocked
- bug
- pinned
- security
- planned
- blocked
- bug
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
54 changes: 27 additions & 27 deletions .github/workflows/ci-for-pr.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
name: On Pull Request

on:
workflow_dispatch:
pull_request:
branches: 'main'
workflow_dispatch:
pull_request:
branches: main

env:
CI: true
NX_CLOUD_DISTRIBUTED_EXECUTION: true
CI: true
NX_CLOUD_DISTRIBUTED_EXECUTION: true
jobs:
start:
uses: ./.github/workflows/start-nx-cloud.yml
start:
uses: ./.github/workflows/start-nx-cloud.yml

agent:
uses: ./.github/workflows/start-agents.yml
agent:
uses: ./.github/workflows/start-agents.yml

test:
needs: start
uses: ./.github/workflows/test.yml
secrets:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CHANGESET_TOKEN: ${{ secrets.CHANGESET_TOKEN }}
test:
needs: start
uses: ./.github/workflows/test.yml
secrets:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CHANGESET_TOKEN: ${{ secrets.CHANGESET_TOKEN }}

stop:
if: ${{ always() }}
needs: test
uses: ./.github/workflows/stop-nx-cloud.yml
stop:
if: ${{ always() }}
needs: test
uses: ./.github/workflows/stop-nx-cloud.yml

report:
if: ${{ always() }}
needs: [stop, test, start]
runs-on: ubuntu-latest
steps:
- name: on error
if: ${{ needs.start.result != 'success' || needs.test.result != 'success' }}
run: exit 1
report:
if: ${{ always() }}
needs: [stop, test, start]
runs-on: ubuntu-latest
steps:
- name: on error
if: ${{ needs.start.result != 'success' || needs.test.result != 'success' }}
run: exit 1
64 changes: 32 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
name: On Push

on:
push:
branches: main
push:
branches: main

env:
CI: true
NX_CLOUD_DISTRIBUTED_EXECUTION: true
CI: true
NX_CLOUD_DISTRIBUTED_EXECUTION: true
jobs:
start:
uses: ./.github/workflows/start-nx-cloud.yml
start:
uses: ./.github/workflows/start-nx-cloud.yml

agent:
uses: ./.github/workflows/start-agents.yml
agent:
uses: ./.github/workflows/start-agents.yml

test:
needs: start
uses: ./.github/workflows/test.yml
secrets:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CHANGESET_TOKEN: ${{ secrets.CHANGESET_TOKEN }}
test:
needs: start
uses: ./.github/workflows/test.yml
secrets:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CHANGESET_TOKEN: ${{ secrets.CHANGESET_TOKEN }}

release:
needs: test
uses: ./.github/workflows/release-package.yml
secrets:
CHANGESET_TOKEN: ${{ secrets.CHANGESET_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
release:
needs: test
uses: ./.github/workflows/release-package.yml
secrets:
CHANGESET_TOKEN: ${{ secrets.CHANGESET_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

stop:
if: ${{ always() }}
needs: release
uses: ./.github/workflows/stop-nx-cloud.yml
stop:
if: ${{ always() }}
needs: release
uses: ./.github/workflows/stop-nx-cloud.yml

report:
if: ${{ always() }}
needs: [stop, test, start, release]
runs-on: ubuntu-latest
steps:
- name: on error
if: ${{ needs.start.result != 'success' || needs.test.result != 'success' || needs.release.result != 'success' }}
run: exit 1
report:
if: ${{ always() }}
needs: [stop, test, start, release]
runs-on: ubuntu-latest
steps:
- name: on error
if: ${{ needs.start.result != 'success' || needs.test.result != 'success' || needs.release.result != 'success' }}
run: exit 1
Loading

0 comments on commit 5819548

Please sign in to comment.