eslint-plugin-hyper-fetch 7.5.2 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ export * from './request-generic-types';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/request-generic-types/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { ESLintUtils } from '@typescript-eslint/utils';
2
+ export declare const createRule: <TOptions extends readonly unknown[], TMessageIds extends string, TRuleListener extends import('@typescript-eslint/utils/dist/ts-eslint').RuleListener = import('@typescript-eslint/utils/dist/ts-eslint').RuleListener>({ name, meta, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<TOptions, TMessageIds, TRuleListener>>) => import('@typescript-eslint/utils/dist/ts-eslint').RuleModule<TMessageIds, TOptions, TRuleListener>;
3
+ /**
4
+ * Rule for extending typescript possibilities for generic types with HyperFetch
5
+ * @test https://astexplorer.net/
6
+ */
7
+ export declare const requestGenericTypes: import('@typescript-eslint/utils/dist/ts-eslint').RuleModule<"emptyGeneric" | "unexpectedGenerics" | "notMatchingGenerics", [], {
8
+ CallExpression(node: import('@typescript-eslint/types/dist/generated/ast-spec').CallExpression): void;
9
+ }>;
10
+ //# sourceMappingURL=request-generic-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-generic-types.d.ts","sourceRoot":"","sources":["../../src/request-generic-types/request-generic-types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAMvD,eAAO,MAAM,UAAU,0aAA4E,CAAC;AAEpG;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;EAoE9B,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { NewExpression } from '@typescript-eslint/types/dist/generated/ast-spec';
2
+ export declare function getUnexpectedGenerics({ typeParameters, allowedGenerics, }: {
3
+ typeParameters: NewExpression["typeParameters"] | undefined;
4
+ allowedGenerics: string[];
5
+ }): string[];
6
+ export declare function getEmptyGenerics({ typeParameters }: {
7
+ typeParameters: NewExpression["typeParameters"] | undefined;
8
+ }): boolean;
9
+ export declare function getNotMatchingGeneric({ typeParameters, }: {
10
+ typeParameters: NewExpression["typeParameters"] | undefined;
11
+ }): boolean;
12
+ //# sourceMappingURL=generic-utilities.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generic-utilities.types.d.ts","sourceRoot":"","sources":["../../src/utils/generic-utilities.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAC;AAEtF,wBAAgB,qBAAqB,CAAC,EACpC,cAAc,EACd,eAAe,GAChB,EAAE;IACD,cAAc,EAAE,aAAa,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAAC;IAC5D,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B,YAyBA;AAED,wBAAgB,gBAAgB,CAAC,EAAE,cAAc,EAAE,EAAE;IAAE,cAAc,EAAE,aAAa,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAAA;CAAE,WAenH;AAED,wBAAgB,qBAAqB,CAAC,EACpC,cAAc,GACf,EAAE;IACD,cAAc,EAAE,aAAa,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAAC;CAC7D,WAwBA"}
@@ -0,0 +1,9 @@
1
+ import { CallExpression, ImportDeclaration } from '@typescript-eslint/types/dist/generated/ast-spec';
2
+ export declare const getIsHyperFetchDeclaration: () => {
3
+ isClientDeclaration: (node: CallExpression["callee"]) => boolean;
4
+ hooks: {
5
+ ImportDeclaration: (node: ImportDeclaration) => void;
6
+ "Program:exit": () => void;
7
+ };
8
+ };
9
+ //# sourceMappingURL=is-hf-declaration.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-hf-declaration.types.d.ts","sourceRoot":"","sources":["../../src/utils/is-hf-declaration.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AAI1G,eAAO,MAAM,0BAA0B;gCAKP,cAAc,CAAC,QAAQ,CAAC;;kCAuBxB,iBAAiB;;;CAyBhD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-hyper-fetch",
3
- "version": "7.5.2",
3
+ "version": "8.0.0",
4
4
  "description": "Eslint plugin for HyperFetch",
5
5
  "author": "Maciej Pyrc <maciekpyrc@gmail.com>, Kacper Skawina <kacper.skawina@gmail.com>",
6
6
  "homepage": "https://hyperfetch.bettertyped.com/",
@@ -10,15 +10,12 @@
10
10
  "types": "dist/index.d.ts",
11
11
  "source": "src/index.ts",
12
12
  "scripts": {
13
- "clean": "npx rimraf dist",
14
- "test": "jest --watchAll --maxWorkers=3 --forceExit",
15
- "test:pipeline": "jest --watchAll=false --maxWorkers=1 --no-cache --forceExit",
13
+ "test": "vitest run",
16
14
  "start": "yarn build && npx run-when-changed --watch 'src/**/*.ts' --exec 'yarn build'",
17
- "build": "yarn clean && node ../../scripts/build.js",
18
- "postbuild": "yarn rollup -c ../../rollup.config.js",
15
+ "build": "vite build",
19
16
  "lint": "eslint . --fix",
20
17
  "format": "prettier --write .",
21
- "typescheck": "tsc --noEmit --emitDeclarationOnly false",
18
+ "typecheck": "tsc --noEmit --emitDeclarationOnly false && tsc --noEmit -p __tests__/tsconfig.json",
22
19
  "tests": "yarn lint-staged",
23
20
  "release": "yarn semantic-release --extends ../../release.config.js -t 'eslint-hyper-fetch-v${version}'"
24
21
  },
@@ -38,13 +35,12 @@
38
35
  },
