Skip to content

Commit

Permalink
fix(eslint): fix eslint errors
Browse files Browse the repository at this point in the history
* Fix no-unused-vars
* Add a rule for `*.config.mjs` files.
* Install `@types/node` for `process.*`
  • Loading branch information
appano1 committed Nov 8, 2024
1 parent 36cb548 commit f51c34b
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 18 deletions.
6 changes: 6 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,10 @@ export default [
'sort-keys': 'error',
},
},
{
files: ['*.config.mjs'],
rules: {
'import/no-default-export': 'off',
},
},
];
2 changes: 1 addition & 1 deletion eslint/flat/next.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const babelOptions = {
try {
require.resolve('next/babel');
return ['next/babel'];
} catch (e) {
} catch {
return [];
}
})(),
Expand Down
2 changes: 1 addition & 1 deletion eslint/next.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const babelOptions = {
try {
require.resolve('next/babel');
return ['next/babel'];
} catch (e) {
} catch {
return [];
}
})(),
Expand Down
2 changes: 1 addition & 1 deletion eslint/utils/require-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function readPackageManager() {
module.exports = (configName, packageName) => {
try {
require.resolve(packageName);
} catch (e) {
} catch {
const packageManager = readPackageManager();
const command = packageManager === 'yarn' ? 'add' : 'install';

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"@commitlint/cli": "^19.0.3",
"@commitlint/config-conventional": "^19.0.3",
"@semantic-release/git": "^10.0.1",
"@types/node": "^22.9.0",
"eslint": "^9.14.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
Expand Down
33 changes: 18 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f51c34b

Please sign in to comment.