-
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.
- Loading branch information
1 parent
204ac10
commit 9b733ca
Showing
30 changed files
with
843 additions
and
99 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 |
---|---|---|
|
@@ -2,3 +2,4 @@ node_modules | |
.idea | ||
.DS_Store | ||
dist | ||
playground |
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
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
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,5 +1,2 @@ | ||
# Eslint config | ||
|
||
## Known issues | ||
|
||
- `eslint-plugin-tailwindcss` only support tailwinscss version >= 3.3.0 |
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,38 @@ | ||
import * as parser from 'astro-eslint-parser' | ||
import { type FlatESLintConfigItem, type Rules } from 'eslint-define-config' | ||
import eslintPluginAstro from 'eslint-plugin-astro' | ||
import globals from 'globals' | ||
import { GLOB_ASTRO } from '../globs' | ||
import { parserTypeScript } from '../plugins' | ||
|
||
export function resolveAstro(ts?: boolean): FlatESLintConfigItem[] { | ||
return [ | ||
{ | ||
files: [GLOB_ASTRO], | ||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
// Astro object | ||
Astro: false, | ||
// JSX Fragment | ||
Fragment: false, | ||
}, | ||
parser, | ||
parserOptions: { | ||
extraFileExtensions: ['.astro'], | ||
parser: parserTypeScript, | ||
}, | ||
// The script of Astro components uses ESM. | ||
sourceType: 'module', | ||
}, | ||
plugins: { | ||
astro: eslintPluginAstro, | ||
}, | ||
processor: ts ? 'astro/client-side-ts' : 'astro/astro', | ||
rules: { | ||
...eslintPluginAstro.configs.recommended.rules, | ||
'astro/no-set-text-directive': ['error'], | ||
} as Rules, | ||
}, | ||
] | ||
} |
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
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,19 @@ | ||
import type { FlatESLintConfigItem } from 'eslint-define-config' | ||
import { pluginNode } from '../plugins' | ||
|
||
export const node: FlatESLintConfigItem[] = [ | ||
{ | ||
plugins: { | ||
node: pluginNode, | ||
}, | ||
rules: { | ||
'node/handle-callback-err': ['error', '^(err|error)$'], | ||
'node/no-deprecated-api': 'error', | ||
'node/no-exports-assign': 'error', | ||
'node/no-new-require': 'error', | ||
'node/no-path-concat': 'error', | ||
'node/no-unsupported-features/es-builtins': 'error', | ||
'node/process-exit-as-throw': 'error', | ||
}, | ||
}, | ||
] |
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,29 @@ | ||
import { type FlatESLintConfigItem, type Rules } from 'eslint-define-config' | ||
import { GLOB_SVELTE } from '../globs' | ||
import { pluginTypeScript } from '../plugins' | ||
|
||
export async function asyncSvelte(): Promise<FlatESLintConfigItem[]> { | ||
const eslintPluginSvelte = (await import('eslint-plugin-svelte')).default | ||
const svelteParser = (await import('svelte-eslint-parser')).default | ||
return [ | ||
{ | ||
files: [GLOB_SVELTE], | ||
languageOptions: { | ||
parser: svelteParser, | ||
parserOptions: { | ||
extraFileExtensions: ['.svelte'], | ||
parser: '@typescript-eslint/parser', | ||
}, | ||
}, | ||
plugins: { | ||
'@typescript-eslint': pluginTypeScript, | ||
'svelte': eslintPluginSvelte, | ||
}, | ||
processor: eslintPluginSvelte.processors.svelte, | ||
rules: { | ||
...eslintPluginSvelte.configs.recommended.rules, | ||
...eslintPluginSvelte.configs.prettier.rules, | ||
} as Rules, | ||
}, | ||
] | ||
} |
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,6 +1,6 @@ | ||
{ | ||
"name": "@minko-fe/eslint-config", | ||
"version": "2.1.2", | ||
"version": "2.2.0", | ||
"description": "eslint-config", | ||
"type": "module", | ||
"repository": { | ||
|
@@ -27,30 +27,42 @@ | |
}, | ||
"peerDependencies": { | ||
"eslint": "^8.56.0", | ||
"prettier-plugin-astro": "^0.13.0", | ||
"prettier-plugin-svelte": "^3.2.2", | ||
"tailwindcss": "^3.2.2" | ||
}, | ||
"peerDependenciesMeta": { | ||
"tailwindcss": { | ||
"optional": true | ||
}, | ||
"prettier-plugin-astro": { | ||
"optional": true | ||
}, | ||
"prettier-plugin-svelte": { | ||
"optional": true | ||
} | ||
}, | ||
"dependencies": { | ||
"@minko-fe/prettier-config": "workspace:*", | ||
"@typescript-eslint/eslint-plugin": "^6.20.0", | ||
"@typescript-eslint/parser": "^6.20.0", | ||
"astro-eslint-parser": "^0.16.3", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-define-config": "^1.24.1", | ||
"eslint-plugin-antfu": "^2.1.2", | ||
"eslint-plugin-astro": "^0.33.1", | ||
"eslint-plugin-disable-autofix": "^4.1.0", | ||
"eslint-plugin-eslint-comments": "^3.2.0", | ||
"eslint-plugin-import": "^2.29.1", | ||
"eslint-plugin-jsonc": "^2.13.0", | ||
"eslint-plugin-markdown": "^3.0.1", | ||
"eslint-plugin-n": "^16.6.2", | ||
"eslint-plugin-perfectionist": "^2.5.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-plugin-react": "^7.33.2", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"eslint-plugin-react-refresh": "^0.4.5", | ||
"eslint-plugin-svelte": "^2.35.1", | ||
"eslint-plugin-tailwindcss-3.11.0": "npm:[email protected]", | ||
"eslint-plugin-tailwindcss-3.13.1": "npm:[email protected]", | ||
"eslint-plugin-tailwindcss-3.14.1": "npm:[email protected]", | ||
|
@@ -65,13 +77,15 @@ | |
"parse-gitignore": "^2.0.0", | ||
"prettier": "^3.2.4", | ||
"semver": "^7.5.4", | ||
"svelte-eslint-parser": "^0.33.1", | ||
"typescript": "^5.3.3", | ||
"yaml-eslint-parser": "^1.2.2" | ||
}, | ||
"devDependencies": { | ||
"@types/semver": "^7.5.6", | ||
"eslint": "^8.56.0", | ||
"sucrase": "^3.35.0", | ||
"svelte": "^4.2.7", | ||
"tailwindcss": "3.3.2" | ||
}, | ||
"pnpm": { | ||
|
Oops, something went wrong.