39
36
  "lint-staged": {
40
37
  "*.{js,jsx,ts,tsx}": [
41
- "yarn jest --passWithNoTests"
38
+ "vitest related --run --passWithNoTests"
42
39
  ]
43
40
  },
44
41
  "eslintConfig": {
45
42
  "extends": [
46
- "react",
47
- "react/jest"
43
+ "react"
48
44
  ]
49
45
  },
50
46
  "publishConfig": {
package/project.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "plugin-eslint",
3
+ "$schema": "../../node_modules/nx/schemas/project-schema.json"
4
+ }
@@ -1,4 +1,4 @@
1
- import { NewExpression } from "@typescript-eslint/types/dist/generated/ast-spec";
1
+ import type { NewExpression } from "@typescript-eslint/types/dist/generated/ast-spec";
2
2
 
3
3
  export function getUnexpectedGenerics({
4
4
  typeParameters,
@@ -1,4 +1,4 @@
1
- import { CallExpression, ImportDeclaration } from "@typescript-eslint/types/dist/generated/ast-spec";
1
+ import type { CallExpression, ImportDeclaration } from "@typescript-eslint/types/dist/generated/ast-spec";
2
2
 
3
3
  const importsToLookFor: string[] = ["@hyper-fetch/core"];
4
4
 
package/tsconfig.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "baseUrl": "./src",
6
6
  "jsx": "react-jsx"
7
7
  },
8
- "exclude": ["node_modules", "dist", "jest.config.ts", "__tests__"]
8
+ "exclude": ["node_modules", "dist", "vite.config.ts", "__tests__"]
9
9
  }
package/vite.config.ts ADDED
@@ -0,0 +1,39 @@
1
+ /// <reference types="vitest/config" />
2
+ import { defineConfig } from "vite";
3
+ import dts from "vite-plugin-dts";
4
+ import tsconfigPaths from "vite-tsconfig-paths";
5
+ import { getDtsCompilerOptionsForPackage } from "../../scripts/vite-dts-internal-paths";
6
+ import { getRollupExternalsFromPackageJson } from "../../scripts/vite-lib-externals-from-package";
7
+
8
+ export default defineConfig({
9
+ build: {
10
+ lib: {
11
+ entry: "src/index.ts",
12
+ formats: ["cjs"],
13
+ fileName: "index",
14
+ },
15
+ sourcemap: true,
16
+ minify: false,
17
+ rollupOptions: {
18
+ external: getRollupExternalsFromPackageJson(__dirname),
19
+ },
20
+ },
21
+ plugins: [
22
+ dts({
23
+ entryRoot: "src",
24
+ compilerOptions: getDtsCompilerOptionsForPackage(__dirname),
25
+ }),
26
+ tsconfigPaths(),
27
+ ],
28
+ test: {
29
+ globals: true,
30
+ environment: "node",
31
+ setupFiles: ["./__tests__/vitest.setup.ts"],
32
+ include: ["__tests__/**/*.spec.{ts,tsx}", "src/**/*.spec.{ts,tsx}"],
33
+ coverage: {
34
+ provider: "v8",
35
+ include: ["src/**/*.{ts,tsx}"],
36
+ exclude: ["**/*.spec.*", "**/types.*", "**/constants.*", "**/index.ts"],
37
+ },
38
+ },
39
+ });
package/.eslintrc.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "extends": ["plugin:@nx/react", "../../.eslintrc.js"],
3
- "parserOptions": {
4
- "project": ["./tsconfig.json"]
5
- },
6
- "rules": {
7
- "react/jsx-props-no-spreading": 0,
8
- "react/require-default-props": 0
9
- },
10
- "ignorePatterns": ["dist/", "coverage/", "jest.config.ts", "/*.js"]
11
- }