Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add full type file eslint config #85

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

72 changes: 0 additions & 72 deletions .eslintrc.js

This file was deleted.

4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: '🐛 Bug report'
name: 🐛 Bug report
description: Create a report to help us improve Fluent Editor
title: '🐛 [Bug]: '
labels: ['🐛 bug']
labels: [🐛 bug]
body:
- type: markdown
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: ✨ Feature Request
description: Propose new features to @opentiny/fluent-editor to improve it.
title: '✨ [Feature]: '
labels: ['✨ feature']
labels: [✨ feature]
body:
- type: textarea
id: feature-solve
Expand Down
12 changes: 6 additions & 6 deletions .github/auto-labeler.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
version: v1

labels:
- label: 'enhancement'
- label: enhancement
sync: true
matcher:
title: '^feat:.*'
- label: 'documentation'
- label: documentation
sync: true
matcher:
title: '^docs:.*'
- label: 'documentation'
- label: documentation
sync: true
matcher:
title: '^chore:.*'
- label: 'bug'
- label: bug
sync: true
matcher:
title: '^fix:.*'
- label: 'ci'
- label: ci
sync: true
matcher:
title: '^ci:.*'
- label: 'e2e-test'
- label: e2e-test
sync: true
matcher:
title: '^test:.*'
6 changes: 3 additions & 3 deletions .github/workflows/auto-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Auto Deploy
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
branches: [main]
paths:
- 'packages/docs/**'
- '!packages/docs/**/*.spec.ts'
Expand All @@ -20,7 +20,7 @@ permissions:

# Allow one concurrent deployment
concurrency:
group: "pages"
group: pages
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -58,4 +58,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v1
40 changes: 20 additions & 20 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
name: Playwright Tests
on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: dev start
run: pnpm dev & sleep 5
- name: Install Playwright Browsers
run: pnpm install:browser
- name: Run Playwright tests
run: pnpm test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: dev start
run: pnpm dev & sleep 5
- name: Install Playwright Browsers
run: pnpm install:browser
- name: Run Playwright tests
run: pnpm test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
16 changes: 14 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,24 @@
"source.organizeImports": "never"
},
"eslint.enable": true,
"eslint.runtime": "node",
"eslint.format.enable": true,
"eslint.useFlatConfig": false,
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml",
"toml",
"xml",
"css",
"less",
"scss",
"pcss",
"postcss"
zzxming marked this conversation as resolved.
Show resolved Hide resolved
zzxming marked this conversation as resolved.
Show resolved Hide resolved
]
}
62 changes: 62 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import antfu from '@antfu/eslint-config'

export default antfu(
{
stylistic: {
indent: 2,
quotes: 'single',
semi: false,
},
typescript: true,
vue: true,
regexp: false,
ignores: [
'dist',
'node_modules',
],
},
{
rules: {
'eol-last': 'error',
'no-trailing-spaces': 'error',
'comma-style': ['error', 'last'],
'comma-dangle': ['error', 'always-multiline'],
'no-multi-spaces': 'error',
'quotes': [
'error',
'single',
{ avoidEscape: true, allowTemplateLiterals: true },
],
'camelcase': ['error', { properties: 'never' }],
'object-curly-spacing': ['error', 'always'],

'ts/no-unused-vars': 'off',
'ts/explicit-module-boundary-types': 'off',
'ts/no-explicit-any': 'off',
'ts/no-var-requires': 'off',
'ts/no-this-alias': 'off',
'ts/ban-ts-comment': 'off',
'ts/no-empty-function': 'off',
'ts/no-use-before-define': 'off',
'ts/no-unsafe-function-type': 'off',
zzxming marked this conversation as resolved.
Show resolved Hide resolved

'vue/multi-word-component-names': 'off',

'node/prefer-global/process': 'off',

zzxming marked this conversation as resolved.
Show resolved Hide resolved
'no-restricted-globals': 'off',
'eqeqeq': 'off',
'no-new-func': 'off',
'no-alert': 'off',
'prefer-promise-reject-errors': 'off',

'antfu/if-newline': 'off',

'command/command': 'off',

'unused-imports/no-unused-vars': 'off',

'unicorn/no-new-array': 'off',
},
zzxming marked this conversation as resolved.
Show resolved Hide resolved
},
)
zzxming marked this conversation as resolved.
Show resolved Hide resolved
36 changes: 16 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"name": "root",
"private": true,
"description": "A rich text editor based on Quill 2.0, which extends rich modules and formats on the basis of Quill. It is powerful and out-of-the-box.",
"author": "OpenTiny Team",
"license": "MIT",
"homepage": "",
"repository": {
"type": "git",
"url": "git@github.com:opentiny/fluent-editor.git"
},
"bugs": {
"url": "https://github.com/opentiny/fluent-editor/issues"
},
"keywords": [
"editor",
"rich-text-editor",
Expand All @@ -13,34 +22,21 @@
"opentiny",
"fluent-editor"
],
"author": "OpenTiny Team",
"license": "MIT",
"repository": {
"type": "git",
"url": "git@github.com:opentiny/fluent-editor.git"
},
"bugs": {
"url": "https://github.com/opentiny/fluent-editor/issues"
},
"scripts": {
"dev": "pnpm -F fluent-editor-docs dev",
"build": "pnpm -F fluent-editor-docs build",
"build:lib": "pnpm -F @opentiny/fluent-editor build",
"lint": "eslint \"packages/**/*.{js,ts,vue}\" --cache",
"lint:fix": "eslint \"packages/**/*.{js,ts,vue}\" --fix",
"lint": "eslint . --cache",
"lint:fix": "eslint . --fix",
zzxming marked this conversation as resolved.
Show resolved Hide resolved
"install:browser": "pnpm -F fluent-editor-docs install:browser",
"test": "pnpm -F fluent-editor-docs test",
"report": "pnpm -F fluent-editor-docs report"
},
"devDependencies": {
"@types/node": "^15.0.2",
"@stylistic/eslint-plugin": "^2.7.2",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"eslint": "^8.57.0",
"eslint-plugin-vue": "^9.27.0",
"lint-staged": "^12.1.4",
"quill":"^2.0.0"
"@antfu/eslint-config": "^3.7.3",
"@types/node": "^22.7.0",
"eslint": "^9.0.0",
"lint-staged": "^12.1.4"
},
"gitHooks": {
"pre-commit": "lint-staged",
Expand All @@ -52,4 +48,4 @@
"git add"
]
}
}
}
Loading
Loading