@zukhruf/eslint 0.6.10 → 0.6.11
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.
- package/README.md +16 -15
- package/dist/base/config.d.ts.map +1 -1
- package/dist/base/config.js +19 -4
- package/dist/base/config.js.map +1 -1
- package/dist/base/options.d.ts +8 -0
- package/dist/base/options.d.ts.map +1 -1
- package/dist/base/options.js +8 -0
- package/dist/base/options.js.map +1 -1
- package/dist/imports/no-other-test-runner.d.ts +3 -0
- package/dist/imports/no-other-test-runner.d.ts.map +1 -0
- package/dist/imports/no-other-test-runner.js +16 -0
- package/dist/imports/no-other-test-runner.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -40,20 +40,20 @@ Put framework configs (for example [`@zukhruf/eslint/react`](#react)) **before**
|
|
|
40
40
|
|
|
41
41
|
## Configs
|
|
42
42
|
|
|
43
|
-
| Config | Files | Rules
|
|
44
|
-
| ----------------- | ------------------------------------- |
|
|
45
|
-
| `base` | all source | `@eslint/js` and `typescript-eslint` recommended; `consistent-type-assertions` (never), `no-namespace
|
|
46
|
-
| `tests` | test files, `src/testing` | `no-test-lifecycle-hooks`, `no-process-env-write`, `no-direct-msw-server`, `no-catch-all-msw-handler`, `no-timer-race`, `no-sleep-poll-loop`, `no-global-test-mock`, `no-raw-temp-directory`
|
|
47
|
-
| `diagnostics` | source, not tests | `no-fabricated-fallback`, `no-hardcoded-id-shape`, `consistent-event-name`
|
|
48
|
-
| `env` | TypeScript, not tests or tool configs | `no-undeclared-process-env`, `no-single-env-read-wrapper`, `no-default-for-path-env`
|
|
49
|
-
| `packaged-app` | TypeScript, not tests | `no-bare-spawn`
|
|
50
|
-
| `react` | `.tsx`, `.jsx` | `no-as-child`
|
|
51
|
-
| `react-router` | source | `require-loader-data-type-argument`; outside tests: `no-raw-route-path`, `no-internal-anchor`; TypeScript: `only-throw-error` allows a `Response` and `DataWithResponseInit`
|
|
52
|
-
| `hono` | TypeScript, not tests | `no-untyped-empty-json`, `no-http-exception-factory`, `no-catch-around-next`
|
|
53
|
-
| `better-auth` | TypeScript, not tests | `no-api-error-instanceof`, `no-on-api-error-throw`
|
|
54
|
-
| `tailwind` | source | `no-h-screen`, `no-arbitrary-z-index`, `no-will-change`
|
|
55
|
-
| `pulumi` | TypeScript | `require-server-replace-guard`
|
|
56
|
-
| `nx-project-json` | `project.json` | `no-missing-asset-input`
|
|
43
|
+
| Config | Files | Rules |
|
|
44
|
+
| ----------------- | ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
45
|
+
| `base` | all source | `@eslint/js` and `typescript-eslint` recommended; `consistent-type-assertions` (never), `no-namespace` (a `declare` namespace allowed), `zukhruf/no-enum`, `no-empty-object-type` (an interface that extends one type allowed, such as `ProcessEnv` in `env.ts`; `no-empty-interface`, which it replaced, is off); `import-x/no-duplicates`, `import-x/no-unassigned-import` (allows `**/*.css`, `**/env.ts` and `**/startup.ts`); `functional/no-let` (module scope); `zukhruf/no-state-managers`, `zukhruf/no-playwright-test`, `zukhruf/no-other-test-runner`, `zukhruf/no-test-file-import`, `zukhruf/no-collect-loop`; typed lint: `no-floating-promises`, `no-misused-promises`, `only-throw-error`, `switch-exhaustiveness-check` (a `default` counts as exhaustive), `zukhruf/no-promise-field`, `zukhruf/no-phase-flag`; `no-require-imports` is off in `.cjs` and `.cts`, because `require()` is the only import form in a CommonJS file |
|
|
46
|
+
| `tests` | test files, `src/testing` | `no-test-lifecycle-hooks`, `no-process-env-write`, `no-direct-msw-server`, `no-catch-all-msw-handler`, `no-timer-race`, `no-sleep-poll-loop`, `no-global-test-mock`, `no-raw-temp-directory` |
|
|
47
|
+
| `diagnostics` | source, not tests | `no-fabricated-fallback`, `no-hardcoded-id-shape`, `consistent-event-name` |
|
|
48
|
+
| `env` | TypeScript, not tests or tool configs | `no-undeclared-process-env`, `no-single-env-read-wrapper`, `no-default-for-path-env` |
|
|
49
|
+
| `packaged-app` | TypeScript, not tests | `no-bare-spawn` |
|
|
50
|
+
| `react` | `.tsx`, `.jsx` | `no-as-child` |
|
|
51
|
+
| `react-router` | source | `require-loader-data-type-argument`; outside tests: `no-raw-route-path`, `no-internal-anchor`; TypeScript: `only-throw-error` allows a `Response` and `DataWithResponseInit` |
|
|
52
|
+
| `hono` | TypeScript, not tests | `no-untyped-empty-json`, `no-http-exception-factory`, `no-catch-around-next` |
|
|
53
|
+
| `better-auth` | TypeScript, not tests | `no-api-error-instanceof`, `no-on-api-error-throw` |
|
|
54
|
+
| `tailwind` | source | `no-h-screen`, `no-arbitrary-z-index`, `no-will-change` |
|
|
55
|
+
| `pulumi` | TypeScript | `require-server-replace-guard` |
|
|
56
|
+
| `nx-project-json` | `project.json` | `no-missing-asset-input` |
|
|
57
57
|
|
|
58
58
|
`base` turns on typed lint (`parserOptions.projectService`). Each linted TypeScript file must be in a tsconfig.
|
|
59
59
|
|
|
@@ -100,12 +100,13 @@ Each config registers its plugins for all files. Each rule keeps its own `files`
|
|
|
100
100
|
To extend a `base` rule, use its factory. Do not declare the key again with only your entries: that replaces the base options.
|
|
101
101
|
|
|
102
102
|
```js
|
|
103
|
-
import { noFloatingPromises, noLet } from '@zukhruf/eslint';
|
|
103
|
+
import { noFloatingPromises, noLet, noUnassignedImport } from '@zukhruf/eslint';
|
|
104
104
|
|
|
105
105
|
{
|
|
106
106
|
rules: {
|
|
107
107
|
'functional/no-let': ['error', noLet({ ignoreIdentifierPattern: ['^cached'] })],
|
|
108
108
|
'@typescript-eslint/no-floating-promises': ['error', noFloatingPromises({ allowForKnownSafeCalls: [/* … */] })],
|
|
109
|
+
'import-x/no-unassigned-import': ['error', noUnassignedImport({ allow: ['**/exceptions.ts'] })],
|
|
109
110
|
},
|
|
110
111
|
}
|
|
111
112
|
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/base/config.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/base/config.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,eAAe,CAAC;AAkCrD;;;;GAIG;AACH,eAAO,MAAM,IAAI,EAAE,OAwJlB,CAAC"}
|
package/dist/base/config.js
CHANGED
|
@@ -9,15 +9,17 @@ import noPromiseField from "../async-values/no-promise-field.js";
|
|
|
9
9
|
import noPhaseFlag from "../class-state/no-phase-flag.js";
|
|
10
10
|
import { enable } from "../concept.js";
|
|
11
11
|
import { BUILD_OUTPUT, COMMONJS, FIXTURES, JAVASCRIPT, SOURCE, TESTS, TEST_SUPPORT, TYPESCRIPT, } from "../files.js";
|
|
12
|
+
import noOtherTestRunner from "../imports/no-other-test-runner.js";
|
|
12
13
|
import noPlaywrightTest from "../imports/no-playwright-test.js";
|
|
13
14
|
import noStateManagers from "../imports/no-state-managers.js";
|
|
14
15
|
import noTestFileImport from "../imports/no-test-file-import.js";
|
|
15
16
|
import noEnum from "../language/no-enum.js";
|
|
16
17
|
import { workspaceRootOf } from "../workspace/workspace-root.js";
|
|
17
|
-
import { noFloatingPromises, noLet } from "./options.js";
|
|
18
|
+
import { noFloatingPromises, noLet, noUnassignedImport } from "./options.js";
|
|
18
19
|
const importBans = {
|
|
19
20
|
'no-state-managers': noStateManagers,
|
|
20
21
|
'no-playwright-test': noPlaywrightTest,
|
|
22
|
+
'no-other-test-runner': noOtherTestRunner,
|
|
21
23
|
'no-test-file-import': noTestFileImport,
|
|
22
24
|
};
|
|
23
25
|
const rules = {
|
|
@@ -88,9 +90,22 @@ export const base = {
|
|
|
88
90
|
{ assertionStyle: 'never' },
|
|
89
91
|
],
|
|
90
92
|
// Enums and value namespaces need a runtime transform, which Node's
|
|
91
|
-
// strip-only `.ts` execution does not do.
|
|
92
|
-
|
|
93
|
+
// strip-only `.ts` execution does not do. A declared namespace, such
|
|
94
|
+
// as `NodeJS` in the `declare global` of env.ts, is types only.
|
|
95
|
+
'@typescript-eslint/no-namespace': [
|
|
96
|
+
'error',
|
|
97
|
+
{ allowDeclarations: true },
|
|
98
|
+
],
|
|
93
99
|
'zukhruf/no-enum': 'error',
|
|
100
|
+
// An interface that extends one type is an augmentation point, such
|
|
101
|
+
// as ProcessEnv in env.ts. typescript-eslint replaced
|
|
102
|
+
// no-empty-interface, which Nx's TypeScript preset still turns on,
|
|
103
|
+
// with no-empty-object-type.
|
|
104
|
+
'@typescript-eslint/no-empty-object-type': [
|
|
105
|
+
'error',
|
|
106
|
+
{ allowInterfaces: 'with-single-extends' },
|
|
107
|
+
],
|
|
108
|
+
'@typescript-eslint/no-empty-interface': 'off',
|
|
94
109
|
},
|
|
95
110
|
// A disable directive that suppresses nothing outlived its reason.
|
|
96
111
|
linterOptions: { reportUnusedDisableDirectives: 'error' },
|
|
@@ -104,7 +119,7 @@ export const base = {
|
|
|
104
119
|
'import-x/no-duplicates': ['error', { 'prefer-inline': false }],
|
|
105
120
|
// A bare `import './x.ts'` hides a registration behind evaluation
|
|
106
121
|
// order; a module you need is a value you bind.
|
|
107
|
-
'import-x/no-unassigned-import': 'error',
|
|
122
|
+
'import-x/no-unassigned-import': ['error', noUnassignedImport()],
|
|
108
123
|
},
|
|
109
124
|
}, {
|
|
110
125
|
// An async iterable read to its end into an array is Array.fromAsync,
|
package/dist/base/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/base/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CA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;gBACzC,OAAO;gBACP,kBAAkB,EAAE;aACrB;YACD,kEAAkE;YAClE,gBAAgB;YAChB,wCAAwC,EAAE;gBACxC,OAAO;gBACP,EAAE,kBAAkB,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE;aACpD;YACD,mEAAmE;YACnE,yBAAyB;YACzB,qCAAqC,EAAE,OAAO;YAC9C,kEAAkE;YAClE,gCAAgC;YAChC,gDAAgD,EAAE;gBAChD,OAAO;gBACP,EAAE,kCAAkC,EAAE,IAAI,EAAE;aAC7C;YACD,0BAA0B,EAAE,OAAO;YACnC,uBAAuB,EAAE,OAAO;SACjC;KACF,CACF;CACJ,CAAC"}
|
package/dist/base/options.d.ts
CHANGED
|
@@ -7,6 +7,14 @@ export declare function noLet({ ignoreIdentifierPattern }?: NoLetOptions): {
|
|
|
7
7
|
allowInFunctions: boolean;
|
|
8
8
|
ignoreIdentifierPattern: string[];
|
|
9
9
|
};
|
|
10
|
+
export interface NoUnassignedImportOptions {
|
|
11
|
+
/** More side-effect imports to allow, as globs of the import source. */
|
|
12
|
+
allow?: string[];
|
|
13
|
+
}
|
|
14
|
+
/** Options for `import-x/no-unassigned-import`, with the standard's side-effect imports already allowed. */
|
|
15
|
+
export declare function noUnassignedImport({ allow, }?: NoUnassignedImportOptions): {
|
|
16
|
+
allow: string[];
|
|
17
|
+
};
|
|
10
18
|
/** typescript-eslint's name for a type or value by where it is declared: the TS lib, a package, or a file. */
|
|
11
19
|
export interface TypeOrValueSpecifier {
|
|
12
20
|
from: 'file' | 'lib' | 'package';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/base/options.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,YAAY;IAC3B,qDAAqD;IACrD,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;CACpC;AAED,8GAA8G;AAC9G,wBAAgB,KAAK,CAAC,EAAE,uBAA4B,EAAE,GAAE,YAAiB;;;EAExE;AAED,8GAA8G;AAC9G,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC;IACjC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,yBAAyB;IACxC,sBAAsB,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACjD;AASD,qGAAqG;AACrG,wBAAgB,kBAAkB,CAAC,EACjC,sBAA2B,GAC5B,GAAE,yBAA8B;;EAIhC"}
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/base/options.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,YAAY;IAC3B,qDAAqD;IACrD,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;CACpC;AAED,8GAA8G;AAC9G,wBAAgB,KAAK,CAAC,EAAE,uBAA4B,EAAE,GAAE,YAAiB;;;EAExE;AAED,MAAM,WAAW,yBAAyB;IACxC,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAOD,4GAA4G;AAC5G,wBAAgB,kBAAkB,CAAC,EACjC,KAAU,GACX,GAAE,yBAA8B;;EAEhC;AAED,8GAA8G;AAC9G,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC;IACjC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,yBAAyB;IACxC,sBAAsB,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACjD;AASD,qGAAqG;AACrG,wBAAgB,kBAAkB,CAAC,EACjC,sBAA2B,GAC5B,GAAE,yBAA8B;;EAIhC"}
|
package/dist/base/options.js
CHANGED
|
@@ -7,6 +7,14 @@
|
|
|
7
7
|
export function noLet({ ignoreIdentifierPattern = [] } = {}) {
|
|
8
8
|
return { allowInFunctions: true, ignoreIdentifierPattern };
|
|
9
9
|
}
|
|
10
|
+
// The side effects the monorepo standard defines: a stylesheet for the
|
|
11
|
+
// bundler, `env.ts` that parses the environment first, and `startup.ts` that
|
|
12
|
+
// connects the stores before the server serves.
|
|
13
|
+
const STANDARD_SIDE_EFFECTS = ['**/*.css', '**/env.ts', '**/startup.ts'];
|
|
14
|
+
/** Options for `import-x/no-unassigned-import`, with the standard's side-effect imports already allowed. */
|
|
15
|
+
export function noUnassignedImport({ allow = [], } = {}) {
|
|
16
|
+
return { allow: [...STANDARD_SIDE_EFFECTS, ...allow] };
|
|
17
|
+
}
|
|
10
18
|
// node:test's test/it/describe/suite return a Promise the runner owns.
|
|
11
19
|
const NODE_TEST_CALLS = {
|
|
12
20
|
from: 'package',
|
package/dist/base/options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/base/options.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,0EAA0E;AAC1E,0EAA0E;AAC1E,sEAAsE;AACtE,iEAAiE;AAOjE,8GAA8G;AAC9G,MAAM,UAAU,KAAK,CAAC,EAAE,uBAAuB,GAAG,EAAE,KAAmB,EAAE;IACvE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC;AAC7D,CAAC;AAcD,uEAAuE;AACvE,MAAM,eAAe,GAAyB;IAC5C,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,WAAW;IACpB,IAAI,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC;CAC1C,CAAC;AAEF,qGAAqG;AACrG,MAAM,UAAU,kBAAkB,CAAC,EACjC,sBAAsB,GAAG,EAAE,MACE,EAAE;IAC/B,OAAO;QACL,sBAAsB,EAAE,CAAC,eAAe,EAAE,GAAG,sBAAsB,CAAC;KACrE,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/base/options.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,0EAA0E;AAC1E,0EAA0E;AAC1E,sEAAsE;AACtE,iEAAiE;AAOjE,8GAA8G;AAC9G,MAAM,UAAU,KAAK,CAAC,EAAE,uBAAuB,GAAG,EAAE,KAAmB,EAAE;IACvE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC;AAC7D,CAAC;AAOD,uEAAuE;AACvE,6EAA6E;AAC7E,gDAAgD;AAChD,MAAM,qBAAqB,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;AAEzE,4GAA4G;AAC5G,MAAM,UAAU,kBAAkB,CAAC,EACjC,KAAK,GAAG,EAAE,MACmB,EAAE;IAC/B,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,qBAAqB,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;AACzD,CAAC;AAcD,uEAAuE;AACvE,MAAM,eAAe,GAAyB;IAC5C,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,WAAW;IACpB,IAAI,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC;CAC1C,CAAC;AAEF,qGAAqG;AACrG,MAAM,UAAU,kBAAkB,CAAC,EACjC,sBAAsB,GAAG,EAAE,MACE,EAAE;IAC/B,OAAO;QACL,sBAAsB,EAAE,CAAC,eAAe,EAAE,GAAG,sBAAsB,CAAC;KACrE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-other-test-runner.d.ts","sourceRoot":"","sources":["../../src/imports/no-other-test-runner.ts"],"names":[],"mappings":";AAEA,wBAcG"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { importBanRule } from "../authoring/import-ban.js";
|
|
2
|
+
export default importBanRule({
|
|
3
|
+
description: 'Disallow test runners other than node:test, and Vitest in a Vite app',
|
|
4
|
+
packages: [
|
|
5
|
+
'jest',
|
|
6
|
+
'@jest/globals',
|
|
7
|
+
'mocha',
|
|
8
|
+
'jasmine',
|
|
9
|
+
'ava',
|
|
10
|
+
'tap',
|
|
11
|
+
'tape',
|
|
12
|
+
'uvu',
|
|
13
|
+
],
|
|
14
|
+
message: 'Use node:test, or Vitest in a Vite app.',
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=no-other-test-runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-other-test-runner.js","sourceRoot":"","sources":["../../src/imports/no-other-test-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,eAAe,aAAa,CAAC;IAC3B,WAAW,EACT,sEAAsE;IACxE,QAAQ,EAAE;QACR,MAAM;QACN,eAAe;QACf,OAAO;QACP,SAAS;QACT,KAAK;QACL,KAAK;QACL,MAAM;QACN,KAAK;KACN;IACD,OAAO,EAAE,yCAAyC;CACnD,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default } from './plugin.ts';
|
|
2
|
-
export { noFloatingPromises, type NoFloatingPromisesOptions, noLet, type NoLetOptions, type TypeOrValueSpecifier, } from './base/options.ts';
|
|
2
|
+
export { noFloatingPromises, type NoFloatingPromisesOptions, noLet, type NoLetOptions, noUnassignedImport, type NoUnassignedImportOptions, type TypeOrValueSpecifier, } from './base/options.ts';
|
|
3
3
|
export { reactRouterOnlyThrowError, type ReactRouterOnlyThrowErrorOptions, } from './react-router/options.ts';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EACL,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,KAAK,EACL,KAAK,YAAY,EACjB,KAAK,oBAAoB,GAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,yBAAyB,EACzB,KAAK,gCAAgC,GACtC,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EACL,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,KAAK,EACL,KAAK,YAAY,EACjB,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,GAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,yBAAyB,EACzB,KAAK,gCAAgC,GACtC,MAAM,2BAA2B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default } from "./plugin.js";
|
|
2
|
-
export { noFloatingPromises, noLet, } from "./base/options.js";
|
|
2
|
+
export { noFloatingPromises, noLet, noUnassignedImport, } from "./base/options.js";
|
|
3
3
|
export { reactRouterOnlyThrowError, } from "./react-router/options.js";
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EACL,kBAAkB,EAElB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EACL,kBAAkB,EAElB,KAAK,EAEL,kBAAkB,GAGnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,yBAAyB,GAE1B,MAAM,2BAA2B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zukhruf/eslint",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.11",
|
|
4
4
|
"description": "ESLint rules and configs shared across workspaces. Every check is its own named rule, so a repo's own config cannot silently erase it.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"ts-api-utils": "^2.5.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@zukhruf/testing": "^0.6.
|
|
65
|
+
"@zukhruf/testing": "^0.6.11"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"@eslint-react/eslint-plugin": "^5.28.8",
|