Skip to content

Commit 9e25626

Browse files
committed
catchup
1 parent 64079f7 commit 9e25626

38 files changed

+4275
-21699
lines changed

.eslintrc.js

Lines changed: 0 additions & 67 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ dist-ssr
2424
*.njsproj
2525
*.sln
2626
*.sw?
27+
28+
*.old*
29+
stats.html

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"semi": false
2+
"semi": false,
3+
"experimentalTernaries": true
34
}

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"eslint.run": "onType",
33
"editor.codeActionsOnSave": {
4-
"source.fixAll.eslint": true,
4+
"source.fixAll.eslint": "explicit"
55
},
66
"[javascript]": {
77
"editor.defaultFormatter": "esbenp.prettier-vscode",

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright [yyyy] [name of copyright owner]
189+
Copyright 2021-2025 Johann Kellerman
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

eslint.config.js

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
// Migration https://eslint.org/docs/latest/use/configure/migration-guide#eslintrc-examples
2+
3+
import process from "process"
4+
import eslint from "@eslint/js"
5+
import typescriptEslint from "@typescript-eslint/eslint-plugin"
6+
import tsParser from "@typescript-eslint/parser"
7+
import eslintConfigPrettier from "eslint-config-prettier"
8+
import unusedImports from "eslint-plugin-unused-imports"
9+
import pluginVue from "eslint-plugin-vue"
10+
import { defineConfig, globalIgnores } from "eslint/config"
11+
import globals from "globals"
12+
import tseslint from "typescript-eslint"
13+
import vueParser from "vue-eslint-parser"
14+
15+
export default defineConfig(
16+
globalIgnores([
17+
"src/components/ui/**/*.ts",
18+
"src/components/ui/**/*.vue",
19+
"public/count.v5.js",
20+
]),
21+
// https://typescript-eslint.io/getting-started/#step-2-configuration
22+
eslint.configs.recommended,
23+
...tseslint.configs.recommended,
24+
25+
//https://eslint.vuejs.org/user-guide/#configuration-eslint-config-js
26+
...pluginVue.configs["flat/recommended"],
27+
28+
// Global ignores
29+
{
30+
ignores: ["dist/", ".storybook/", "tailwind.config.js", "vite.config.js"],
31+
},
32+
33+
// https://www.npmjs.com/package/vue-eslint-parser
34+
// https://typescript-eslint.io/troubleshooting/#i-am-running-into-errors-when-parsing-typescript-in-my-vue-files
35+
{
36+
files: ["src/**/*.vue", "src/**/*.ts", "src/**/*.js"],
37+
languageOptions: {
38+
parser: vueParser,
39+
parserOptions: {
40+
parser: tsParser, // tseslint.parser,
41+
project: "tsconfig.json",
42+
sourceType: "module",
43+
extraFileExtensions: [".vue"],
44+
ecmaVersion: 2020,
45+
ecmaFeatures: {
46+
globalReturn: false,
47+
impliedStrict: false,
48+
jsx: false,
49+
},
50+
},
51+
},
52+
},
53+
54+
{
55+
plugins: {
56+
"unused-imports": unusedImports,
57+
},
58+
rules: {
59+
"no-unused-vars": "off",
60+
"unused-imports/no-unused-imports": "error",
61+
"unused-imports/no-unused-vars": [
62+
"warn",
63+
{
64+
vars: "all",
65+
varsIgnorePattern: "^_",
66+
args: "after-used",
67+
argsIgnorePattern: "^_",
68+
},
69+
],
70+
},
71+
},
72+
73+
// My rules
74+
{
75+
plugins: { typescriptEslint },
76+
rules: {
77+
semi: ["warn", "never"],
78+
"no-console": "off", // process.env.NODE_ENV === "production" ? "warn" : "off",
79+
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
80+
81+
//"no-unused-vars": "off",
82+
"@typescript-eslint/no-explicit-any": "off",
83+
"@typescript-eslint/no-unused-vars": [
84+
"error",
85+
{ varsIgnorePattern: "_*" },
86+
],
87+
88+
"vue/no-v-html": "off",
89+
"vue/require-default-prop": "off",
90+
"vue/multi-word-component-names": ["error"],
91+
"vue/attributes-order": [
92+
"error",
93+
{
94+
alphabetical: false,
95+
},
96+
],
97+
// "sort-imports": [
98+
// "error",
99+
// {
100+
// ignoreCase: false,
101+
// ignoreDeclarationSort: false,
102+
// ignoreMemberSort: false,
103+
// memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
104+
// allowSeparatedGroups: false,
105+
// },
106+
// ],
107+
},
108+
},
109+
110+
{
111+
// exclude shadcn
112+
files: ["src/components/ui/**/*.ts", "src/components/ui/**/*.vue"],
113+
rules: {
114+
quotes: ["error", "single"],
115+
"vue/attributes-order": "off",
116+
"vue/multi-word-component-names": "off",
117+
"sort-imports": "off",
118+
"unused-imports/no-unused-vars": "off",
119+
},
120+
},
121+
122+
{
123+
files: ["src/**/*.js", "src/**/*.ts", "src/**/*.vue"],
124+
languageOptions: {
125+
globals: {
126+
...globals.node,
127+
...globals.browser,
128+
//myCustomGlobal: "readonly",
129+
VITE_TIMESTAMP: "readonly",
130+
},
131+
},
132+
},
133+
134+
// Special config for shadcn
135+
{
136+
files: ["src/components/ui/**/*.ts", "src/components/ui/**/*.vue"],
137+
rules: {
138+
quotes: ["error", "single"],
139+
"vue/attributes-order": "off",
140+
"vue/component-definition-name-casing": "off",
141+
},
142+
},
143+
144+
// https://github.com/prettier/eslint-config-prettier?tab=readme-ov-file#installation
145+
// Turns off all rules that are unnecessary or might conflict with Prettier.
146+
eslintConfigPrettier
147+
)

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
<body>
1111
<div id="app"></div>
12-
<script type="module" src="/src/main.js"></script>
12+
<script type="module" src="/src/main.ts"></script>
1313
</body>
1414
</html>

0 commit comments

Comments
 (0)