Skip to content

Commit a0f6d53

Browse files
authored
Merge pull request #1077 from chantouchsek/feat/eslint-flat-config
feat: migrate eslint flat config
2 parents f1e174b + cb599ca commit a0f6d53

File tree

6 files changed

+303
-545
lines changed

6 files changed

+303
-545
lines changed

.eslintrc

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

eslint.config.mjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import globals from 'globals'
2+
import pluginJs from '@eslint/js'
3+
import tseslint from 'typescript-eslint'
4+
import pluginVue from 'eslint-plugin-vue'
5+
6+
export default [
7+
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
8+
pluginJs.configs.recommended,
9+
...tseslint.configs.recommended,
10+
...pluginVue.configs['flat/vue2-essential'],
11+
{
12+
rules: {
13+
'@typescript-eslint/no-explicit-any': 'off',
14+
},
15+
},
16+
{
17+
ignores: ['**/node_modules/**', '**/dist/**', '**/build/**'],
18+
},
19+
]

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"release": "standard-version && git push --follow-tags origin main && yarn publish",
1515
"clean": "rimraf dist",
1616
"prepare": "husky",
17-
"lint:js": "eslint --ext \".js,.ts\" --ignore-path .gitignore .",
17+
"lint:js": "eslint .",
1818
"lint:prettier": "prettier --check .",
1919
"lint": "yarn lint:js && yarn lint:prettier",
2020
"lintfix": "prettier --write --list-different . && yarn lint:js --fix"
@@ -49,6 +49,7 @@
4949
"devDependencies": {
5050
"@commitlint/cli": "^19.3.0",
5151
"@commitlint/config-conventional": "^19.2.2",
52+
"@eslint/js": "^9.2.0",
5253
"@nuxt/types": "^2.17.3",
5354
"@types/lodash": "^4.17.1",
5455
"@types/node": "^20.12.10",
@@ -58,22 +59,21 @@
5859
"@vitest/coverage-v8": "^1.6.0",
5960
"@vue/test-utils": "^1.3.6",
6061
"axios-mock-adapter": "^1.22.0",
61-
"eslint": "^8.57.0",
62-
"eslint-config-prettier": "^9.1.0",
63-
"eslint-plugin-import": "^2.29.1",
64-
"eslint-plugin-prettier": "^4.2.1",
65-
"eslint-plugin-promise": "^6.1.1",
62+
"eslint": "^9.2.0",
63+
"eslint-plugin-vue": "^9.25.0",
64+
"globals": "^15.1.0",
6665
"husky": "^9.0.11",
6766
"jsdom": "^22.1.0",
68-
"lint-staged": ">=15.2.2",
67+
"lint-staged": "^15.2.2",
6968
"nodemon": "^3.1.0",
7069
"nuxt": "^2.17.3",
71-
"prettier": "^2.8.8",
70+
"prettier": "^3.2.5",
7271
"rimraf": "^5.0.5",
7372
"sass": "^1.77.0",
7473
"standard-version": "^9.5.0",
7574
"ts-node": "^10.9.2",
7675
"typescript": "^5.4.5",
76+
"typescript-eslint": "^7.8.0",
7777
"vite": "^5.2.11",
7878
"vitest": "^1.6.0",
7979
"vue": "^2.7.16"

src/core/BaseService.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ export default class BaseService {
2424
ignoreQueryPrefix: true,
2525
}
2626

27-
constructor(readonly endpoint: string, public parameters: SimpleObject<any> = {}) {}
27+
constructor(
28+
readonly endpoint: string,
29+
public parameters: SimpleObject<any> = {},
30+
) {}
2831

2932
get $http() {
3033
return BaseService.$http

src/core/Validator.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import { castArray, cloneDeep, get, has, omit, replace } from 'lodash'
33
import { is, toCamelCase, toSnakeCase } from '../util'
44

55
class Validator {
6-
constructor(public errors: SimpleObject<any> = {}, public processing = false, public successful = false) {}
6+
constructor(
7+
public errors: SimpleObject<any> = {},
8+
public processing = false,
9+
public successful = false,
10+
) {}
711

812
add(field: string, message: string, forceUpdate?: boolean) {
913
if (forceUpdate || this.missed(field)) {

0 commit comments

Comments
 (0)