Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions _scripts/package-lock-sync.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const npmBin = resolveNpmBin(cwd);
const starters = fs.readdirSync(cwd, { withFileTypes: true });

// iterate over all starters and check if the `package-lock.json` is in sync with the `package.json`
const promises = [];
let exitCode = 0;

for (const starter of starters) {
const dir = path.join(cwd, starter.name);
Expand All @@ -29,22 +29,16 @@ for (const starter of starters) {
continue;
}

if (shouldWrite) {
promises.push(updatePackageLock(dir, starter.name, shouldForceWrite));
} else {
promises.push(checkPackageLockSync(dir, starter.name));
}
}

const result = await Promise.allSettled(promises);

let exitCode = 0;

for (const { status, reason } of result) {
if (status === 'rejected') {
try {
if (shouldWrite) {
await updatePackageLock(dir, starter.name, shouldForceWrite);
} else {
await checkPackageLockSync(dir, starter.name);
}
} catch (error) {
exitCode = 1;

console.error(reason.message);
console.error(error.message);
}
}

Expand Down Expand Up @@ -73,7 +67,6 @@ function checkPackageLockSync(directory, name) {
}

const child = childProcess.spawn(npmBin, ['ci'], {
stdio: 'ignore',
cwd: directory,
});

Expand Down
22 changes: 8 additions & 14 deletions bolt-vite-react-ts/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import { reactRefresh } from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
extends: [
js.configs.recommended,
...tseslint.configs.recommended,
reactHooks.configs.flat.recommended,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as adding plugin manually and enabling recommended rules.

reactRefresh.configs.vite(),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/main/README.md#vite-config

reactRefresh.configs.vite() will do the allowConstantExport for us.

],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
ecmaVersion: 2022,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
);
Loading