fix: 🔨 eslint config

This commit is contained in:
Guz013
2023-05-25 16:20:57 -03:00
parent e1e6dca2a9
commit d6ce180dd3
5 changed files with 170 additions and 22 deletions

View File

@@ -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'],
},
};

View File

@@ -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

View File

@@ -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

View File

@@ -1,10 +1,10 @@
name: "🪞 Repository Mirrors"
name: 🪞 Repository Mirrors
on:
push:
branches:
- "main"
- "dev"
- main
- dev
jobs:
mirror:

10
.vscode/settings.json vendored
View File

@@ -1,7 +1,7 @@
{
"prettier.enable": false,
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
"prettier.enable": false,
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}