@elliemae/pui-cli 8.29.1 → 8.29.3

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.
Files changed (55) hide show
  1. package/dist/cjs/babel.config.cjs +97 -0
  2. package/dist/cjs/commands/utils.js +1 -1
  3. package/dist/cjs/index.cjs +23 -0
  4. package/dist/cjs/jsdoc.conf.json +17 -0
  5. package/dist/cjs/lint-config/commitlint.config.cjs +1 -0
  6. package/dist/cjs/lint-config/eslint/common.cjs +164 -0
  7. package/dist/cjs/lint-config/eslint/non-react.cjs +14 -0
  8. package/dist/cjs/lint-config/eslint/react.cjs +26 -0
  9. package/dist/cjs/lint-config/eslint/typescript/common.cjs +49 -0
  10. package/dist/cjs/lint-config/eslint/typescript/non-react.cjs +12 -0
  11. package/dist/cjs/lint-config/eslint/typescript/react.cjs +19 -0
  12. package/dist/cjs/lint-config/prettier.config.cjs +8 -0
  13. package/dist/cjs/lint-config/stylelint.config.cjs +20 -0
  14. package/dist/cjs/monorepo/set-registry-version.js +3 -3
  15. package/dist/cjs/monorepo/set-workspace-version.js +3 -3
  16. package/dist/cjs/monorepo/utils.cjs +30 -0
  17. package/dist/cjs/release.config.cjs +24 -0
  18. package/dist/cjs/testing/jest.config.cjs +110 -0
  19. package/dist/cjs/testing/jest.node.config.cjs +8 -0
  20. package/dist/cjs/testing/resolver.cjs +47 -0
  21. package/dist/cjs/transpile/.swcrc +11 -0
  22. package/dist/cjs/transpile/esbuild.js +3 -3
  23. package/dist/cjs/transpile/swcrc.config.cjs +13 -0
  24. package/dist/cjs/typedoc.cjs +12 -0
  25. package/dist/cjs/utils.cjs +23 -0
  26. package/dist/cjs/webpack/webpack.lib.dev.babel.js +1 -1
  27. package/dist/cjs/webpack/webpack.lib.prod.babel.js +1 -1
  28. package/dist/esm/babel.config.cjs +97 -0
  29. package/dist/esm/commands/utils.js +1 -1
  30. package/dist/esm/index.cjs +23 -0
  31. package/dist/esm/jsdoc.conf.json +17 -0
  32. package/dist/esm/lint-config/commitlint.config.cjs +1 -0
  33. package/dist/esm/lint-config/eslint/common.cjs +164 -0
  34. package/dist/esm/lint-config/eslint/non-react.cjs +14 -0
  35. package/dist/esm/lint-config/eslint/react.cjs +26 -0
  36. package/dist/esm/lint-config/eslint/typescript/common.cjs +49 -0
  37. package/dist/esm/lint-config/eslint/typescript/non-react.cjs +12 -0
  38. package/dist/esm/lint-config/eslint/typescript/react.cjs +19 -0
  39. package/dist/esm/lint-config/prettier.config.cjs +8 -0
  40. package/dist/esm/lint-config/stylelint.config.cjs +20 -0
  41. package/dist/esm/monorepo/set-registry-version.js +3 -3
  42. package/dist/esm/monorepo/set-workspace-version.js +3 -3
  43. package/dist/esm/monorepo/utils.cjs +30 -0
  44. package/dist/esm/release.config.cjs +24 -0
  45. package/dist/esm/testing/jest.config.cjs +110 -0
  46. package/dist/esm/testing/jest.node.config.cjs +8 -0
  47. package/dist/esm/testing/resolver.cjs +47 -0
  48. package/dist/esm/transpile/.swcrc +11 -0
  49. package/dist/esm/transpile/esbuild.js +3 -3
  50. package/dist/esm/transpile/swcrc.config.cjs +13 -0
  51. package/dist/esm/typedoc.cjs +12 -0
  52. package/dist/esm/utils.cjs +23 -0
  53. package/dist/esm/webpack/webpack.lib.dev.babel.js +1 -1
  54. package/dist/esm/webpack/webpack.lib.prod.babel.js +1 -1
  55. package/package.json +2 -2
