@elliemae/pui-cli 8.62.1 → 9.0.0-alpha.2
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 +33 -0
- package/dist/cjs/commands/test.js +0 -1
- package/dist/cjs/commands/utils.js +4 -4
- package/dist/cjs/commands/vitest.js +0 -1
- package/dist/cjs/index.cjs +12 -0
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/lint-config/eslint/common.cjs +1 -1
- package/dist/cjs/lint-config/eslint/flat/common.mjs +167 -0
- package/dist/cjs/lint-config/eslint/flat/index.mjs +20 -0
- package/dist/cjs/lint-config/eslint/flat/non-react-export.mjs +10 -0
- package/dist/cjs/lint-config/eslint/flat/non-react.mjs +6 -0
- package/dist/cjs/lint-config/eslint/flat/presets.mjs +78 -0
- package/dist/cjs/lint-config/eslint/flat/react-export.mjs +7 -0
- package/dist/cjs/lint-config/eslint/flat/react.mjs +60 -0
- package/dist/cjs/lint-config/eslint/flat/rules.mjs +185 -0
- package/dist/cjs/lint-config/eslint/typescript/non-react.cjs +1 -1
- package/dist/cjs/lint-config/eslint/typescript/react.cjs +1 -1
- package/dist/cjs/monorepo/utils.cjs +2 -2
- package/dist/cjs/monorepo/utils.js +1 -1
- package/dist/cjs/testing/jest.config.cjs +5 -9
- package/dist/cjs/testing/resolver.cjs +1 -1
- package/dist/cjs/testing/setup-react-env.js +1 -1
- package/dist/cjs/transpile/esbuild.js +1 -1
- package/dist/cjs/webpack/csp-plugin.js +2 -4
- package/dist/cjs/webpack/prop-types-shim.js +0 -1
- package/dist/cjs/webpack/webpack.lib.base.babel.js +0 -8
- package/dist/esm/commands/test.js +0 -1
- package/dist/esm/commands/utils.js +4 -4
- package/dist/esm/commands/vitest.js +0 -1
- package/dist/esm/index.cjs +12 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/lint-config/eslint/common.cjs +1 -1
- package/dist/esm/lint-config/eslint/flat/common.mjs +167 -0
- package/dist/esm/lint-config/eslint/flat/index.mjs +20 -0
- package/dist/esm/lint-config/eslint/flat/non-react-export.mjs +10 -0
- package/dist/esm/lint-config/eslint/flat/non-react.mjs +6 -0
- package/dist/esm/lint-config/eslint/flat/presets.mjs +78 -0
- package/dist/esm/lint-config/eslint/flat/react-export.mjs +7 -0
- package/dist/esm/lint-config/eslint/flat/react.mjs +60 -0
- package/dist/esm/lint-config/eslint/flat/rules.mjs +185 -0
- package/dist/esm/lint-config/eslint/typescript/non-react.cjs +1 -1
- package/dist/esm/lint-config/eslint/typescript/react.cjs +1 -1
- package/dist/esm/monorepo/utils.cjs +2 -2
- package/dist/esm/monorepo/utils.js +1 -1
- package/dist/esm/testing/jest.config.cjs +5 -9
- package/dist/esm/testing/resolver.cjs +1 -1
- package/dist/esm/testing/setup-react-env.js +1 -1
- package/dist/esm/transpile/esbuild.js +1 -1
- package/dist/esm/webpack/csp-plugin.js +2 -4
- package/dist/esm/webpack/prop-types-shim.js +0 -1
- package/dist/esm/webpack/webpack.lib.base.babel.js +0 -8
- package/dist/types/docusaurus.config.d.ts +3 -2
- package/dist/types/lib/commands/build.d.ts +1 -1
- package/dist/types/lib/commands/buildcdn.d.ts +1 -1
- package/dist/types/lib/commands/codemod.d.ts +1 -1
- package/dist/types/lib/commands/gendoc.d.ts +1 -1
- package/dist/types/lib/commands/lint.d.ts +1 -1
- package/dist/types/lib/commands/pack.d.ts +1 -1
- package/dist/types/lib/commands/start.d.ts +1 -1
- package/dist/types/lib/commands/storybook.d.ts +1 -1
- package/dist/types/lib/commands/test.d.ts +1 -1
- package/dist/types/lib/commands/tscheck.d.ts +1 -1
- package/dist/types/lib/commands/version.d.ts +1 -1
- package/dist/types/lib/commands/vitest.d.ts +1 -1
- package/dist/types/lib/index.d.cts +5 -1
- package/dist/types/lib/index.d.ts +4 -0
- package/dist/types/lib/lint-config/eslint/flat/common.d.mts +6 -0
- package/dist/types/lib/lint-config/eslint/flat/index.d.mts +6 -0
- package/dist/types/lib/lint-config/eslint/flat/non-react-export.d.mts +4 -0
- package/dist/types/lib/lint-config/eslint/flat/non-react.d.mts +3 -0
- package/dist/types/lib/lint-config/eslint/flat/presets.d.mts +63 -0
- package/dist/types/lib/lint-config/eslint/flat/react-export.d.mts +4 -0
- package/dist/types/lib/lint-config/eslint/flat/react.d.mts +4 -0
- package/dist/types/lib/lint-config/eslint/flat/rules.d.mts +358 -0
- package/dist/types/lib/server/appRoutes.d.ts +1 -1
- package/dist/types/lib/server/csp.d.ts +1 -1
- package/dist/types/lib/server/middlewares.d.ts +1 -1
- package/dist/types/lib/webpack/csp-plugin.d.ts +3 -3
- package/dist/types/lib/webpack/helpers.d.ts +1 -1
- package/dist/types/lib/webpack/interceptor-middleware.d.ts +2 -2
- package/dist/types/lib/webpack/webpack.base.babel.d.ts +1 -1
- package/dist/types/lib/webpack/webpack.lib.base.babel.d.ts +1 -1
- package/dist/types/lib/webpack/webpack.lib.prod.babel.d.ts +1 -1
- package/dist/types/lib/webpack/webpack.prod.babel.d.ts +1 -1
- package/dist/types/lib/webpack/webpack.storybook.d.ts +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/lib/lint-config/commitlint.config.cjs +1 -0
- package/lib/lint-config/eslint/common.cjs +164 -0
- package/lib/lint-config/eslint/flat/common.mjs +167 -0
- package/lib/lint-config/eslint/flat/index.mjs +20 -0
- package/lib/lint-config/eslint/flat/non-react-export.mjs +10 -0
- package/lib/lint-config/eslint/flat/non-react.mjs +6 -0
- package/lib/lint-config/eslint/flat/presets.mjs +78 -0
- package/lib/lint-config/eslint/flat/react-export.mjs +7 -0
- package/lib/lint-config/eslint/flat/react.mjs +60 -0
- package/lib/lint-config/eslint/flat/rules.mjs +185 -0
- package/lib/lint-config/eslint/non-react.cjs +14 -0
- package/lib/lint-config/eslint/react.cjs +26 -0
- package/lib/lint-config/eslint/typescript/common.cjs +49 -0
- package/lib/lint-config/eslint/typescript/non-react.cjs +12 -0
- package/lib/lint-config/eslint/typescript/react.cjs +19 -0
- package/lib/lint-config/lint-staged.config.js +15 -0
- package/lib/lint-config/prettier.config.cjs +8 -0
- package/lib/lint-config/stylelint.config.cjs +19 -0
- package/package.json +35 -28
- package/dist/cjs/testing/setup-env.js +0 -8
- package/dist/esm/testing/setup-env.js +0 -7
- package/dist/types/lib/testing/setup-env.d.ts +0 -1
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/** Shared rule sets migrated from legacy eslintrc (common.cjs + typescript/*.cjs). */
|
|
2
|
+
|
|
3
|
+
export const baseRules = {
|
|
4
|
+
'arrow-body-style': ['error', 'as-needed'],
|
|
5
|
+
'class-methods-use-this': 'off',
|
|
6
|
+
'import-x/imports-first': 'off',
|
|
7
|
+
'import-x/newline-after-import': 'off',
|
|
8
|
+
'import-x/no-dynamic-require': 'off',
|
|
9
|
+
'import-x/no-extraneous-dependencies': [
|
|
10
|
+
'error',
|
|
11
|
+
{
|
|
12
|
+
devDependencies: [
|
|
13
|
+
'**/*.{test,spec,stories}.{js,jsx,ts,tsx}',
|
|
14
|
+
'**/.storybook/**',
|
|
15
|
+
'**/eslint.config.{mjs,cjs,js}',
|
|
16
|
+
'**/*.{config,conf}.{ts,js,cjs,mjs}',
|
|
17
|
+
'**/scripts/**',
|
|
18
|
+
'**/ci_cd/**',
|
|
19
|
+
'**/lint-config/**',
|
|
20
|
+
'**/lib/testing/**',
|
|
21
|
+
'**/lib/transpile/**',
|
|
22
|
+
'**/mocks/**',
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
'import-x/no-named-as-default': 'off',
|
|
27
|
+
'import-x/no-unresolved': [
|
|
28
|
+
'error',
|
|
29
|
+
{ caseSensitive: true, caseSensitiveStrict: true },
|
|
30
|
+
],
|
|
31
|
+
'import-x/no-webpack-loader-syntax': 'off',
|
|
32
|
+
'import-x/prefer-default-export': 'off',
|
|
33
|
+
'import-x/default': 'off',
|
|
34
|
+
'import-x/namespace': 'off',
|
|
35
|
+
'import-x/extensions': [
|
|
36
|
+
'error',
|
|
37
|
+
'never',
|
|
38
|
+
{
|
|
39
|
+
json: 'ignorePackages',
|
|
40
|
+
js: 'ignorePackages',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
complexity: ['error', { max: 10 }],
|
|
44
|
+
'max-depth': ['error', { max: 4 }],
|
|
45
|
+
'max-lines-per-function': 'off',
|
|
46
|
+
'max-nested-callbacks': ['error', { max: 3 }],
|
|
47
|
+
'max-params': ['error', { max: 3 }],
|
|
48
|
+
'max-statements': ['error', { max: 20 }],
|
|
49
|
+
'max-len': 'off',
|
|
50
|
+
'newline-per-chained-call': 'off',
|
|
51
|
+
'no-confusing-arrow': 'off',
|
|
52
|
+
'no-console': 'warn',
|
|
53
|
+
'no-param-reassign': ['error', { props: false }],
|
|
54
|
+
'prefer-template': 'error',
|
|
55
|
+
'require-yield': 'off',
|
|
56
|
+
'eslint-comments/disable-enable-pair': 'off',
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** Relaxed type-checked rules for test files (shared by default and strict configs). */
|
|
60
|
+
export const typescriptTestRelaxedRules = {
|
|
61
|
+
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
62
|
+
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
63
|
+
'@typescript-eslint/no-unsafe-call': 'off',
|
|
64
|
+
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
65
|
+
'@typescript-eslint/no-unsafe-return': 'off',
|
|
66
|
+
'@typescript-eslint/unbound-method': 'off',
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const jsRules = {
|
|
70
|
+
...baseRules,
|
|
71
|
+
'max-lines': ['error', { max: 120, skipComments: true }],
|
|
72
|
+
'no-unused-vars': 'error',
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const typescriptRules = {
|
|
76
|
+
...baseRules,
|
|
77
|
+
'max-lines': ['error', { max: 200, skipComments: true }],
|
|
78
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
79
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
80
|
+
'@typescript-eslint/no-use-before-define': [
|
|
81
|
+
'error',
|
|
82
|
+
{ functions: false, classes: true, variables: true, typedefs: true },
|
|
83
|
+
],
|
|
84
|
+
'@typescript-eslint/unbound-method': ['error', { ignoreStatic: true }],
|
|
85
|
+
'@typescript-eslint/no-floating-promises': ['error', { ignoreIIFE: true }],
|
|
86
|
+
'@typescript-eslint/no-misused-promises': [
|
|
87
|
+
'error',
|
|
88
|
+
{ checksVoidReturn: { attributes: false } },
|
|
89
|
+
],
|
|
90
|
+
'@typescript-eslint/no-unsafe-assignment': 'warn',
|
|
91
|
+
'@typescript-eslint/no-unsafe-member-access': 'warn',
|
|
92
|
+
'@typescript-eslint/no-unsafe-call': 'warn',
|
|
93
|
+
'@typescript-eslint/no-unsafe-argument': 'warn',
|
|
94
|
+
'@typescript-eslint/no-unsafe-return': 'warn',
|
|
95
|
+
'@typescript-eslint/consistent-type-imports': [
|
|
96
|
+
'error',
|
|
97
|
+
{ prefer: 'type-imports', fixStyle: 'inline-type-imports' },
|
|
98
|
+
],
|
|
99
|
+
'@typescript-eslint/no-import-type-side-effects': 'error',
|
|
100
|
+
'no-unused-vars': 'off',
|
|
101
|
+
'@typescript-eslint/no-unused-vars': [
|
|
102
|
+
'error',
|
|
103
|
+
{ argsIgnorePattern: '^_', ignoreRestSiblings: true },
|
|
104
|
+
],
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/** Stricter TypeScript rules (error on unsafe any usage). */
|
|
108
|
+
export const typescriptStrictRules = {
|
|
109
|
+
...typescriptRules,
|
|
110
|
+
'@typescript-eslint/no-unsafe-assignment': 'error',
|
|
111
|
+
'@typescript-eslint/no-unsafe-member-access': 'error',
|
|
112
|
+
'@typescript-eslint/no-unsafe-call': 'error',
|
|
113
|
+
'@typescript-eslint/no-unsafe-argument': 'error',
|
|
114
|
+
'@typescript-eslint/no-unsafe-return': 'error',
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export const reactRules = {
|
|
118
|
+
'jsx-a11y/aria-props': 'error',
|
|
119
|
+
'jsx-a11y/heading-has-content': 'off',
|
|
120
|
+
'jsx-a11y/label-has-associated-control': [
|
|
121
|
+
'error',
|
|
122
|
+
{
|
|
123
|
+
controlComponents: ['Input'],
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
'jsx-a11y/label-has-for': 'off',
|
|
127
|
+
'jsx-a11y/mouse-events-have-key-events': 'error',
|
|
128
|
+
'jsx-a11y/role-has-required-aria-props': 'error',
|
|
129
|
+
'jsx-a11y/role-supports-aria-props': 'error',
|
|
130
|
+
'react/destructuring-assignment': 'off',
|
|
131
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
132
|
+
'react-hooks/exhaustive-deps': 'warn',
|
|
133
|
+
'react/jsx-closing-tag-location': 'off',
|
|
134
|
+
'react/forbid-prop-types': 'off',
|
|
135
|
+
'react/jsx-first-prop-new-line': ['error', 'multiline'],
|
|
136
|
+
'react/jsx-no-target-blank': 'off',
|
|
137
|
+
'react/jsx-props-no-spreading': 'off',
|
|
138
|
+
'react/jsx-uses-vars': 'error',
|
|
139
|
+
'react/require-default-props': 'off',
|
|
140
|
+
'react/require-extension': 'off',
|
|
141
|
+
'react/self-closing-comp': 'off',
|
|
142
|
+
'react/sort-comp': 'off',
|
|
143
|
+
'react/react-in-jsx-scope': 'off',
|
|
144
|
+
'react/jsx-filename-extension': [
|
|
145
|
+
'warn',
|
|
146
|
+
{ extensions: ['.js', '.jsx', '.tsx', '.mdx'] },
|
|
147
|
+
],
|
|
148
|
+
'react/function-component-definition': [
|
|
149
|
+
'error',
|
|
150
|
+
{ namedComponents: 'arrow-function' },
|
|
151
|
+
],
|
|
152
|
+
'react/prop-types': 'off',
|
|
153
|
+
'redux-saga/no-yield-in-race': 'error',
|
|
154
|
+
'redux-saga/yield-effects': 'error',
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
/** Stricter React rules (exhaustive-deps as error). */
|
|
158
|
+
export const reactStrictRules = {
|
|
159
|
+
...reactRules,
|
|
160
|
+
'react-hooks/exhaustive-deps': 'error',
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export const ignorePatterns = [
|
|
164
|
+
'**/build/**',
|
|
165
|
+
'**/node_modules/**',
|
|
166
|
+
'**/dist/**',
|
|
167
|
+
'**/reports/**',
|
|
168
|
+
'**/allure-report/**',
|
|
169
|
+
'**/coverage/**',
|
|
170
|
+
'**/demo/**',
|
|
171
|
+
'**/docs/**',
|
|
172
|
+
'**/docs/api/**',
|
|
173
|
+
'**/temp/**',
|
|
174
|
+
'**/.tmp/**',
|
|
175
|
+
'**/public/**',
|
|
176
|
+
'**/webroot/**',
|
|
177
|
+
'**/cdn/**',
|
|
178
|
+
'**/.docusaurus/**',
|
|
179
|
+
'**/vendor/*.js',
|
|
180
|
+
'**/.nx/**',
|
|
181
|
+
'**/pnpm-lock.yaml',
|
|
182
|
+
'**/.scannerwork/**',
|
|
183
|
+
'**/stats.json',
|
|
184
|
+
'**/jsconfig.json',
|
|
185
|
+
];
|
|
@@ -6,13 +6,13 @@ const WORKSPACE_MANIFEST_FILENAME = 'pnpm-workspace.yaml';
|
|
|
6
6
|
|
|
7
7
|
const getPNPMWorkspaceLocation = (cwd) => {
|
|
8
8
|
let location = null;
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
for (const fileName of [WORKSPACE_MANIFEST_FILENAME, 'pnpm-workspace.yml']) {
|
|
11
11
|
try {
|
|
12
12
|
const result = execSync(`npx find-up ${fileName}`, { cwd });
|
|
13
13
|
location = result.toString().trim();
|
|
14
14
|
break;
|
|
15
|
-
} catch
|
|
15
|
+
} catch {
|
|
16
16
|
// ignore
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -6,11 +6,11 @@ const { findMonoRepoRoot } = require('../monorepo/utils.cjs');
|
|
|
6
6
|
|
|
7
7
|
let isReactModule = true;
|
|
8
8
|
try {
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
require('react');
|
|
11
11
|
require('styled-components');
|
|
12
|
-
|
|
13
|
-
} catch
|
|
12
|
+
|
|
13
|
+
} catch {
|
|
14
14
|
isReactModule = false;
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -80,11 +80,7 @@ const jestConfig = {
|
|
|
80
80
|
},
|
|
81
81
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
|
82
82
|
setupFilesAfterEnv: [path.resolve(__dirname, './setup-tests.js')],
|
|
83
|
-
setupFiles: [
|
|
84
|
-
path.resolve(__dirname, './setup-env.js'),
|
|
85
|
-
'raf/polyfill',
|
|
86
|
-
'whatwg-fetch',
|
|
87
|
-
],
|
|
83
|
+
setupFiles: ['raf/polyfill', 'whatwg-fetch'],
|
|
88
84
|
testRegex: '(app|lib).*/tests/.*\\.test\\.[jt]sx?$',
|
|
89
85
|
snapshotSerializers: [],
|
|
90
86
|
testResultsProcessor: 'jest-sonar-reporter',
|
|
@@ -93,7 +89,7 @@ const jestConfig = {
|
|
|
93
89
|
'^.+\\.[jt]sx?$': ['@swc/jest', swcrcConfig],
|
|
94
90
|
},
|
|
95
91
|
transformIgnorePatterns: [
|
|
96
|
-
// eslint-disable-next-line
|
|
92
|
+
// eslint-disable-next-line no-useless-escape
|
|
97
93
|
'/node_modules/(?!(\@elliemae\/pui-cli|lodash-es|react-select|react-dates|d3|internmap|delaunator|robust-predicates))/',
|
|
98
94
|
],
|
|
99
95
|
globals: {
|
|
@@ -32,7 +32,7 @@ module.exports = (request, options) => {
|
|
|
32
32
|
}
|
|
33
33
|
const resolution = resolutions.find(({ matcher }) => matcher.test(request));
|
|
34
34
|
if (resolution) {
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
for (const extension of resolution.extensions) {
|
|
37
37
|
try {
|
|
38
38
|
return resolver(
|
|
@@ -30,7 +30,7 @@ const copyFiles = async ({ srcdir, outdir }) => {
|
|
|
30
30
|
const files = await fg([
|
|
31
31
|
`${srcdir}/**/*.*`,
|
|
32
32
|
`${srcdir}/**/.swcrc`,
|
|
33
|
-
`!${srcdir}/**/*.{js,jsx,ts,tsx
|
|
33
|
+
`!${srcdir}/**/*.{js,jsx,ts,tsx}`
|
|
34
34
|
]);
|
|
35
35
|
await Promise.all(
|
|
36
36
|
files.map(async (srcFilePath) => {
|
|
@@ -5,14 +5,12 @@ const defaultOptions = {
|
|
|
5
5
|
};
|
|
6
6
|
class CspPlugin {
|
|
7
7
|
#options = defaultOptions;
|
|
8
|
-
#htmlWebpackPlugin;
|
|
9
8
|
/**
|
|
10
9
|
*
|
|
11
|
-
* @param
|
|
10
|
+
* @param _htmlWebpackPlugin
|
|
12
11
|
* @param {object} options Additional options for this module.
|
|
13
12
|
*/
|
|
14
|
-
constructor(
|
|
15
|
-
this.#htmlWebpackPlugin = htmlWebpackPlugin;
|
|
13
|
+
constructor(_htmlWebpackPlugin, options) {
|
|
16
14
|
this.#options = { ...this.#options, ...options ?? {} };
|
|
17
15
|
}
|
|
18
16
|
/**
|
|
@@ -41,13 +41,11 @@ const plugins = [
|
|
|
41
41
|
new webpack.DefinePlugin({
|
|
42
42
|
APP_CONFIG: getAppConfig()
|
|
43
43
|
}),
|
|
44
|
-
/* eslint-disable indent */
|
|
45
44
|
...copyPluginPatterns.length > 0 ? [
|
|
46
45
|
new CopyWebpackPlugin({
|
|
47
46
|
patterns: copyPluginPatterns
|
|
48
47
|
})
|
|
49
48
|
] : [],
|
|
50
|
-
/* eslint-enable indent */
|
|
51
49
|
new webpack.optimize.LimitChunkCountPlugin({
|
|
52
50
|
maxChunks: 1
|
|
53
51
|
}),
|
|
@@ -69,7 +67,6 @@ const baseConfig = (options) => ({
|
|
|
69
67
|
// Merge with env dependent settings
|
|
70
68
|
optimization: options.optimization,
|
|
71
69
|
module: {
|
|
72
|
-
/* eslint-disable indent */
|
|
73
70
|
...process.env.KEEP_IMPORT_META === "true" ? {
|
|
74
71
|
parser: {
|
|
75
72
|
javascript: {
|
|
@@ -77,7 +74,6 @@ const baseConfig = (options) => ({
|
|
|
77
74
|
}
|
|
78
75
|
}
|
|
79
76
|
} : {},
|
|
80
|
-
/* eslint-enable indent */
|
|
81
77
|
rules: [
|
|
82
78
|
{
|
|
83
79
|
test: /^(?!.*\.exec\.js$).*\.jsx?$/,
|
|
@@ -90,13 +86,11 @@ const baseConfig = (options) => ({
|
|
|
90
86
|
loader: "esbuild-loader",
|
|
91
87
|
options: {
|
|
92
88
|
target: browserslistToEsbuild(),
|
|
93
|
-
/* eslint-disable indent */
|
|
94
89
|
...process.env.KEEP_IMPORT_META === "true" ? {
|
|
95
90
|
supported: {
|
|
96
91
|
"import-meta": true
|
|
97
92
|
}
|
|
98
93
|
} : {}
|
|
99
|
-
/* eslint-enable indent */
|
|
100
94
|
}
|
|
101
95
|
}
|
|
102
96
|
},
|
|
@@ -111,13 +105,11 @@ const baseConfig = (options) => ({
|
|
|
111
105
|
loader: "esbuild-loader",
|
|
112
106
|
options: {
|
|
113
107
|
target: browserslistToEsbuild(),
|
|
114
|
-
/* eslint-disable indent */
|
|
115
108
|
...process.env.KEEP_IMPORT_META === "true" ? {
|
|
116
109
|
supported: {
|
|
117
110
|
"import-meta": true
|
|
118
111
|
}
|
|
119
112
|
} : {}
|
|
120
|
-
/* eslint-enable indent */
|
|
121
113
|
}
|
|
122
114
|
}
|
|
123
115
|
},
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { Config } from '@docusaurus/types';
|
|
2
|
+
declare const config: Config;
|
|
3
|
+
export default config;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CommandModule } from 'yargs';
|
|
1
|
+
import { type CommandModule } from 'yargs';
|
|
2
2
|
export declare const buildCDNCmd: CommandModule<Record<string, never>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CommandModule } from 'yargs';
|
|
1
|
+
import { type CommandModule } from 'yargs';
|
|
2
2
|
export declare const gendocCmd: CommandModule<Record<string, never>, Record<string, never>>;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { babelConfig } from "./babel.config.cjs";
|
|
2
|
+
import { eslintFlatBaseConfig } from "./lint-config/eslint/flat/non-react-export.mjs";
|
|
3
|
+
import { eslintFlatBaseConfigStrict } from "./lint-config/eslint/flat/non-react-export.mjs";
|
|
4
|
+
import { eslintFlatConfig } from "./lint-config/eslint/flat/react-export.mjs";
|
|
5
|
+
import { eslintFlatConfigStrict } from "./lint-config/eslint/flat/react-export.mjs";
|
|
2
6
|
import { esConfig as eslintBaseConfig } from "./lint-config/eslint/non-react.cjs";
|
|
3
7
|
import { esReactConfig as eslintConfig } from "./lint-config/eslint/react.cjs";
|
|
4
8
|
import { stylelintConfig } from "./lint-config/stylelint.config.cjs";
|
|
@@ -6,4 +10,4 @@ import { prettierConfig } from "./lint-config/prettier.config.cjs";
|
|
|
6
10
|
import { commitlintConfig } from "./lint-config/commitlint.config.cjs";
|
|
7
11
|
import { jestConfig } from "./testing/jest.config.cjs";
|
|
8
12
|
import { jestNodeConfig } from "./testing/jest.node.config.cjs";
|
|
9
|
-
export { babelConfig, eslintBaseConfig, eslintConfig, stylelintConfig, prettierConfig, commitlintConfig, jestConfig, jestNodeConfig };
|
|
13
|
+
export { babelConfig, eslintFlatBaseConfig, eslintFlatBaseConfigStrict, eslintFlatConfig, eslintFlatConfigStrict, eslintBaseConfig, eslintConfig, stylelintConfig, prettierConfig, commitlintConfig, jestConfig, jestNodeConfig };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export type LIB_NAME = 'pui-cli';
|
|
2
2
|
export { babelConfig } from './babel.config.cjs';
|
|
3
|
+
export { eslintFlatBaseConfig, eslintFlatBaseConfigStrict, } from './lint-config/eslint/flat/non-react-export.mjs';
|
|
4
|
+
export { eslintFlatConfig, eslintFlatConfigStrict, } from './lint-config/eslint/flat/react-export.mjs';
|
|
5
|
+
/** @deprecated Use eslintFlatBaseConfig in eslint.config.mjs */
|
|
3
6
|
export { esConfig as eslintBaseConfig } from './lint-config/eslint/non-react.cjs';
|
|
7
|
+
/** @deprecated Use eslintFlatConfig in eslint.config.mjs */
|
|
4
8
|
export { esReactConfig as eslintConfig } from './lint-config/eslint/react.cjs';
|
|
5
9
|
export { stylelintConfig } from './lint-config/stylelint.config.cjs';
|
|
6
10
|
export { prettierConfig } from './lint-config/prettier.config.cjs';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** @param {Record<string, unknown>} tsRules - `typescriptRules` or `typescriptStrictRules` */
|
|
2
|
+
export function createBaseFlatConfigs(tsRules: Record<string, unknown>): any;
|
|
3
|
+
/** Default flat base — `no-unsafe-*` as warn in application TypeScript. */
|
|
4
|
+
export const baseFlatConfigs: any;
|
|
5
|
+
/** Strict flat base — `no-unsafe-*` as error in application TypeScript. */
|
|
6
|
+
export const baseFlatConfigsStrict: any;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { eslintFlatConfig, eslintFlatConfigStrict } from "./react-export.mjs";
|
|
2
|
+
export { eslintFlatBaseConfig, eslintFlatBaseConfigStrict } from "./non-react-export.mjs";
|
|
3
|
+
export { reactFlatConfigs, reactFlatConfigsStrict } from "./react.mjs";
|
|
4
|
+
export { nonReactFlatConfigs, nonReactFlatConfigsStrict } from "./non-react.mjs";
|
|
5
|
+
export { baseFlatConfigs, baseFlatConfigsStrict, createBaseFlatConfigs } from "./common.mjs";
|
|
6
|
+
export { storybookFiles, testFiles, testJsxFiles } from "./presets.mjs";
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export const testFiles: string[];
|
|
2
|
+
export const testJsxFiles: string[];
|
|
3
|
+
export const wdioSpecFiles: string[];
|
|
4
|
+
export const storybookFiles: string[];
|
|
5
|
+
/** @type {import('eslint').Linter.RulesRecord} */
|
|
6
|
+
export const sharedCoreRules: import("eslint").Linter.RulesRecord;
|
|
7
|
+
/** @type {import('eslint').Linter.RulesRecord} */
|
|
8
|
+
export const jestRecommendedRules: import("eslint").Linter.RulesRecord;
|
|
9
|
+
/** @type {import('eslint').Linter.RulesRecord} */
|
|
10
|
+
export const testingLibraryDomRules: import("eslint").Linter.RulesRecord;
|
|
11
|
+
/** @type {import('eslint').Linter.RulesRecord} */
|
|
12
|
+
export const testingLibraryReactRules: import("eslint").Linter.RulesRecord;
|
|
13
|
+
/** @type {import('eslint').Linter.RulesRecord} */
|
|
14
|
+
export const reactPresetRules: import("eslint").Linter.RulesRecord;
|
|
15
|
+
/** @type {import('eslint').Linter.RulesRecord} */
|
|
16
|
+
export const wdioRecommendedRules: import("eslint").Linter.RulesRecord;
|
|
17
|
+
/** @type {Record<string, boolean>} */
|
|
18
|
+
export const wdioGlobals: Record<string, boolean>;
|
|
19
|
+
/** Normalized once — Storybook flat config may be array or single object. */
|
|
20
|
+
export const storybookFlatConfigs: ({
|
|
21
|
+
name: string;
|
|
22
|
+
plugins: {
|
|
23
|
+
readonly storybook: any;
|
|
24
|
+
};
|
|
25
|
+
files?: undefined;
|
|
26
|
+
rules?: undefined;
|
|
27
|
+
} | {
|
|
28
|
+
name: string;
|
|
29
|
+
files: string[];
|
|
30
|
+
rules: {
|
|
31
|
+
readonly "react-hooks/rules-of-hooks": "off";
|
|
32
|
+
readonly "import/no-anonymous-default-export": "off";
|
|
33
|
+
readonly "storybook/await-interactions": "error";
|
|
34
|
+
readonly "storybook/context-in-play-function": "error";
|
|
35
|
+
readonly "storybook/default-exports": "error";
|
|
36
|
+
readonly "storybook/hierarchy-separator": "warn";
|
|
37
|
+
readonly "storybook/no-redundant-story-name": "warn";
|
|
38
|
+
readonly "storybook/prefer-pascal-case": "warn";
|
|
39
|
+
readonly "storybook/story-exports": "error";
|
|
40
|
+
readonly "storybook/use-storybook-expect": "error";
|
|
41
|
+
readonly "storybook/use-storybook-testing-library": "error";
|
|
42
|
+
readonly "storybook/no-uninstalled-addons"?: undefined;
|
|
43
|
+
};
|
|
44
|
+
plugins?: undefined;
|
|
45
|
+
} | {
|
|
46
|
+
name: string;
|
|
47
|
+
files: string[];
|
|
48
|
+
rules: {
|
|
49
|
+
readonly "storybook/no-uninstalled-addons": "error";
|
|
50
|
+
readonly "react-hooks/rules-of-hooks"?: undefined;
|
|
51
|
+
readonly "import/no-anonymous-default-export"?: undefined;
|
|
52
|
+
readonly "storybook/await-interactions"?: undefined;
|
|
53
|
+
readonly "storybook/context-in-play-function"?: undefined;
|
|
54
|
+
readonly "storybook/default-exports"?: undefined;
|
|
55
|
+
readonly "storybook/hierarchy-separator"?: undefined;
|
|
56
|
+
readonly "storybook/no-redundant-story-name"?: undefined;
|
|
57
|
+
readonly "storybook/prefer-pascal-case"?: undefined;
|
|
58
|
+
readonly "storybook/story-exports"?: undefined;
|
|
59
|
+
readonly "storybook/use-storybook-expect"?: undefined;
|
|
60
|
+
readonly "storybook/use-storybook-testing-library"?: undefined;
|
|
61
|
+
};
|
|
62
|
+
plugins?: undefined;
|
|
63
|
+
})[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Flat ESLint config for React + TypeScript PUI apps. */
|
|
2
|
+
export const eslintFlatConfig: import("eslint/config").Config[];
|
|
3
|
+
/** Strict flat ESLint config for React + TypeScript (errors on `no-unsafe-*` and `exhaustive-deps`). */
|
|
4
|
+
export const eslintFlatConfigStrict: import("eslint/config").Config[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Default React flat config — migration-friendly type-safety warnings. */
|
|
2
|
+
export const reactFlatConfigs: import("eslint/config").Config[];
|
|
3
|
+
/** Strict React flat config — `no-unsafe-*` and `exhaustive-deps` as error. */
|
|
4
|
+
export const reactFlatConfigsStrict: import("eslint/config").Config[];
|