Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
with:
node-version: 16.15.x

- uses: pnpm/action-setup@v2.4.0
- uses: pnpm/action-setup@v3
with:
version: 7.29.x
version: 8

- name: Install dependencies
run: pnpm install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.4.0
- uses: pnpm/action-setup@v3
with:
version: 7.x
version: 8

- name: Install dependencies
run: pnpm i
Expand Down
7 changes: 7 additions & 0 deletions .stylelintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ module.exports = {
'stylelint-config-recommended-vue',
'stylelint-config-recommended-vue/scss'
],
'plugins': ['@stylistic/stylelint-plugin'],
'ignoreFiles': ['**/*.js', '**/*.ts'],
'defaultSeverity': 'error',
'rules': {
'unit-disallowed-list': [
'rem',
'pt'
],
'@stylistic/indentation': [
2,
{
'baseIndentLevel': 0
}
],
'no-empty-source': null,
'block-no-empty': null,
'declaration-block-no-duplicate-custom-properties': null,
Expand Down
57 changes: 43 additions & 14 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,52 @@
// export default antfu()

import globals from 'globals'
import { defineFlatConfig } from 'eslint-define-config';
import { defineFlatConfig } from 'eslint-define-config'

import * as parserTypeScript from '@typescript-eslint/parser';
import pluginTypeScript from '@typescript-eslint/eslint-plugin';
import * as parserTypeScript from '@typescript-eslint/parser'
import pluginTypeScript from '@typescript-eslint/eslint-plugin'

import * as parserVue from 'vue-eslint-parser'
import pluginVue from 'eslint-plugin-vue'
import js from '@eslint/js'

import stylistic from '@stylistic/eslint-plugin'

import * as parserVue from 'vue-eslint-parser';
import pluginVue from 'eslint-plugin-vue';
import js from '@eslint/js';

function renameRules(rules, map) {
return Object.fromEntries(
Object.entries(rules).map(([key, value]) => {
for (const [from, to] of Object.entries(map)) {
if (key.startsWith(`${from}/`))
return [to + key.slice(from.length), value];
return [to + key.slice(from.length), value]
}
return [key, value];
return [key, value]
})
);
)
}

export default defineFlatConfig([
{
ignores: [
'public',
'build',
'dist',
'node_modules',
'coverage',
'src/assets/**'
]
},
{
plugins: {
'@stylistic': stylistic
},
rules: {
'@stylistic/semi': ['error', 'never'],
'@stylistic/no-extra-semi': 'error'
}
},
{
...js.configs.recommended,
ignores: ['public', 'build', 'dist', 'node_modules', 'coverage', 'src/assets/**'],
languageOptions: {
ecmaVersion: 2022,
globals: {
Expand Down Expand Up @@ -54,7 +75,7 @@ export default defineFlatConfig([
'constructor-super': 'error',
'default-case-last': 'error',
'dot-notation': ['error', { allowKeywords: true }],
'eqeqeq': ['error', 'smart'],
'eqeqeq': ['error', 'always'],
'new-cap': ['error', { capIsNew: false, newIsCap: true, properties: true }],
'no-alert': 'error',
'no-array-constructor': 'error',
Expand Down Expand Up @@ -164,6 +185,9 @@ export default defineFlatConfig([
'no-useless-return': 'error',
'no-var': 'error',
'no-with': 'error',
'key-spacing': 'error',
'space-infix-ops': 'error',
'object-curly-spacing': ['error', 'always'],
'object-shorthand': [
'error',
'always',
Expand Down Expand Up @@ -239,6 +263,11 @@ export default defineFlatConfig([
}
}
},
settings: {
'import/core-modules': [
'uno.css'
]
},
plugins: {
'@typescript-eslint': pluginTypeScript
},
Expand All @@ -252,6 +281,7 @@ export default defineFlatConfig([
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 1,
'@typescript-eslint/no-namespace': 0,
'@typescript-eslint/member-delimiter-style': [
'error',
{
Expand All @@ -266,8 +296,7 @@ export default defineFlatConfig([
}
],
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/semi': ['error', 'never']
'@typescript-eslint/no-non-null-assertion': 0
}
},
{
Expand Down Expand Up @@ -325,4 +354,4 @@ export default defineFlatConfig([
}]
}
}
]);
])
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
"build": "vite build",
"deploy:gh-pages": "cross-env VITE_ROUTER_MODE=hash pnpm build",
"preview": "vite preview --host",
"lint": "eslint ./src",
"lint:fix": "eslint --fix ./src",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"test": "vitest",
"test:coverage": "vitest run --coverage",
"stylelint": "stylelint .scss, .vue ./src",
"stylelint:fix": "stylelint --fix .scss, .vue ./src"
},
"engines": {
"node": ">= 16.15.x"
"node": ">= 16.15.x",
"pnpm": ">= 8.14.x"
},
"packageManager": "pnpm@8.15.4",
"keywords": [
"vue",
"vue3",
Expand Down Expand Up @@ -78,6 +78,8 @@
"@babel/core": "^7.24.4",
"@babel/preset-env": "^7.24.4",
"@eslint/js": "^9.0.0",
"@stylistic/eslint-plugin": "^1.7.2",
"@stylistic/stylelint-plugin": "^2.1.1",
"@types/js-cookie": "^3.0.6",
"@types/lodash-es": "^4.17.12",
"@types/node": "^20.12.7",
Expand Down Expand Up @@ -115,6 +117,7 @@
"unplugin-vue-components": "^0.26.0",
"vite": "^5.2.9",
"vite-svg-loader": "^5.1.0",
"vitest": "^1.5.0"
"vitest": "^1.5.0",
"vue-eslint-parser": "^9.4.2"
}
}
Loading