Skip to content

Commit 11ee966

Browse files
committed
chore: Update linting so it works again
1 parent a8f07ca commit 11ee966

File tree

206 files changed

+5825
-3001
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+5825
-3001
lines changed

packages/axios/.eslintcache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/build.config.ts":"1","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/eslint.config.mjs":"2","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/vitest.config.ts":"3","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/src/index.ts":"4","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/src/plugin.ts":"5","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/helpers.ts":"6","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/setup.ts":"7","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/src/api/Request.ts":"8","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/src/api/Response.ts":"9","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/src/composables/useAxiosApi.ts":"10","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/src/composables/useAxiosRepo.ts":"11","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/src/repository/AxiosRepository.ts":"12","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/src/types/config.ts":"13","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/src/types/pinia-orm.ts":"14","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/feature/Request.spec.ts":"15","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/feature/Request_Actions.spec.ts":"16","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/feature/Request_DataKey.spec.ts":"17","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/feature/Request_DataTransformer.spec.ts":"18","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/feature/Request_Delete.spec.ts":"19","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/feature/Request_Save.spec.ts":"20","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/feature/Response_Delete.spec.ts":"21","/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/feature/Response_Save.spec.ts":"22"},{"size":240,"mtime":1714560027454,"results":"23","hashOfConfig":"24"},{"size":2332,"mtime":1714559116006,"results":"25","hashOfConfig":"26"},{"size":259,"mtime":1714560027454,"results":"27","hashOfConfig":"24"},{"size":222,"mtime":1694953847623,"results":"28","hashOfConfig":"24"},{"size":403,"mtime":1714560027454,"results":"29","hashOfConfig":"24"},{"size":814,"mtime":1714560059074,"results":"30","hashOfConfig":"24"},{"size":745,"mtime":1714560027454,"results":"31","hashOfConfig":"24"},{"size":3979,"mtime":1714560027454,"results":"32","hashOfConfig":"24"},{"size":3973,"mtime":1714560027454,"results":"33","hashOfConfig":"24"},{"size":212,"mtime":1714560027454,"results":"34","hashOfConfig":"24"},{"size":277,"mtime":1714560027454,"results":"35","hashOfConfig":"24"},{"size":564,"mtime":1714560027454,"results":"36","hashOfConfig":"24"},{"size":775,"mtime":1714560027454,"results":"37","hashOfConfig":"24"},{"size":414,"mtime":1714560027454,"results":"38","hashOfConfig":"24"},{"size":5407,"mtime":1714560027454,"results":"39","hashOfConfig":"24"},{"size":1893,"mtime":1714560027454,"results":"40","hashOfConfig":"24"},{"size":1034,"mtime":1714560027454,"results":"41","hashOfConfig":"24"},{"size":1064,"mtime":1714560027454,"results":"42","hashOfConfig":"24"},{"size":1099,"mtime":1714560027454,"results":"43","hashOfConfig":"24"},{"size":1016,"mtime":1714560027454,"results":"44","hashOfConfig":"24"},{"size":1590,"mtime":1714560027454,"results":"45","hashOfConfig":"24"},{"size":1901,"mtime":1714560027454,"results":"46","hashOfConfig":"24"},{"filePath":"47","messages":"48","suppressedMessages":"49","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"dfh907",{"filePath":"50","messages":"51","suppressedMessages":"52","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"up1g4c",{"filePath":"53","messages":"54","suppressedMessages":"55","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"56","messages":"57","suppressedMessages":"58","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"59","messages":"60","suppressedMessages":"61","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"62","messages":"63","suppressedMessages":"64","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"65","messages":"66","suppressedMessages":"67","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"68","messages":"69","suppressedMessages":"70","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"71","messages":"72","suppressedMessages":"73","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"74","messages":"75","suppressedMessages":"76","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"77","messages":"78","suppressedMessages":"79","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"80","messages":"81","suppressedMessages":"82","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"83","messages":"84","suppressedMessages":"85","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"86","messages":"87","suppressedMessages":"88","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"89","messages":"90","suppressedMessages":"91","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"92","messages":"93","suppressedMessages":"94","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"95","messages":"96","suppressedMessages":"97","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"98","messages":"99","suppressedMessages":"100","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"101","messages":"102","suppressedMessages":"103","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"104","messages":"105","suppressedMessages":"106","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"107","messages":"108","suppressedMessages":"109","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"110","messages":"111","suppressedMessages":"112","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/build.config.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/eslint.config.mjs",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/vitest.config.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/src/index.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/src/plugin.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/helpers.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/setup.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/src/api/Request.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/src/api/Response.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/src/composables/useAxiosApi.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/src/composables/useAxiosRepo.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/src/repository/AxiosRepository.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/src/types/config.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/src/types/pinia-orm.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/feature/Request.spec.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/feature/Request_Actions.spec.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/feature/Request_DataKey.spec.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/feature/Request_DataTransformer.spec.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/feature/Request_Delete.spec.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/feature/Request_Save.spec.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/feature/Response_Delete.spec.ts",[],[],"/home/dredd/PhpstormProjects/storm-tail/pinia-orm/packages/axios/test/feature/Response_Save.spec.ts",[],[]]

packages/axios/.eslintrc

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

packages/axios/build.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import { defineBuildConfig } from 'unbuild'
22

33
export default defineBuildConfig({
44
entries: [
5-
'src/index'
5+
'src/index',
66
],
77
declaration: true,
88
clean: true,
99
rollup: {
10-
emitCJS: true
10+
emitCJS: true,
1111
},
12-
externals: ['axios', 'pinia-orm']
12+
externals: ['axios', 'pinia-orm'],
1313
})

packages/axios/eslint.config.mjs

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
// @ts-check
2+
import { createConfigForNuxt } from '@nuxt/eslint-config/flat'
3+
4+
export default createConfigForNuxt({
5+
features: {
6+
tooling: true,
7+
stylistic: {
8+
commaDangle: 'always-multiline',
9+
},
10+
},
11+
})
12+
.override('nuxt/javascript', {
13+
rules: {
14+
'curly': ['error', 'all'], // Including if blocks with a single statement
15+
'dot-notation': 'error',
16+
'no-console': ['warn', { allow: ['warn', 'error', 'debug'] }],
17+
'no-lonely-if': 'error', // No single if in an "else" block
18+
'no-useless-rename': 'error',
19+
'object-shorthand': 'error',
20+
'prefer-const': ['error', { destructuring: 'any', ignoreReadBeforeAssign: false }],
21+
'require-await': 'error',
22+
'sort-imports': ['error', { ignoreDeclarationSort: true }],
23+
},
24+
})
25+
26+
.override('nuxt/typescript/rules', {
27+
rules: {
28+
'@typescript-eslint/ban-ts-comment': [
29+
'error',
30+
{
31+
'ts-expect-error': 'allow-with-description',
32+
'ts-ignore': true,
33+
},
34+
],
35+
'@typescript-eslint/no-dynamic-delete': 'off',
36+
'@typescript-eslint/no-useless-constructor': 'off',
37+
'@typescript-eslint/no-unused-vars': [
38+
'error',
39+
{
40+
argsIgnorePattern: '^_',
41+
ignoreRestSiblings: true,
42+
varsIgnorePattern: '^_',
43+
},
44+
],
45+
'@typescript-eslint/triple-slash-reference': 'off',
46+
'@typescript-eslint/unified-signatures': 'off',
47+
...{
48+
// TODO: Discuss if we want to enable this
49+
'@typescript-eslint/ban-types': 'off',
50+
// TODO: Discuss if we want to enable this
51+
'@typescript-eslint/no-explicit-any': 'off',
52+
// TODO: Discuss if we want to enable this
53+
'@typescript-eslint/no-invalid-void-type': 'off',
54+
},
55+
},
56+
})
57+
58+
// Stylistic rules
59+
.override('nuxt/stylistic', {
60+
rules: {
61+
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
62+
'@stylistic/indent-binary-ops': 'off',
63+
'@stylistic/max-statements-per-line': 'off',
64+
'@stylistic/operator-linebreak': 'off',
65+
'@stylistic/quote-props': ['error', 'consistent'],
66+
'@stylistic/space-before-function-paren': ['error', 'always'],
67+
},
68+
})
69+
70+
.append(
71+
{
72+
files: ['tests/**'],
73+
rules: {
74+
'@typescript-eslint/no-explicit-any': 'off',
75+
},
76+
},
77+
)

packages/axios/package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
"build": "unbuild",
4141
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --commit-path . -l @pinia-orm/axios -r 1",
4242
"size": "size-limit",
43-
"lint": "eslint . --ext .ts",
44-
"lint:fix": "eslint . --fix --ext .ts",
43+
"lint": "eslint . --cache",
44+
"lint:fix": "eslint . --cache --fix",
4545
"test:ui": "vue-demi-switch 3 && vitest --ui --api 9527",
4646
"test:watch": "vue-demi-switch 3 && vitest --watch",
4747
"test:2": "vue-demi-switch 2 vue2 && vitest --run",
@@ -54,18 +54,19 @@
5454
},
5555
"license": "MIT",
5656
"peerDependencies": {
57-
"pinia-orm": ">=1.7.2",
58-
"axios": ">=1.6.0"
57+
"axios": ">=1.6.0",
58+
"pinia-orm": ">=1.7.2"
5959
},
6060
"devDependencies": {
61+
"@nuxt/eslint-config": "^0.3.10",
6162
"@nuxtjs/eslint-config-typescript": "^12.1.0",
6263
"@size-limit/preset-small-lib": "^11.0.0",
6364
"@vitest/coverage-v8": "^1.0.0",
6465
"axios": "^1.5.0",
6566
"axios-mock-adapter": "^1.22.0",
66-
"eslint": "^9.0.0",
67-
"pinia-orm": "workspace:*",
67+
"eslint": "^9.1.1",
6868
"pinia": "^2.1.6",
69+
"pinia-orm": "workspace:*",
6970
"size-limit": "^11.0.0",
7071
"typescript": "^5.2.2",
7172
"unbuild": "^2.0.0",

packages/axios/src/api/Request.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { AxiosInstance, AxiosResponse } from 'axios'
2-
import { Config } from '../types/config'
3-
import { AxiosRepository } from '../repository/AxiosRepository'
2+
import type { Config } from '../types/config'
3+
import type { AxiosRepository } from '../repository/AxiosRepository'
44
import { Response } from './Response'
55

66
export class Request {
@@ -13,7 +13,7 @@ export class Request {
1313
* The default config.
1414
*/
1515
config: Config = {
16-
save: true
16+
save: true,
1717
}
1818

1919
/**
@@ -36,7 +36,7 @@ export class Request {
3636
get axios (): AxiosInstance {
3737
if (!this.repository.axios) {
3838
throw new Error(
39-
'[Pinia ORM Axios] The axios instance is not registered. Please register the axios instance to the repository.'
39+
'[Pinia ORM Axios] The axios instance is not registered. Please register the axios instance to the repository.',
4040
)
4141
}
4242

@@ -133,7 +133,7 @@ export class Request {
133133
...this.config,
134134
...this.repository.globalApiConfig,
135135
...this.repository.apiConfig,
136-
...config
136+
...config,
137137
}
138138
}
139139

@@ -143,7 +143,7 @@ export class Request {
143143
*/
144144
private async createResponse (
145145
axiosResponse: AxiosResponse,
146-
config: Config
146+
config: Config,
147147
): Promise<Response> {
148148
const response = new Response(this.repository, config, axiosResponse)
149149

packages/axios/src/api/Response.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { AxiosResponse } from 'axios'
2-
import { Element, Collection } from 'pinia-orm'
3-
import { Config, PersistMethods } from '../types/config'
4-
import { AxiosRepository } from '../repository/AxiosRepository'
2+
import type { Collection, Element } from 'pinia-orm'
3+
import type { Config, PersistMethods } from '../types/config'
4+
import type { AxiosRepository } from '../repository/AxiosRepository'
55

66
export class Response {
77
/**
@@ -49,7 +49,7 @@ export class Response {
4949
'[Pinia ORM Axios] The response data could not be saved to the store ' +
5050
'because it is not an object or an array. You might want to use ' +
5151
'`dataTransformer` option to handle non-array/object response ' +
52-
'before saving it to the store.'
52+
'before saving it to the store.',
5353
)
5454

5555
return
@@ -61,7 +61,7 @@ export class Response {
6161
console.warn(
6262
'[Pinia ORM Axios] The "persistBy" option configured is not a ' +
6363
'recognized value. Response data will be persisted by the ' +
64-
'default `save` method.'
64+
'default `save` method.',
6565
)
6666

6767
method = 'save'
@@ -80,7 +80,7 @@ export class Response {
8080
async delete (): Promise<void> {
8181
if (this.config.delete === undefined) {
8282
throw new Error(
83-
'[Pinia ORM Axios] Could not delete records because the `delete` option is not set.'
83+
'[Pinia ORM Axios] Could not delete records because the `delete` option is not set.',
8484
)
8585
}
8686

packages/axios/src/composables/useAxiosApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Request } from '../api/Request'
2-
import { AxiosRepository } from '../repository/AxiosRepository'
2+
import type { AxiosRepository } from '../repository/AxiosRepository'
33

44
export function useAxiosApi (repository: AxiosRepository) {
55
return new Request(repository)

packages/axios/src/composables/useAxiosRepo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { useRepo, Model } from 'pinia-orm'
1+
import type { Model } from 'pinia-orm'
2+
import { useRepo } from 'pinia-orm'
23
import { AxiosRepository } from '../repository/AxiosRepository'
34

45
export function useAxiosRepo<M extends Model> (model: M) {

packages/axios/src/plugin.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { PiniaOrmPlugin, definePiniaOrmPlugin } from 'pinia-orm'
2-
import { GlobalConfig } from './types/config'
1+
import type { PiniaOrmPlugin } from 'pinia-orm'
2+
import { definePiniaOrmPlugin } from 'pinia-orm'
3+
import type { GlobalConfig } from './types/config'
34

45
export function createPiniaOrmAxios (axiosConfig?: GlobalConfig): PiniaOrmPlugin {
56
return definePiniaOrmPlugin((context) => {

0 commit comments

Comments
 (0)