@storm-software/oxlint 0.0.2 → 0.0.4

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 CHANGED
@@ -27,7 +27,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
27
27
 
28
28
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
29
29
 
30
- [![Version](https://img.shields.io/badge/version-0.170.60-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
30
+ [![Version](https://img.shields.io/badge/version-0.0.2-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
31
31
 
32
32
  <!-- prettier-ignore-start -->
33
33
  <!-- markdownlint-disable -->
@@ -1,3 +1,4 @@
1
+ import { storybook } from './chunk-KRBDXNMO.js';
1
2
  import { test } from './chunk-IYISSAYD.js';
2
3
  import { tsdoc } from './chunk-ORLPYCNP.js';
3
4
  import { typescript } from './chunk-GSFW4I7Y.js';
@@ -7,11 +8,11 @@ import { GLOB_EXCLUDE } from './chunk-HZVUO4DQ.js';
7
8
  import { next } from './chunk-66XRZUEY.js';
8
9
  import { node } from './chunk-SGIBJGAV.js';
9
10
  import { pnpm } from './chunk-24KYXRHB.js';
11
+ import { prettier } from './chunk-GEMVBBN7.js';
10
12
  import { promise } from './chunk-WQ37FH6C.js';
11
13
  import { reactPerf } from './chunk-JHRYYA2I.js';
12
- import { react } from './chunk-7WK2CHER.js';
14
+ import { react } from './chunk-OPIMNRNA.js';
13
15
  import { regexp } from './chunk-I47UNAPW.js';
14
- import { storybook } from './chunk-KRBDXNMO.js';
15
16
  import { banner } from './chunk-5QRE5J4W.js';
16
17
  import { imports } from './chunk-5IA7BNJZ.js';
17
18
  import { javascript } from './chunk-UMR5HNLA.js';
@@ -2021,6 +2022,7 @@ async function getStormConfig(options = {}, ...userConfigs) {
2021
2022
  jsdoc: enableJsdoc = true,
2022
2023
  node: enableNode = true,
2023
2024
  promise: enablePromise = true,
2025
+ prettier: enablePrettier = true,
2024
2026
  pnpm: enablePnpm = true,
2025
2027
  tsdoc: enableTSDoc = true,
2026
2028
  unicorn: enableUnicorn = true,
@@ -2058,7 +2060,12 @@ async function getStormConfig(options = {}, ...userConfigs) {
2058
2060
  configs.push(typescript(resolveSubOptions(enableTypeScript)));
2059
2061
  }
2060
2062
  if (enableReact) {
2061
- configs.push(react(resolveSubOptions(enableReact)));
2063
+ configs.push(
2064
+ ...react({
2065
+ typeAware: enableTypeScript !== false,
2066
+ ...resolveSubOptions(enableReact)
2067
+ })
2068
+ );
2062
2069
  }
2063
2070
  if (enableReactPerf) {
2064
2071
  configs.push(reactPerf());
@@ -2078,6 +2085,9 @@ async function getStormConfig(options = {}, ...userConfigs) {
2078
2085
  if (enablePromise) {
2079
2086
  configs.push(promise());
2080
2087
  }
2088
+ if (enablePrettier) {
2089
+ configs.push(prettier());
2090
+ }
2081
2091
  if (enableUnicorn) {
2082
2092
  configs.push(unicorn());
2083
2093
  }
@@ -0,0 +1,16 @@
1
+ import config from 'eslint-plugin-prettier/recommended';
2
+
3
+ // src/configs/prettier.ts
4
+ function prettier() {
5
+ return {
6
+ jsPlugins: ["eslint-plugin-prettier"],
7
+ rules: {
8
+ ...config.rules,
9
+ "prettier/prettier": "error",
10
+ "arrow-body-style": "off",
11
+ "prefer-arrow-callback": "off"
12
+ }
13
+ };
14
+ }
15
+
16
+ export { prettier };
@@ -0,0 +1,136 @@
1
+ import { isPackageExists } from 'local-pkg';
2
+
3
+ // src/configs/react.ts
4
+ var ReactRefreshAllowConstantExportPackages = ["vite"];
5
+ var ReactRouterPackages = [
6
+ "@react-router/node",
7
+ "@react-router/react",
8
+ "@react-router/serve",
9
+ "@react-router/dev"
10
+ ];
11
+ function react(options = {}) {
12
+ const { typeAware = true } = options;
13
+ const typeAwareRules = {
14
+ "react/no-leaked-conditional-rendering": "warn"
15
+ };
16
+ const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some(
17
+ (i) => isPackageExists(i)
18
+ );
19
+ const isUsingReactRouter = ReactRouterPackages.some((i) => isPackageExists(i));
20
+ return [
21
+ {
22
+ plugins: ["react"],
23
+ rules: {
24
+ // recommended rules from @eslint-react/dom
25
+ "react-dom/no-children-in-void-dom-elements": "warn",
26
+ "react-dom/no-dangerously-set-innerhtml": "warn",
27
+ "react-dom/no-dangerously-set-innerhtml-with-children": "error",
28
+ "react-dom/no-find-dom-node": "error",
29
+ "react-dom/no-missing-button-type": "warn",
30
+ "react-dom/no-missing-iframe-sandbox": "warn",
31
+ "react-dom/no-namespace": "error",
32
+ "react-dom/no-render-return-value": "error",
33
+ "react-dom/no-script-url": "warn",
34
+ "react-dom/no-unsafe-iframe-sandbox": "warn",
35
+ "react-dom/no-unsafe-target-blank": "warn",
36
+ // recommended rules react-hooks
37
+ "react-hooks/exhaustive-deps": "warn",
38
+ "react-hooks/rules-of-hooks": "error",
39
+ // react refresh
40
+ "react-refresh/only-export-components": [
41
+ "warn",
42
+ {
43
+ allowConstantExport: isAllowConstantExport,
44
+ allowExportNames: [
45
+ "dynamic",
46
+ "dynamicParams",
47
+ "revalidate",
48
+ "fetchCache",
49
+ "runtime",
50
+ "preferredRegion",
51
+ "maxDuration",
52
+ "config",
53
+ "generateStaticParams",
54
+ "metadata",
55
+ "generateMetadata",
56
+ "viewport",
57
+ "generateViewport"
58
+ ].concat(
59
+ isUsingReactRouter ? ["meta", "links", "headers", "loader", "action"] : []
60
+ )
61
+ }
62
+ ],
63
+ // recommended rules from @eslint-react/web-api
64
+ "react-web-api/no-leaked-event-listener": "warn",
65
+ "react-web-api/no-leaked-interval": "warn",
66
+ "react-web-api/no-leaked-resize-observer": "warn",
67
+ "react-web-api/no-leaked-timeout": "warn",
68
+ // recommended rules from @eslint-react
69
+ "react/ensure-forward-ref-using-ref": "warn",
70
+ "react/jsx-no-duplicate-props": "warn",
71
+ "react/jsx-uses-vars": "warn",
72
+ "react/no-access-state-in-setstate": "error",
73
+ "react/no-array-index-key": "warn",
74
+ "react/no-children-count": "warn",
75
+ "react/no-children-for-each": "warn",
76
+ "react/no-children-map": "warn",
77
+ "react/no-children-only": "warn",
78
+ "react/no-children-to-array": "warn",
79
+ "react/no-clone-element": "warn",
80
+ "react/no-comment-textnodes": "warn",
81
+ "react/no-component-will-mount": "error",
82
+ "react/no-component-will-receive-props": "error",
83
+ "react/no-component-will-update": "error",
84
+ "react/no-context-provider": "warn",
85
+ "react/no-create-ref": "error",
86
+ "react/no-default-props": "error",
87
+ "react/no-direct-mutation-state": "error",
88
+ "react/no-duplicate-key": "error",
89
+ "react/no-forward-ref": "warn",
90
+ "react/no-implicit-key": "warn",
91
+ "react/no-missing-key": "error",
92
+ "react/no-nested-components": "error",
93
+ "react/no-prop-types": "error",
94
+ "react/no-redundant-should-component-update": "error",
95
+ "react/no-set-state-in-component-did-mount": "warn",
96
+ "react/no-set-state-in-component-did-update": "warn",
97
+ "react/no-set-state-in-component-will-update": "warn",
98
+ "react/no-string-refs": "error",
99
+ "react/no-unsafe-component-will-mount": "warn",
100
+ "react/no-unsafe-component-will-receive-props": "warn",
101
+ "react/no-unsafe-component-will-update": "warn",
102
+ "react/no-unstable-context-value": "warn",
103
+ "react/no-unstable-default-props": "warn",
104
+ "react/no-unused-class-component-members": "warn",
105
+ "react/no-unused-state": "warn",
106
+ "react/prefer-destructuring-assignment": "warn",
107
+ "react/prefer-shorthand-boolean": "warn",
108
+ "react/prefer-shorthand-fragment": "warn",
109
+ "react/jsx-key": "error",
110
+ "react/jsx-no-target-blank": "warn",
111
+ "react/no-danger": "warn",
112
+ "react/no-unknown-property": "error"
113
+ },
114
+ settings: {
115
+ react: {
116
+ version: options.version || "detect"
117
+ }
118
+ }
119
+ },
120
+ {
121
+ jsPlugins: ["eslint-plugin-react-compiler"],
122
+ rules: {
123
+ "react-compiler/react-compiler": "error"
124
+ }
125
+ },
126
+ ...typeAware ? [
127
+ {
128
+ rules: {
129
+ ...typeAwareRules
130
+ }
131
+ }
132
+ ] : []
133
+ ];
134
+ }
135
+
136
+ export { react };
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ var config = require('eslint-plugin-prettier/recommended');
4
+
5
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
+
7
+ var config__default = /*#__PURE__*/_interopDefault(config);
8
+
9
+ // src/configs/prettier.ts
10
+ function prettier() {
11
+ return {
12
+ jsPlugins: ["eslint-plugin-prettier"],
13
+ rules: {
14
+ ...config__default.default.rules,
15
+ "prettier/prettier": "error",
16
+ "arrow-body-style": "off",
17
+ "prefer-arrow-callback": "off"
18
+ }
19
+ };
20
+ }
21
+
22
+ exports.prettier = prettier;
@@ -0,0 +1,8 @@
1
+ import { TypedConfigItem } from '../types.cjs';
2
+
3
+ /**
4
+ * Config for Prettier eslint integration
5
+ */
6
+ declare function prettier(): TypedConfigItem;
7
+
8
+ export { prettier };
@@ -0,0 +1,8 @@
1
+ import { TypedConfigItem } from '../types.js';
2
+
3
+ /**
4
+ * Config for Prettier eslint integration
5
+ */
6
+ declare function prettier(): TypedConfigItem;
7
+
8
+ export { prettier };
@@ -0,0 +1 @@
1
+ export { prettier } from '../chunk-GEMVBBN7.js';
@@ -1,21 +1,138 @@
1
1
  'use strict';
2
2
 
3
+ var localPkg = require('local-pkg');
4
+
3
5
  // src/configs/react.ts
6
+ var ReactRefreshAllowConstantExportPackages = ["vite"];
7
+ var ReactRouterPackages = [
8
+ "@react-router/node",
9
+ "@react-router/react",
10
+ "@react-router/serve",
11
+ "@react-router/dev"
12
+ ];
4
13
  function react(options = {}) {
5
- return {
6
- plugins: ["react"],
7
- rules: {
8
- "react/jsx-key": "error",
9
- "react/jsx-no-target-blank": "warn",
10
- "react/no-danger": "warn",
11
- "react/no-unknown-property": "error"
14
+ const { typeAware = true } = options;
15
+ const typeAwareRules = {
16
+ "react/no-leaked-conditional-rendering": "warn"
17
+ };
18
+ const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some(
19
+ (i) => localPkg.isPackageExists(i)
20
+ );
21
+ const isUsingReactRouter = ReactRouterPackages.some((i) => localPkg.isPackageExists(i));
22
+ return [
23
+ {
24
+ plugins: ["react"],
25
+ rules: {
26
+ // recommended rules from @eslint-react/dom
27
+ "react-dom/no-children-in-void-dom-elements": "warn",
28
+ "react-dom/no-dangerously-set-innerhtml": "warn",
29
+ "react-dom/no-dangerously-set-innerhtml-with-children": "error",
30
+ "react-dom/no-find-dom-node": "error",
31
+ "react-dom/no-missing-button-type": "warn",
32
+ "react-dom/no-missing-iframe-sandbox": "warn",
33
+ "react-dom/no-namespace": "error",
34
+ "react-dom/no-render-return-value": "error",
35
+ "react-dom/no-script-url": "warn",
36
+ "react-dom/no-unsafe-iframe-sandbox": "warn",
37
+ "react-dom/no-unsafe-target-blank": "warn",
38
+ // recommended rules react-hooks
39
+ "react-hooks/exhaustive-deps": "warn",
40
+ "react-hooks/rules-of-hooks": "error",
41
+ // react refresh
42
+ "react-refresh/only-export-components": [
43
+ "warn",
44
+ {
45
+ allowConstantExport: isAllowConstantExport,
46
+ allowExportNames: [
47
+ "dynamic",
48
+ "dynamicParams",
49
+ "revalidate",
50
+ "fetchCache",
51
+ "runtime",
52
+ "preferredRegion",
53
+ "maxDuration",
54
+ "config",
55
+ "generateStaticParams",
56
+ "metadata",
57
+ "generateMetadata",
58
+ "viewport",
59
+ "generateViewport"
60
+ ].concat(
61
+ isUsingReactRouter ? ["meta", "links", "headers", "loader", "action"] : []
62
+ )
63
+ }
64
+ ],
65
+ // recommended rules from @eslint-react/web-api
66
+ "react-web-api/no-leaked-event-listener": "warn",
67
+ "react-web-api/no-leaked-interval": "warn",
68
+ "react-web-api/no-leaked-resize-observer": "warn",
69
+ "react-web-api/no-leaked-timeout": "warn",
70
+ // recommended rules from @eslint-react
71
+ "react/ensure-forward-ref-using-ref": "warn",
72
+ "react/jsx-no-duplicate-props": "warn",
73
+ "react/jsx-uses-vars": "warn",
74
+ "react/no-access-state-in-setstate": "error",
75
+ "react/no-array-index-key": "warn",
76
+ "react/no-children-count": "warn",
77
+ "react/no-children-for-each": "warn",
78
+ "react/no-children-map": "warn",
79
+ "react/no-children-only": "warn",
80
+ "react/no-children-to-array": "warn",
81
+ "react/no-clone-element": "warn",
82
+ "react/no-comment-textnodes": "warn",
83
+ "react/no-component-will-mount": "error",
84
+ "react/no-component-will-receive-props": "error",
85
+ "react/no-component-will-update": "error",
86
+ "react/no-context-provider": "warn",
87
+ "react/no-create-ref": "error",
88
+ "react/no-default-props": "error",
89
+ "react/no-direct-mutation-state": "error",
90
+ "react/no-duplicate-key": "error",
91
+ "react/no-forward-ref": "warn",
92
+ "react/no-implicit-key": "warn",
93
+ "react/no-missing-key": "error",
94
+ "react/no-nested-components": "error",
95
+ "react/no-prop-types": "error",
96
+ "react/no-redundant-should-component-update": "error",
97
+ "react/no-set-state-in-component-did-mount": "warn",
98
+ "react/no-set-state-in-component-did-update": "warn",
99
+ "react/no-set-state-in-component-will-update": "warn",
100
+ "react/no-string-refs": "error",
101
+ "react/no-unsafe-component-will-mount": "warn",
102
+ "react/no-unsafe-component-will-receive-props": "warn",
103
+ "react/no-unsafe-component-will-update": "warn",
104
+ "react/no-unstable-context-value": "warn",
105
+ "react/no-unstable-default-props": "warn",
106
+ "react/no-unused-class-component-members": "warn",
107
+ "react/no-unused-state": "warn",
108
+ "react/prefer-destructuring-assignment": "warn",
109
+ "react/prefer-shorthand-boolean": "warn",
110
+ "react/prefer-shorthand-fragment": "warn",
111
+ "react/jsx-key": "error",
112
+ "react/jsx-no-target-blank": "warn",
113
+ "react/no-danger": "warn",
114
+ "react/no-unknown-property": "error"
115
+ },
116
+ settings: {
117
+ react: {
118
+ version: options.version || "detect"
119
+ }
120
+ }
12
121
  },
13
- settings: {
14
- react: {
15
- version: options.version || "detect"
122
+ {
123
+ jsPlugins: ["eslint-plugin-react-compiler"],
124
+ rules: {
125
+ "react-compiler/react-compiler": "error"
16
126
  }
17
- }
18
- };
127
+ },
128
+ ...typeAware ? [
129
+ {
130
+ rules: {
131
+ ...typeAwareRules
132
+ }
133
+ }
134
+ ] : []
135
+ ];
19
136
  }
20
137
 
21
138
  exports.react = react;
@@ -1,5 +1,5 @@
1
1
  import { OptionsReact, TypedConfigItem } from '../types.cjs';
2
2
 
3
- declare function react(options?: OptionsReact): TypedConfigItem;
3
+ declare function react(options?: OptionsReact): TypedConfigItem[];
4
4
 
5
5
  export { react };
@@ -1,5 +1,5 @@
1
1
  import { OptionsReact, TypedConfigItem } from '../types.js';
2
2
 
3
- declare function react(options?: OptionsReact): TypedConfigItem;
3
+ declare function react(options?: OptionsReact): TypedConfigItem[];
4
4
 
5
5
  export { react };
@@ -1 +1 @@
1
- export { react } from '../chunk-7WK2CHER.js';
1
+ export { react } from '../chunk-OPIMNRNA.js';