diff --git a/.eslintrc.cjs b/.eslintrc.cjs index eb2c42e..3eeb06d 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,3 +1,8 @@ +/** + * This will be in the future a independent eslint-config package. (Project). + * [Readable project](https://github.com/orgs/Org013/projects/1) + */ + module.exports = { root: true, extends: [ @@ -27,6 +32,150 @@ module.exports = { { files: ['*.json', '*.json5', '*.jsonc'], parser: 'jsonc-eslint-parser', + rules: { + 'jsonc/array-bracket-spacing': ['error', 'never'], + 'jsonc/comma-dangle': ['error', 'never'], + 'jsonc/comma-style': ['error', 'last'], + 'jsonc/indent': ['error', 'tab'], + 'jsonc/key-spacing': ['error', { beforeColon: false, afterColon: true }], + 'jsonc/no-octal-escape': 'error', + 'jsonc/object-curly-newline': ['error', { multiline: true, consistent: true }], + 'jsonc/object-curly-spacing': ['error', 'always'], + 'jsonc/object-property-newline': ['error', { allowMultiplePropertiesPerLine: true }], + }, + }, + { + files: ['*.yaml', '*.yml'], + parser: 'yaml-eslint-parser', + rules: { + 'spaced-comment': 'off', + }, + }, + { + files: ['package.json'], + parser: 'jsonc-eslint-parser', + rules: { + 'jsonc/sort-keys': [ + 'error', + { + pathPattern: '^$', + order: [ + 'publisher', + 'name', + 'displayName', + 'type', + 'version', + 'private', + 'packageManager', + 'description', + 'author', + 'license', + 'funding', + 'homepage', + 'repository', + 'bugs', + 'keywords', + 'categories', + 'sideEffects', + 'exports', + 'main', + 'module', + 'unpkg', + 'jsdelivr', + 'types', + 'typesVersions', + 'bin', + 'icon', + 'files', + 'engines', + 'activationEvents', + 'contributes', + 'scripts', + 'peerDependencies', + 'peerDependenciesMeta', + 'dependencies', + 'optionalDependencies', + 'devDependencies', + 'pnpm', + 'overrides', + 'resolutions', + 'husky', + 'simple-git-hooks', + 'lint-staged', + 'eslintConfig', + ], + }, + { + pathPattern: '^(?:dev|peer|optional|bundled)?[Dd]ependencies$', + order: { type: 'asc' }, + }, + { + pathPattern: '^exports.*$', + order: [ + 'types', + 'require', + 'import', + ], + }, + ], + }, + }, + { + files: ['*.d.ts'], + rules: { + 'import/no-duplicates': 'off', + }, + }, + { + files: ['*.js', '*.cjs', '*.jsx'], + rules: { + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-require-imports': 'off', + }, + }, + { + files: ['*.ts', '*.tsx', '*.mts', '*.cts'], + rules: { + 'no-void': ['error', { allowAsStatement: true }], + }, + }, + { + files: ['scripts/**/*.*', 'cli.*'], + rules: { + 'no-console': 'off', + }, + }, + { + files: ['*.test.ts', '*.test.js', '*.spec.ts', '*.spec.js'], + rules: { + 'no-unused-expressions': 'off', + 'no-only-tests/no-only-tests': 'error', + }, + }, + { + // Code blocks in markdown file + files: ['**/*.md/*.*'], + rules: { + '@typescript-eslint/no-redeclare': 'off', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/no-use-before-define': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/comma-dangle': 'off', + '@typescript-eslint/consistent-type-imports': 'off', + '@typescript-eslint/no-namespace': 'off', + '@typescript-eslint/no-require-imports': 'off', + 'import/no-unresolved': 'off', + 'unused-imports/no-unused-imports': 'off', + 'unused-imports/no-unused-vars': 'off', + 'no-alert': 'off', + 'no-console': 'off', + 'no-restricted-imports': 'off', + 'no-undef': 'off', + 'no-unused-expressions': 'off', + 'no-unused-vars': 'off', + 'antfu/no-cjs-exports': 'off', + 'antfu/no-ts-export-equal': 'off', + }, }, ], rules: { @@ -36,6 +185,5 @@ module.exports = { 'max-nested-callbacks': ['error', 3], 'complexity': ['error', 2], 'no-tabs': ['error', { allowIndentationTabs: true }], - 'jsonc/indent': ['error', 'tab'], }, }; diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 346df83..840c7ce 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -1,15 +1,15 @@ -name: "▲ Deploy preview to Vercel" +name: ▲ Deploy preview to Vercel on: push: branches: - - "dev" + - dev pull_request: types: [opened, synchronize, reopened] jobs: deploy: - uses: org013/.github/.github/workflows/vercel-deploy.yml@main - secrets: inherit - with: - production: false + uses: org013/.github/.github/workflows/vercel-deploy.yml@main + secrets: inherit + with: + production: false diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e88f725..93eefb6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,13 +1,13 @@ -name: "▲ Deploy to Vercel" +name: ▲ Deploy to Vercel on: push: branches: - - "main" + - main jobs: deploy: - uses: org013/.github/.github/workflows/vercel-deploy.yml@main - secrets: inherit - with: - production: true + uses: org013/.github/.github/workflows/vercel-deploy.yml@main + secrets: inherit + with: + production: true diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml index e8d6b60..7b59171 100644 --- a/.github/workflows/mirror.yml +++ b/.github/workflows/mirror.yml @@ -1,10 +1,10 @@ -name: "🪞 Repository Mirrors" +name: 🪞 Repository Mirrors on: push: branches: - - "main" - - "dev" + - main + - dev jobs: mirror: diff --git a/.vscode/settings.json b/.vscode/settings.json index c043858..ec60749 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { - "prettier.enable": false, - "editor.formatOnSave": false, - "editor.codeActionsOnSave": { - "source.fixAll.eslint": true - } -} \ No newline at end of file + "prettier.enable": false, + "editor.formatOnSave": false, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true + } +}