@@ -0,0 +1,47 @@
1
+ const resolutions = [
2
+ {
3
+ matcher: /\.jsx?$/i,
4
+ extensions: ['.tsx', '.ts'],
5
+ },
6
+ {
7
+ matcher: /\.mjs$/i,
8
+ extensions: ['.mts'],
9
+ },
10
+ {
11
+ matcher: /\.cjs$/i,
12
+ extensions: ['.cts'],
13
+ },
14
+ ];
15
+
16
+ const resolveConfig = {
17
+ conditionNames: ['import', 'node', 'default'],
18
+ extensions: ['.ts', '.tsx', '.js', '.jsx', '.json', '.node'],
19
+ modules: ['node_modules', 'app', 'lib'],
20
+ };
21
+
22
+ const importResolver = require('enhanced-resolve').create.sync(resolveConfig);
23
+ const requireResolver = require('enhanced-resolve').create.sync({
24
+ ...resolveConfig,
25
+ conditionNames: ['require', 'node', 'default'],
26
+ });
27
+
28
+ module.exports = (request, options) => {
29
+ let resolver = requireResolver;
30
+ if (options.conditions?.includes('import')) {
31
+ resolver = importResolver;
32
+ }
33
+ const resolution = resolutions.find(({ matcher }) => matcher.test(request));
34
+ if (resolution) {
35
+ // eslint-disable-next-line no-restricted-syntax
36
+ for (const extension of resolution.extensions) {
37
+ try {
38
+ return resolver(
39
+ options.basedir,
40
+ request.replace(resolution.matcher, extension),
41
+ );
42
+ // eslint-disable-next-line no-empty
43
+ } catch {}
44
+ }
45
+ }
46
+ return resolver(options.basedir, request);
47
+ };
@@ -0,0 +1,11 @@
1
+ {
2
+ "jsc": {
3
+ "parser": {
4
+ "syntax": "typescript",
5
+ "jsx": true,
6
+ "tsx": true,
7
+ "dynamicImport": true
8
+ },
9
+ "target": "es2020"
10
+ }
11
+ }
@@ -63,9 +63,9 @@ const getCommonConfig = ({ injectReactShim }) => ({
63
63
  });
