-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: use eslint flat config * refactor: fix lint * ci: change order ci to generate types
- Loading branch information
Showing
15 changed files
with
309 additions
and
116 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
// Why is this file needed: https://github.com/ota-meshi/eslint-plugin-astro/tree/v0.34.0#resolving-error-in-jsx-unsafe-return-of-an-any-typed-value | ||
|
||
import 'astro/astro-jsx'; | ||
|
||
declare global { | ||
namespace JSX { | ||
type Element = HTMLElement; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -8,7 +8,6 @@ | |
"start": "astro dev", | ||
"build": "astro build", | ||
"preview": "astro preview", | ||
"lint": "eslint \"**/*.{astro,ts}\"", | ||
"type:check": "astro check && tsc", | ||
"fetch-fonts": "fetch-pretendard --font-output-dir ./public/fonts --css-output-path ./src/styles/pretendardvariable-dynamic-subset.css --css-url 'https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/variable/pretendardvariable-dynamic-subset.css'" | ||
}, | ||
|
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,2 +1,4 @@ | ||
/* eslint-disable */ | ||
|
||
/// <reference path="../.astro/types.d.ts" /> | ||
/// <reference types="astro/client" /> |
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
"csstree", | ||
"pretendard", | ||
"tailwindcss", | ||
"tsconfigs" | ||
"tsconfigs", | ||
"tseslint" | ||
] | ||
} |
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,71 @@ | ||
// @ts-check | ||
|
||
import eslint from '@eslint/js'; | ||
import gitignore from 'eslint-config-flat-gitignore'; | ||
import eslintConfigPrettier from 'eslint-config-prettier'; | ||
import eslintPluginAstro from 'eslint-plugin-astro'; | ||
import globals from 'globals'; | ||
import tseslint from 'typescript-eslint'; | ||
import * as tsParserForExtraFiles from 'typescript-eslint-parser-for-extra-files'; | ||
|
||
const config = tseslint.config( | ||
gitignore({ root: true }), | ||
{ | ||
ignores: [ | ||
'eslint.config.js', | ||
'**/{astro,tailwind,prettier}.config.{js,ts}', | ||
], | ||
}, | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommendedTypeChecked, | ||
...tseslint.configs.stylisticTypeChecked, | ||
{ | ||
languageOptions: { | ||
parser: tsParserForExtraFiles, | ||
parserOptions: { | ||
/** | ||
* Does not work glob project with eslint-plugin-astro | ||
* Waiting release: https://github.com/ota-meshi/eslint-plugin-astro/pull/345 | ||
*/ | ||
// project: ['{apps,packages}/*/tsconfig.json'], | ||
}, | ||
}, | ||
rules: { | ||
'@typescript-eslint/array-type': [ | ||
'error', | ||
{ default: 'array-simple', readonly: 'array-simple' }, | ||
], | ||
}, | ||
}, | ||
...eslintPluginAstro.configs['flat/recommended'], | ||
{ | ||
files: ['**/*.astro'], | ||
languageOptions: { | ||
parserOptions: { | ||
parser: tsParserForExtraFiles, | ||
}, | ||
}, | ||
}, | ||
{ | ||
files: ['apps/portfolio/**/*'], | ||
languageOptions: { | ||
parserOptions: { | ||
project: ['apps/portfolio/tsconfig.json'], | ||
}, | ||
}, | ||
}, | ||
{ | ||
files: ['packages/fetch-pretendard/**/*'], | ||
languageOptions: { | ||
parserOptions: { | ||
project: ['packages/fetch-pretendard/tsconfig.json'], | ||
}, | ||
globals: { | ||
...globals.node, | ||
}, | ||
}, | ||
}, | ||
eslintConfigPrettier, | ||
); | ||
|
||
export default config; |
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 |
---|---|---|
|
@@ -6,23 +6,26 @@ | |
"type": "module", | ||
"scripts": { | ||
"build": "nx run-many --target=build", | ||
"lint": "nx run-many --target=lint", | ||
"lint": "eslint \"**/*.{astro,ts,js}\"", | ||
"type:check": "nx run-many --target=type:check", | ||
"format": "prettier \"**/*.{astro,ts,js,cjs,css,json,md,yml,yaml}\" --write", | ||
"format:check": "prettier \"**/*.{astro,ts,js,cjs,css,json,md,yml,yaml}\" --check" | ||
}, | ||
"devDependencies": { | ||
"@eslint/js": "8.57.0", | ||
"@nix6839/prettier-config": "2.2.0", | ||
"@types/eslint": "8.56.6", | ||
"@typescript-eslint/eslint-plugin": "7.4.0", | ||
"@typescript-eslint/parser": "7.4.0", | ||
"eslint": "8.57.0", | ||
"eslint-config-flat-gitignore": "0.1.5", | ||
"eslint-config-prettier": "9.1.0", | ||
"eslint-plugin-astro": "0.33.1", | ||
"eslint-plugin-astro": "0.34.0", | ||
"globals": "15.0.0", | ||
"nx": "18.2.1", | ||
"prettier": "3.2.5", | ||
"prettier-plugin-astro": "0.13.0", | ||
"prettier-plugin-tailwindcss": "0.5.13" | ||
"prettier-plugin-tailwindcss": "0.5.13", | ||
"typescript-eslint": "7.5.0", | ||
"typescript-eslint-parser-for-extra-files": "0.6.0" | ||
}, | ||
"packageManager": "[email protected]+sha256.4b4efa12490e5055d59b9b9fc9438b7d581a6b7af3b5675eb5c5f447cee1a589" | ||
} |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.