@storm-software/eslint-config-react 0.0.108 → 0.0.110
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/dist/index.cjs +28 -7
- package/dist/index.d.cts +24 -7
- package/dist/index.d.mts +24 -7
- package/dist/index.mjs +28 -7
- package/package.json +13 -11
package/dist/index.cjs
CHANGED
|
@@ -2,16 +2,38 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
+
let _tamagui_style_grammar_tooling = require("@tamagui/style-grammar/tooling");
|
|
5
6
|
let _storm_software_eslint = require("@storm-software/eslint");
|
|
6
|
-
|
|
7
|
+
let node_path = require("node:path");
|
|
8
|
+
let node_url = require("node:url");
|
|
9
|
+
// src/preset.ts
|
|
10
|
+
async function loadTamaguiConfig(configPath) {
|
|
11
|
+
const loaded = await import((0, node_url.pathToFileURL)((0, node_path.resolve)(configPath)).href);
|
|
12
|
+
return loaded.default ?? loaded;
|
|
13
|
+
}
|
|
14
|
+
async function resolveTamagui(option) {
|
|
15
|
+
if (!option) return false;
|
|
16
|
+
const { config, configPath, ...rest } = option;
|
|
17
|
+
const source = config ?? (configPath ? await loadTamaguiConfig(configPath) : void 0);
|
|
18
|
+
if (!source) return false;
|
|
19
|
+
return {
|
|
20
|
+
...rest,
|
|
21
|
+
config: (0, _tamagui_style_grammar_tooling.createGrammarConfigView)({
|
|
22
|
+
tokensParsed: {},
|
|
23
|
+
themes: {},
|
|
24
|
+
fontsParsed: {},
|
|
25
|
+
...source
|
|
26
|
+
})
|
|
27
|
+
};
|
|
28
|
+
}
|
|
7
29
|
/**
|
|
8
30
|
* Get the ESLint React configuration for a Storm workspace.
|
|
9
31
|
*
|
|
10
32
|
* @param options - The preset options.
|
|
11
33
|
* @param userConfigs - Additional ESLint configurations.
|
|
12
34
|
*/
|
|
13
|
-
function preset(options, ...userConfigs) {
|
|
14
|
-
const { strict = false, mdx: enableMdx = true, react = true, "react-native": enableReactNative = false, storybook: enableStorybook = true, ...rest } = options;
|
|
35
|
+
async function preset(options, ...userConfigs) {
|
|
36
|
+
const { strict = false, mdx: enableMdx = true, react = true, "react-native": enableReactNative = false, storybook: enableStorybook = true, tamagui: enableTamagui = false, ...rest } = options;
|
|
15
37
|
return (0, _storm_software_eslint.preset)({
|
|
16
38
|
...rest,
|
|
17
39
|
jsx: true,
|
|
@@ -21,15 +43,14 @@ function preset(options, ...userConfigs) {
|
|
|
21
43
|
strict
|
|
22
44
|
} : { strict },
|
|
23
45
|
"react-native": enableReactNative,
|
|
24
|
-
storybook: enableStorybook
|
|
46
|
+
storybook: enableStorybook,
|
|
47
|
+
tamagui: await resolveTamagui(enableTamagui)
|
|
25
48
|
}, ...userConfigs);
|
|
26
49
|
}
|
|
27
50
|
const getConfig = preset;
|
|
28
51
|
const defineConfig = preset;
|
|
29
|
-
|
|
30
|
-
//#region src/index.ts
|
|
52
|
+
// src/index.ts
|
|
31
53
|
var src_default = defineConfig;
|
|
32
|
-
//#endregion
|
|
33
54
|
exports.default = src_default;
|
|
34
55
|
exports.defineConfig = defineConfig;
|
|
35
56
|
exports.getConfig = getConfig;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
import { OptionsConfig as OptionsConfig$1, OptionsOverrides, OptionsReact, OptionsStorybook, PresetConfig, PresetResult, UserConfig } from "@storm-software/eslint";
|
|
2
|
-
|
|
1
|
+
import { OptionsConfig as OptionsConfig$1, OptionsOverrides, OptionsReact, OptionsStorybook, OptionsTamagui as OptionsTamagui$1, PresetConfig, PresetResult, UserConfig } from "@storm-software/eslint";
|
|
2
|
+
import { GrammarSourceConfig } from "@tamagui/style-grammar/tooling";
|
|
3
|
+
interface OptionsTamagui extends Omit<OptionsTamagui$1, "config"> {
|
|
4
|
+
/**
|
|
5
|
+
* Tamagui config passed to `createGrammarConfigView`.
|
|
6
|
+
*
|
|
7
|
+
* Used instead of `configPath` when both are set.
|
|
8
|
+
*/
|
|
9
|
+
config?: GrammarSourceConfig;
|
|
10
|
+
/**
|
|
11
|
+
* Path to a Tamagui config module.
|
|
12
|
+
*
|
|
13
|
+
* The default export is passed to `createGrammarConfigView`.
|
|
14
|
+
*/
|
|
15
|
+
configPath?: string;
|
|
16
|
+
}
|
|
3
17
|
interface OptionsConfig extends Omit<OptionsConfig$1, "jsx" | "react" | "react-native" | "mdx" | "storybook"> {
|
|
4
18
|
/**
|
|
5
19
|
* Use a strict mode for React rules, which will enable more strict rules that may cause more false positives but can catch more potential issues.
|
|
@@ -41,6 +55,12 @@ interface OptionsConfig extends Omit<OptionsConfig$1, "jsx" | "react" | "react-n
|
|
|
41
55
|
* @defaultValue false
|
|
42
56
|
*/
|
|
43
57
|
next?: true | OptionsOverrides;
|
|
58
|
+
/**
|
|
59
|
+
* Enable Tamagui rules.
|
|
60
|
+
*
|
|
61
|
+
* @defaultValue false
|
|
62
|
+
*/
|
|
63
|
+
tamagui?: false | OptionsTamagui;
|
|
44
64
|
/**
|
|
45
65
|
* Enable UnoCSS rules.
|
|
46
66
|
*
|
|
@@ -48,16 +68,13 @@ interface OptionsConfig extends Omit<OptionsConfig$1, "jsx" | "react" | "react-n
|
|
|
48
68
|
*/
|
|
49
69
|
unocss?: true | OptionsOverrides;
|
|
50
70
|
}
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region src/preset.d.ts
|
|
53
71
|
/**
|
|
54
72
|
* Get the ESLint React configuration for a Storm workspace.
|
|
55
73
|
*
|
|
56
74
|
* @param options - The preset options.
|
|
57
75
|
* @param userConfigs - Additional ESLint configurations.
|
|
58
76
|
*/
|
|
59
|
-
declare function preset(options: PresetConfig<OptionsConfig>, ...userConfigs: UserConfig[]): PresetResult
|
|
77
|
+
declare function preset(options: PresetConfig<OptionsConfig>, ...userConfigs: UserConfig[]): Promise<PresetResult>;
|
|
60
78
|
declare const getConfig: typeof preset;
|
|
61
79
|
declare const defineConfig: typeof preset;
|
|
62
|
-
|
|
63
|
-
export { type OptionsConfig, defineConfig as default, defineConfig, getConfig, preset };
|
|
80
|
+
export { type OptionsConfig, type OptionsTamagui, defineConfig as default, defineConfig, getConfig, preset };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { GrammarSourceConfig } from "@tamagui/style-grammar/tooling";
|
|
2
|
+
import { OptionsConfig as OptionsConfig$1, OptionsOverrides, OptionsReact, OptionsStorybook, OptionsTamagui as OptionsTamagui$1, PresetConfig, PresetResult, UserConfig } from "@storm-software/eslint";
|
|
3
|
+
interface OptionsTamagui extends Omit<OptionsTamagui$1, "config"> {
|
|
4
|
+
/**
|
|
5
|
+
* Tamagui config passed to `createGrammarConfigView`.
|
|
6
|
+
*
|
|
7
|
+
* Used instead of `configPath` when both are set.
|
|
8
|
+
*/
|
|
9
|
+
config?: GrammarSourceConfig;
|
|
10
|
+
/**
|
|
11
|
+
* Path to a Tamagui config module.
|
|
12
|
+
*
|
|
13
|
+
* The default export is passed to `createGrammarConfigView`.
|
|
14
|
+
*/
|
|
15
|
+
configPath?: string;
|
|
16
|
+
}
|
|
3
17
|
interface OptionsConfig extends Omit<OptionsConfig$1, "jsx" | "react" | "react-native" | "mdx" | "storybook"> {
|
|
4
18
|
/**
|
|
5
19
|
* Use a strict mode for React rules, which will enable more strict rules that may cause more false positives but can catch more potential issues.
|
|
@@ -41,6 +55,12 @@ interface OptionsConfig extends Omit<OptionsConfig$1, "jsx" | "react" | "react-n
|
|
|
41
55
|
* @defaultValue false
|
|
42
56
|
*/
|
|
43
57
|
next?: true | OptionsOverrides;
|
|
58
|
+
/**
|
|
59
|
+
* Enable Tamagui rules.
|
|
60
|
+
*
|
|
61
|
+
* @defaultValue false
|
|
62
|
+
*/
|
|
63
|
+
tamagui?: false | OptionsTamagui;
|
|
44
64
|
/**
|
|
45
65
|
* Enable UnoCSS rules.
|
|
46
66
|
*
|
|
@@ -48,16 +68,13 @@ interface OptionsConfig extends Omit<OptionsConfig$1, "jsx" | "react" | "react-n
|
|
|
48
68
|
*/
|
|
49
69
|
unocss?: true | OptionsOverrides;
|
|
50
70
|
}
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region src/preset.d.ts
|
|
53
71
|
/**
|
|
54
72
|
* Get the ESLint React configuration for a Storm workspace.
|
|
55
73
|
*
|
|
56
74
|
* @param options - The preset options.
|
|
57
75
|
* @param userConfigs - Additional ESLint configurations.
|
|
58
76
|
*/
|
|
59
|
-
declare function preset(options: PresetConfig<OptionsConfig>, ...userConfigs: UserConfig[]): PresetResult
|
|
77
|
+
declare function preset(options: PresetConfig<OptionsConfig>, ...userConfigs: UserConfig[]): Promise<PresetResult>;
|
|
60
78
|
declare const getConfig: typeof preset;
|
|
61
79
|
declare const defineConfig: typeof preset;
|
|
62
|
-
|
|
63
|
-
export { type OptionsConfig, defineConfig as default, defineConfig, getConfig, preset };
|
|
80
|
+
export { type OptionsConfig, type OptionsTamagui, defineConfig as default, defineConfig, getConfig, preset };
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,35 @@
|
|
|
1
|
+
import { createGrammarConfigView } from "@tamagui/style-grammar/tooling";
|
|
1
2
|
import { preset as preset$1 } from "@storm-software/eslint";
|
|
2
|
-
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { pathToFileURL } from "node:url";
|
|
5
|
+
// src/preset.ts
|
|
6
|
+
async function loadTamaguiConfig(configPath) {
|
|
7
|
+
const loaded = await import(pathToFileURL(resolve(configPath)).href);
|
|
8
|
+
return loaded.default ?? loaded;
|
|
9
|
+
}
|
|
10
|
+
async function resolveTamagui(option) {
|
|
11
|
+
if (!option) return false;
|
|
12
|
+
const { config, configPath, ...rest } = option;
|
|
13
|
+
const source = config ?? (configPath ? await loadTamaguiConfig(configPath) : void 0);
|
|
14
|
+
if (!source) return false;
|
|
15
|
+
return {
|
|
16
|
+
...rest,
|
|
17
|
+
config: createGrammarConfigView({
|
|
18
|
+
tokensParsed: {},
|
|
19
|
+
themes: {},
|
|
20
|
+
fontsParsed: {},
|
|
21
|
+
...source
|
|
22
|
+
})
|
|
23
|
+
};
|
|
24
|
+
}
|
|
3
25
|
/**
|
|
4
26
|
* Get the ESLint React configuration for a Storm workspace.
|
|
5
27
|
*
|
|
6
28
|
* @param options - The preset options.
|
|
7
29
|
* @param userConfigs - Additional ESLint configurations.
|
|
8
30
|
*/
|
|
9
|
-
function preset(options, ...userConfigs) {
|
|
10
|
-
const { strict = false, mdx: enableMdx = true, react = true, "react-native": enableReactNative = false, storybook: enableStorybook = true, ...rest } = options;
|
|
31
|
+
async function preset(options, ...userConfigs) {
|
|
32
|
+
const { strict = false, mdx: enableMdx = true, react = true, "react-native": enableReactNative = false, storybook: enableStorybook = true, tamagui: enableTamagui = false, ...rest } = options;
|
|
11
33
|
return preset$1({
|
|
12
34
|
...rest,
|
|
13
35
|
jsx: true,
|
|
@@ -17,13 +39,12 @@ function preset(options, ...userConfigs) {
|
|
|
17
39
|
strict
|
|
18
40
|
} : { strict },
|
|
19
41
|
"react-native": enableReactNative,
|
|
20
|
-
storybook: enableStorybook
|
|
42
|
+
storybook: enableStorybook,
|
|
43
|
+
tamagui: await resolveTamagui(enableTamagui)
|
|
21
44
|
}, ...userConfigs);
|
|
22
45
|
}
|
|
23
46
|
const getConfig = preset;
|
|
24
47
|
const defineConfig = preset;
|
|
25
|
-
|
|
26
|
-
//#region src/index.ts
|
|
48
|
+
// src/index.ts
|
|
27
49
|
var src_default = defineConfig;
|
|
28
|
-
//#endregion
|
|
29
50
|
export { src_default as default, defineConfig, getConfig, preset };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/eslint-config-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.110",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing a shared ESLint configuration for React projects used by Storm Software across many projects.",
|
|
6
6
|
"keywords": [
|
|
@@ -59,23 +59,25 @@
|
|
|
59
59
|
"types": "./dist/index.d.cts",
|
|
60
60
|
"files": ["dist"],
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@eslint-react/eslint-plugin": "^5.28.
|
|
62
|
+
"@eslint-react/eslint-plugin": "^5.28.6",
|
|
63
63
|
"@next/eslint-plugin-next": "^15.5.28",
|
|
64
|
-
"@storm-software/eslint": "0.170.
|
|
64
|
+
"@storm-software/eslint": "0.170.188",
|
|
65
|
+
"@tamagui/eslint-plugin": "^3.1.3",
|
|
66
|
+
"@tamagui/style-grammar": "^3.1.3",
|
|
65
67
|
"@unocss/eslint-plugin": "^65.5.0",
|
|
66
68
|
"astro-eslint-parser": "^1.4.0",
|
|
67
69
|
"eslint": "^10.13.0",
|
|
68
70
|
"eslint-plugin-astro": "^1.7.0",
|
|
69
|
-
"eslint-plugin-mdx": "^3.8.
|
|
71
|
+
"eslint-plugin-mdx": "^3.8.2",
|
|
70
72
|
"eslint-plugin-react-compiler": "19.1.0-rc.2",
|
|
71
|
-
"eslint-plugin-react-dom": "^5.28.
|
|
73
|
+
"eslint-plugin-react-dom": "^5.28.6",
|
|
72
74
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
73
|
-
"eslint-plugin-react-jsx": "^5.28.
|
|
74
|
-
"eslint-plugin-react-naming-convention": "^5.28.
|
|
75
|
+
"eslint-plugin-react-jsx": "^5.28.6",
|
|
76
|
+
"eslint-plugin-react-naming-convention": "^5.28.6",
|
|
75
77
|
"eslint-plugin-react-refresh": "^0.5.7",
|
|
76
|
-
"eslint-plugin-react-rsc": "^5.28.
|
|
77
|
-
"eslint-plugin-react-web-api": "^5.28.
|
|
78
|
-
"eslint-plugin-react-x": "^5.28.
|
|
78
|
+
"eslint-plugin-react-rsc": "^5.28.6",
|
|
79
|
+
"eslint-plugin-react-web-api": "^5.28.6",
|
|
80
|
+
"eslint-plugin-react-x": "^5.28.6",
|
|
79
81
|
"eslint-plugin-storybook": "^0.11.6",
|
|
80
82
|
"prettier-plugin-astro": "^0.14.1"
|
|
81
83
|
},
|
|
@@ -100,5 +102,5 @@
|
|
|
100
102
|
"react-dom": { "optional": false }
|
|
101
103
|
},
|
|
102
104
|
"publishConfig": { "access": "public" },
|
|
103
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "7a502e974b390096b201737b87f85e793499bad2"
|
|
104
106
|
}
|