64
64
  const copyFiles = async ({ srcdir, outdir }) => {
65
65
  const files = await (0, import_fast_glob.default)([
66
- import_fast_glob.default.convertPathToPattern(`${srcdir}/**/*.*`),
67
- import_fast_glob.default.convertPathToPattern(`${srcdir}/**/.swcrc`),
68
- import_fast_glob.default.convertPathToPattern(`!${srcdir}/**/*.{js,jsx,ts,tsx,mjs}`)
66
+ `${srcdir}/**/*.*`,
67
+ `${srcdir}/**/.swcrc`,
68
+ `!${srcdir}/**/*.{js,jsx,ts,tsx,mjs}`
69
69
  ]);
70
70
  await Promise.all(
71
71
  files.map(async (srcFilePath) => {
@@ -0,0 +1,13 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const { merge } = require('lodash');
4
+
5
+ let projectConfig = {};
6
+ const projectPath = path.join(process.cwd(), '.swcrc');
7
+ if (fs.existsSync(projectPath)) {
8
+ projectConfig = JSON.parse(fs.readFileSync(projectPath, 'utf-8'));
9
+ }
10
+ const localConfig = JSON.parse(
11
+ fs.readFileSync(path.join(__dirname, '.swcrc'), 'utf-8'),
12
+ );
13
+ exports.swcrcConfig = merge(localConfig, projectConfig);
@@ -0,0 +1,12 @@
1
+ const path = require('path');
2
+ const fs = require('fs');
3
+
4
+ const isApp = () => fs.existsSync(path.join(process.cwd(), 'app'));
5
+
6
+ const srcPath = path.join(process.cwd(), isApp() ? 'app' : 'lib');
7
+
8
+ module.exports = {
9
+ entryPoints: [srcPath],
10
+ exclude: ['**/*+(.spec|.e2e|.test).ts'],
11
+ out: path.join(process.cwd(), 'docs'),
12
+ };
@@ -0,0 +1,23 @@
1
+ const path = require('path');
2
+ const fs = require('fs');
3
+
4
+ exports.basePath = (process.env.BASE_PATH || '/').replace(/\/?$/, '/');
5
+
6
+ const isApp = () => fs.existsSync(path.join(process.cwd(), 'app'));
7
+
8
+ exports.getAppConfig = () => {
9
+ const appConfigPath = path.join(
10
+ process.cwd(),
11
+ isApp() ? 'app' : 'lib',
12
+ 'app.config.json',
13
+ );
14
+
15
+ if (!fs.existsSync(appConfigPath)) return '{}';
16
+ const appConfig = fs.readFileSync(appConfigPath);
17
+ return appConfig || '{}';
18
+ };
19
+
20
+ exports.isApp = isApp;
21
+
22
+ exports.isTypeScriptEnabled = () =>
23
+ fs.existsSync(path.join(process.cwd(), 'tsconfig.json'));
@@ -43,7 +43,7 @@ var import_webpack_lib_base_babel = require("./webpack.lib.base.babel.js");
43
43
  const { basePath } = (0, import_helpers.getPaths)();
44
44
  const getHtmlWebpackPlugins = () => {
45
45
  const htmlTemplateFiles = import_fast_glob.default.sync([
46
- import_fast_glob.default.convertPathToPattern(import_node_path.default.join(process.cwd(), "lib/*.html"))
46
+ import_node_path.default.join(import_fast_glob.default.convertPathToPattern(process.cwd()), "lib/*.html")
47
47
  ]);
48
48
  return htmlTemplateFiles.map(
49
49
  (htmlTemplateFile) => new import_html_webpack_plugin.default({
@@ -42,7 +42,7 @@ var import_helpers = require("./helpers.js");
42
42
  var import_webpack_lib_base_babel = require("./webpack.lib.base.babel.js");
43
43
  const getHtmlWebpackPlugins = () => {
44
44
  const htmlTemplateFiles = import_fast_glob.default.sync([
45
- import_fast_glob.default.convertPathToPattern(import_node_path.default.join(process.cwd(), "lib/*.html"))
45
+ import_node_path.default.join(import_fast_glob.default.convertPathToPattern(process.cwd()), "lib/*.html")
46
46
  ]);
47
47
  return htmlTemplateFiles.map(
48
48
  (htmlTemplateFile) => new import_html_webpack_plugin.default({
@@ -0,0 +1,97 @@
1
+ const { isApp } = require('./utils.cjs');
2
+
3
+ const nodeEnvPreset = {
4
+ modules: process.env.ES_MODULES === 'false' ? 'commonjs' : false,
5
+ targets: {
6
+ node: 'current',
7
+ },
8
+ };
9
+
10
+ const webEnvPreset = {
11
+ modules: process.env.ES_MODULES === 'false' ? 'commonjs' : false,
12
+ useBuiltIns: 'usage',
13
+ corejs: { version: '3.22', proposals: true },
14
+ };
15
+
16
+ const presetEnvOptions =
17
+ process.env.TARGET_ENV === 'node' ? nodeEnvPreset : webEnvPreset;
18
+
19
+ const config = {
20
+ ignore: [/\/core-js/],
21
+ sourceType: 'unambiguous',
22
+ presets: [
23
+ ['@babel/preset-env', presetEnvOptions],
24
+ ['@babel/preset-react', { runtime: 'automatic' }],
25
+ '@babel/preset-typescript',
26
+ ],
27
+ plugins: [
28
+ [
29
+ 'babel-plugin-module-resolver',
30
+ {
31
+ alias: {
32
+ '@': isApp() ? './app' : './lib',
33
+ },
34
+ stripExtensions: [],
35
+ },
36
+ ],
37
+ ['babel-plugin-styled-components', { displayName: true }],
38
+ ['@babel/plugin-transform-runtime', { regenerator: true }],
39
+ '@babel/plugin-proposal-class-properties',
40
+ '@babel/plugin-syntax-dynamic-import',
41
+ '@babel/plugin-proposal-export-default-from',
42
+ 'lodash',
43
+ 'date-fns',
44
+ ],
45
+ env: {
46
+ development: {
47
+ plugins: [
48
+ ['babel-plugin-styled-components', { displayName: true }],
49
+ '@babel/plugin-transform-react-jsx-source',
50
+ ],
51
+ },
52
+ production: {
53
+ plugins: [
54
+ ['babel-plugin-styled-components', { displayName: false, pure: true }],
55
+ ['transform-remove-console', { exclude: ['error', 'warn'] }],
56
+ 'transform-react-remove-prop-types',
57
+ '@babel/plugin-transform-react-inline-elements',
58
+ '@babel/plugin-transform-react-constant-elements',
59
+ ],
60
+ },
61
+ test: {
62
+ plugins: [
63
+ ['babel-plugin-styled-components', { displayName: true }],
64
+ '@babel/plugin-transform-modules-commonjs',
65
+ 'dynamic-import-node',
66
+ [
67
+ 'babel-plugin-transform-strip-block',
68
+ {
69
+ requireDirective: true,
70
+ identifiers: [{ start: 'block:start', end: 'block:end' }],
71
+ },
72
+ ],
73
+ 'babel-plugin-import-remove-resource-query',
74
+ ],
75
+ },
76
+ },
77
+ };
78
+
79
+ if (
80
+ process.env.STORYBOOK_BUILD !== 'true' &&
81
+ process.env.TARGET_ENV !== 'node'
82
+ ) {
83
+ config.env?.development?.plugins?.push?.('react-refresh/babel');
84
+ }
85
+
86
+ // ToDo: Once ECC team migrates from webpack 3 to webpack 5 remove this strip-block plugin from commonjs output. without this they are receiving error when import.meta is used in app sdk
87
+ if (process.env.ES_MODULES === 'false') {
88
+ config.plugins.push([
89
+ 'babel-plugin-transform-strip-block',
90
+ {
91
+ requireDirective: true,
92
+ identifiers: [{ start: 'block:start', end: 'block:end' }],
93
+ },
94
+ ]);
95
+ }
96
+
97
+ exports.babelConfig = config;
@@ -124,7 +124,7 @@ const updateRuntimeFile = async (src, dest, version) => {
124
124
  const latestJSFolder = "latest/js";
125
125
  const pipe = promisify(pipeline);
126
126
  const results = await fg([
127
- fg.convertPathToPattern(path.join(src, "runtime~app.*.js"))
127
+ path.join(fg.convertPathToPattern(src), "runtime~app.*.js")
128
128
  ]);
129
129
  if (!results?.length)
130
130
  throw new Error("Runtime file not found");
@@ -0,0 +1,23 @@
1
+ const { babelConfig } = require('./babel.config.cjs');
2
+ const {
3
+ esConfig: eslintBaseConfig,
4
+ } = require('./lint-config/eslint/non-react.cjs');
5
+ const {
6
+ esReactConfig: eslintConfig,
7
+ } = require('./lint-config/eslint/react.cjs');
8
+ const { stylelintConfig } = require('./lint-config/stylelint.config.cjs');
9
+ const { prettierConfig } = require('./lint-config/prettier.config.cjs');
10
+ const { commitlintConfig } = require('./lint-config/commitlint.config.cjs');
11
+ const { jestConfig } = require('./testing/jest.config.cjs');
12
+ const { jestNodeConfig } = require('./testing/jest.node.config.cjs');
13
+
14
+ module.exports = {
15
+ babelConfig,
16
+ eslintBaseConfig,
17
+ eslintConfig,
18
+ stylelintConfig,
19
+ prettierConfig,
20
+ commitlintConfig,
21
+ jestConfig,
22
+ jestNodeConfig,
23
+ };
@@ -0,0 +1,17 @@
1
+ {
2
+ "plugins": ["plugins/markdown"],
3
+ "opts": {
4
+ "template": "node_modules/docdash"
5
+ },
6
+ "docdash": {
7
+ "sort": true,
8
+ "search": true,
9
+ "collapse": true,
10
+ "wrap": true
11
+ },
12
+ "templates": {
13
+ "default": {
14
+ "includeDate": false
15
+ }
16
+ }
17
+ }
@@ -0,0 +1 @@
1
+ exports.commitlintConfig = { extends: ['@commitlint/config-conventional'] };
@@ -0,0 +1,164 @@
1
+ /* eslint-disable max-lines */
2
+ const prettierOptions = require("../prettier.config.cjs");
3
+ // const webpackConfig = require('../../webpack/webpack.prod.babel');
4
+
5
+ exports.baseExtends = [
6
+ "plugin:eslint-comments/recommended",
7
+ "plugin:import/recommended",
8
+ "plugin:prettier/recommended",
9
+ "plugin:jest/recommended",
10
+ "plugin:jsdoc/recommended",
11
+ "plugin:wdio/recommended",
12
+ "plugin:testing-library/dom",
13
+ "plugin:storybook/recommended",
14
+ ];
15
+
16
+ const basePlugins = ["testing-library", "jest", "jsdoc", "wdio", "import"];
17
+ exports.basePlugins = basePlugins;
18
+
19
+ exports.baseOverrides = [
20
+ {
21
+ files: ["*.func.spec.js", "*.visual.spec.js"],
22
+ rules: {
23
+ "jest/valid-expect": "off",
24
+ },
25
+ },
26
+ ];
27
+
28
+ const baseRules = {
29
+ "prettier/prettier": ["error", prettierOptions],
30
+ "arrow-body-style": [2, "as-needed"],
31
+ "class-methods-use-this": 0,
32
+ "import/imports-first": 0,
33
+ "import/newline-after-import": 0,
34
+ "import/no-dynamic-require": 0,
35
+ "import/no-extraneous-dependencies": 0,
36
+ "import/no-named-as-default": 0,
37
+ "import/no-unresolved": [
38
+ 2,
39
+ { caseSensitive: true, caseSensitiveStrict: true },
40
+ ], // Tip: https://github.com/import-js/eslint-plugin-import/issues/1868
41
+ "import/no-webpack-loader-syntax": 0,
42
+ "import/prefer-default-export": 0,
43
+ "import/extensions": [
44
+ 2,
45
+ "never",
46
+ {
47
+ json: "ignorePackages",
48
+ js: "ignorePackages",
49
+ },
50
+ ],
51
+ indent: [
52
+ 2,
53
+ 2,
54
+ {
55
+ SwitchCase: 1,
56
+ },
57
+ ],
58
+ "max-lines": ["error", { max: 120, skipComments: true }],
59
+ complexity: ["error", { max: 10 }],
60
+ "max-depth": ["error", { max: 4 }],
61
+ "max-lines-per-function": 0,
62
+ "max-nested-callbacks": ["error", { max: 3 }],
63
+ "max-params": ["error", { max: 3 }],
64
+ "max-statements": ["error", { max: 20 }],
65
+ "max-len": 0,
66
+ "newline-per-chained-call": 0,
67
+ "no-confusing-arrow": 0,
68
+ "no-console": 1,
69
+ "no-param-reassign": ["error", { props: false }],
70
+ "no-unused-vars": 2,
71
+ "no-use-before-define": 0,
72
+ "prefer-template": 2,
73
+ "require-yield": 0,
74
+ "jsdoc/require-jsdoc": 0,
75
+ "eslint-comments/disable-enable-pair": 0,
76
+ };
77
+
78
+ exports.baseRules = baseRules;
79
+
80
+ const reactRules = {
81
+ "jsx-a11y/aria-props": 2,
82
+ "jsx-a11y/heading-has-content": 0,
83
+ "jsx-a11y/label-has-associated-control": [
84
+ 2,
85
+ {
86
+ // NOTE: If this error triggers, either disable it or add
87
+ // your custom components, labels and attributes via these options
88
+ // See https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/label-has-associated-control.md
89
+ controlComponents: ["Input"],
90
+ },
91
+ ],
92
+ "jsx-a11y/label-has-for": 0,
93
+ "jsx-a11y/mouse-events-have-key-events": 2,
94
+ "jsx-a11y/role-has-required-aria-props": 2,
95
+ "jsx-a11y/role-supports-aria-props": 2,
96
+ "react/destructuring-assignment": 0,
97
+ "react-hooks/rules-of-hooks": "error",
98
+ "react/jsx-closing-tag-location": 0,
99
+ "react/forbid-prop-types": 0,
100
+ "react/jsx-first-prop-new-line": [2, "multiline"],
101
+ "react/jsx-no-target-blank": 0,
102
+ "react/jsx-props-no-spreading": 0,
103
+ "react/jsx-uses-vars": 2,
104
+ "react/require-default-props": 0,
105
+ "react/require-extension": 0,
106
+ "react/self-closing-comp": 0,
107
+ "react/sort-comp": 0,
108
+ "react/react-in-jsx-scope": 0,
109
+ "react/jsx-filename-extension": [
110
+ 1,
111
+ { extensions: [".js", ".jsx", ".tsx", ".mdx"] },
112
+ ],
113
+ "react/function-component-definition": [
114
+ 2,
115
+ { namedComponents: "arrow-function" },
116
+ ],
117
+ "redux-saga/no-yield-in-race": 2,
118
+ "redux-saga/yield-effects": 2,
119
+ };
120
+ exports.reactRules = reactRules;
121
+
122
+ exports.baseConfig = {
123
+ parser: "@babel/eslint-parser",
124
+ plugins: basePlugins,
125
+ env: {
126
+ jest: true,
127
+ browser: true,
128
+ node: true,
129
+ es2021: true,
130
+ },
131
+ parserOptions: {
132
+ sourceType: "module",
133
+ ecmaFeatures: {
134
+ jsx: true,
135
+ },
136
+ babelOptions: {
137
+ plugins: ["@babel/plugin-syntax-import-assertions"],
138
+ },
139
+ },
140
+ settings: {
141
+ react: {
142
+ version: "detect",
143
+ },
144
+ jest: {
145
+ version: 28,
146
+ },
147
+ "import/resolver": {
148
+ node: {
149
+ extensions: [".js", ".jsx", ".ts", ".tsx"],
150
+ },
151
+ },
152
+ },
153
+ ignorePatterns: [
154
+ "/build/**/*",
155
+ "/node_modules/**/*",
156
+ "/dist/**/*",
157
+ "/reports/**/*",
158
+ "/coverage/**/*",
159
+ "/demo/**/*",
160
+ "/docs/**/*",
161
+ "/temp/**/*",
162
+ "**/vendor/*.js",
163
+ ],
164
+ };
@@ -0,0 +1,14 @@
1
+ const {
2
+ baseExtends,
3
+ baseRules,
4
+ baseOverrides,
5
+ baseConfig,
6
+ } = require('./common.cjs');
7
+ const { tsConfig } = require('./typescript/non-react.cjs');
8
+
9
+ exports.esConfig = {
10
+ ...baseConfig,
11
+ extends: ['airbnb-base'].concat(baseExtends),
12
+ rules: baseRules,
13
+ overrides: baseOverrides.concat([tsConfig]),
14
+ };
@@ -0,0 +1,26 @@
1
+ const {
2
+ baseExtends,
3
+ baseRules,
4
+ baseOverrides,
5
+ baseConfig,
6
+ reactRules,
7
+ } = require('./common.cjs');
8
+ const { tsReactConfig } = require('./typescript/react.cjs');
9
+
10
+ exports.esReactConfig = {
11
+ ...baseConfig,
12
+ extends: ['airbnb', 'airbnb/hooks', 'plugin:redux-saga/recommended'].concat(
13
+ baseExtends,
14
+ ),
15
+ rules: {
16
+ ...baseRules,
17
+ ...reactRules,
18
+ },
19
+ overrides: baseOverrides.concat([
20
+ tsReactConfig,
21
+ {
22
+ files: '*.mdx',
23
+ extends: 'plugin:mdx/recommended',
24
+ },
25
+ ]),
26
+ };
@@ -0,0 +1,49 @@
1
+ const { baseExtends, basePlugins } = require('../common.cjs');
2
+
3
+ exports.tsBaseExtends = [
4
+ 'plugin:@typescript-eslint/recommended',
5
+ 'plugin:import/typescript',
6
+ 'plugin:@typescript-eslint/recommended-requiring-type-checking',
7
+ ].concat(baseExtends);
8
+
9
+ exports.tsBaseRules = {
10
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
11
+ '@typescript-eslint/explicit-function-return-type': 'off',
12
+ '@typescript-eslint/no-use-before-define': [
13
+ 'error',
14
+ { functions: false, classes: true, variables: true, typedefs: true },
15
+ ],
16
+ 'max-lines': ['error', { max: 200, skipComments: true }],
17
+ '@typescript-eslint/unbound-method': [
18
+ 'error',
19
+ {
20
+ ignoreStatic: true,
21
+ },
22
+ ],
23
+ '@typescript-eslint/no-floating-promises': [
24
+ 'error',
25
+ {
26
+ ignoreIIFE: true,
27
+ },
28
+ ],
29
+ };
30
+
31
+ exports.tsBaseConfig = {
32
+ files: ['*.ts', '*.tsx'],
33
+ parser: '@typescript-eslint/parser',
34
+ plugins: ['@typescript-eslint'].concat(basePlugins),
35
+ parserOptions: {
36
+ tsconfigRootDir: process.cwd(),
37
+ project: 'tsconfig.json',
38
+ },
39
+ settings: {
40
+ 'import/resolver': {
41
+ typescript: {
42
+ alwaysTryTypes: true,
43
+ },
44
+ },
45
+ 'import/parsers': {
46
+ '@typescript-eslint/parser': ['.ts', '.tsx'],
47
+ },
48
+ },
49
+ };
@@ -0,0 +1,12 @@
1
+ /* eslint-disable max-lines */
2
+ const { baseRules } = require('../common.cjs');
3
+ const { tsBaseExtends, tsBaseRules, tsBaseConfig } = require('./common.cjs');
4
+
5
+ exports.tsConfig = {
6
+ ...tsBaseConfig,
7
+ extends: ['airbnb-base', 'airbnb-typescript/base'].concat(tsBaseExtends),
8
+ rules: {
9
+ ...baseRules,
10
+ ...tsBaseRules,
11
+ },
12
+ };
@@ -0,0 +1,19 @@
1
+ /* eslint-disable max-lines */
2
+ const { baseRules, reactRules } = require('../common.cjs');
3
+ const { tsBaseExtends, tsBaseRules, tsBaseConfig } = require('./common.cjs');
4
+
5
+ exports.tsReactConfig = {
6
+ ...tsBaseConfig,
7
+ extends: [
8
+ 'airbnb',
9
+ 'airbnb/hooks',
10
+ 'plugin:redux-saga/recommended',
11
+ 'airbnb-typescript',
12
+ ].concat(tsBaseExtends),
13
+ rules: {
14
+ ...baseRules,
15
+ ...tsBaseRules,
16
+ ...reactRules,
17
+ 'react/prop-types': 0,
18
+ },
19
+ };
@@ -0,0 +1,8 @@
1
+ exports.prettierConfig = {
2
+ printWidth: 80,
3
+ tabWidth: 2,
4
+ useTabs: false,
5
+ semi: true,
6
+ singleQuote: true,
7
+ trailingComma: 'all',
8
+ };
@@ -0,0 +1,20 @@
1
+ exports.stylelintConfig = {
2
+ ignoreFiles: [
3
+ "/dist/**/*",
4
+ "/coverage/**/*",
5
+ "/build/**/*",
6
+ "/reports/**/*",
7
+ "/temp/**/*",
8
+ "/docs/**/*",
9
+ "/demo/**/*",
10
+ "/node_modules/**/*",
11
+ "/vendor/**/*",
12
+ ],
13
+ customSyntax: "@stylelint/postcss-css-in-js",
14
+ // customSyntax: "postcss-styled-components", // '@stylelint/postcss-css-in-js' is deprecated, this may be a replacement?
15
+ extends: [
16
+ "stylelint-config-recommended",
17
+ "stylelint-config-styled-components",
18
+ ],
19
+ rules: { "selector-type-no-unknown": null, "function-no-unknown": null },
20
+ };
@@ -5,9 +5,9 @@ import { findMonoRepoRoot } from "./utils.js";
5
5
  const monorepoRoot = normalizePath(findMonoRepoRoot() || "");
6
6
  const setRegistryVersion = async () => {
7
7
  const files = await fg([
8
- fg.convertPathToPattern(`${monorepoRoot}/libs/*/package.json`),
9
- fg.convertPathToPattern(`${monorepoRoot}/apps/*/package.json`),
10
- fg.convertPathToPattern(`${monorepoRoot}/package.json`)
8
+ `${monorepoRoot}/libs/*/package.json`,
9
+ `${monorepoRoot}/apps/*/package.json`,
10
+ `${monorepoRoot}/package.json`
11
11
  ]);
12
12
  await Promise.all(
13
13
  files.map(async (file) => {
@@ -5,9 +5,9 @@ import { findMonoRepoRoot } from "./utils.js";
5
5
  const monorepoRoot = normalizePath(findMonoRepoRoot() || "");
6
6
  const setWorkspaceVersion = async () => {
7
7
  const files = await fg([
8
- fg.convertPathToPattern(`${monorepoRoot}/libs/*/package.json`),
9
- fg.convertPathToPattern(`${monorepoRoot}/apps/*/package.json`),
10
- fg.convertPathToPattern(`${monorepoRoot}/package.json`)
8
+ `${monorepoRoot}/libs/*/package.json`,
9
+ `${monorepoRoot}/apps/*/package.json`,
10
+ `${monorepoRoot}/package.json`
11
11
  ]);
12
12
  await Promise.all(
13
13
  files.map(async (file) => {