Skip to content

Commit

Permalink
Add .ts parser
Browse files Browse the repository at this point in the history
  • Loading branch information
leslieyip02 committed Jan 18, 2024
1 parent 2ca7951 commit 67f81fe
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 3 deletions.
13 changes: 12 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,24 @@ module.exports = {
ignorePatterns: ['dist'],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['@html-eslint', '@stylistic', 'react-refresh'],
plugins: [
'@html-eslint',
'@stylistic',
'@typescript-eslint',
'react',
'react-refresh',
],
overrides: [
{
files: ['*.html'],
parser: '@html-eslint/parser',
extends: ['plugin:@html-eslint/recommended'],
},
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
extends: ['plugin:react/recommended'],
}
],
rules: {
'@html-eslint/indent': ['error', 2],
Expand Down
127 changes: 126 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint . --ext js,jsx,html --report-unused-disable-directives --max-warnings 0",
"lint": "eslint . --ext html,js,jsx,ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
Expand All @@ -20,12 +20,15 @@
"@stylistic/eslint-plugin": "^1.5.3",
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.56.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"tailwindcss": "^3.4.0",
"typescript": "^5.3.3",
"vite": "^5.0.8"
}
}

0 comments on commit 67f81fe

Please sign in to comment.