Skip to content
Merged
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
19 changes: 13 additions & 6 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@

module.exports = {
extends: [
// https://github.com/electron-react-boilerplate/eslint-config-erb/blob/main/index.js
// airbnb rules are embedded in erb https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb
'erb',
// https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb
'airbnb',
'airbnb/hooks',
'plugin:promise/recommended',
'plugin:compat/recommended',
// https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#typescript
'plugin:import/recommended',
'plugin:import/typescript',
// Make sure this is last so it gets the chance to override other configs.
// See https://github.com/prettier/eslint-config-prettier and https://github.com/prettier/eslint-plugin-prettier
'plugin:prettier/recommended',
],
env: {
browser: true,
node: true,
},

rules: {
// Some rules in this following shared region are not applied since they are overridden in subsequent regions
Expand All @@ -21,6 +27,7 @@ module.exports = {

// Use `noImplicitReturns` instead. See https://typescript-eslint.io/rules/consistent-return/.
'consistent-return': 'off',
'no-param-reassign': ['error', { props: false }],
'import/default': 'off',
'import/extensions': 'off',
// A temporary hack related to IDE not resolving correct package.json
Expand All @@ -45,7 +52,7 @@ module.exports = {
],
'@typescript-eslint/explicit-member-accessibility': ['error', { accessibility: 'no-public' }],
'lines-between-class-members': 'off',
'@typescript-eslint/lines-between-class-members': [
'@stylistic/ts/lines-between-class-members': [
'error',
'always',
{ exceptAfterSingleLine: true, exceptAfterOverload: true },
Expand Down Expand Up @@ -146,14 +153,14 @@ module.exports = {
},
},
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
project: './tsconfig.lint.json',
tsconfigRootDir: __dirname,
createDefaultProgram: true,
},
plugins: ['@typescript-eslint', 'no-type-assertion', 'no-null'],
plugins: ['@typescript-eslint', '@stylistic/ts', 'no-type-assertion', 'no-null'],
settings: {
'import/resolver': { typescript: { alwaysTryTypes: true } },
'import/parsers': { '@typescript-eslint/parser': ['.ts', '.tsx'] },
Expand Down
7 changes: 5 additions & 2 deletions lib/git.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ export async function execCommand(
});
if (!quiet && result.stdout) console.log(result.stdout);
if (!quiet && result.stderr) console.log(result.stderr);
return result;
return {
stdout: result.stdout.toString(),
stderr: result.stderr.toString(),
};
} catch (error: unknown) {
if (error instanceof Error) {
// Use the more specific type for `exec`.
Expand Down Expand Up @@ -265,7 +268,7 @@ export async function formatExtensionFolder(extensionFolderPath: string) {
await fs.rename(oldTypesFilePath, newTypesFilePath);
console.log(`Renamed types file to ${extensionName}.d.ts`);
}
} catch (error) {
} catch {
// Old file doesn't exist, so no need to rename
console.log(`Types file paranext-extension-template.d.ts not found, skipping rename operation`);
}
Expand Down
1 change: 1 addition & 0 deletions lib/update-from-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import { ExtensionInfo, getExtensions } from '../webpack/webpack.util';
extensionsBasedOnTemplate.push(ext);
} catch (e) {
if (
e instanceof Error &&
e
.toString()
.toLowerCase()
Expand Down
Loading
Loading