Skip to content

Commit

Permalink
build: Eslint - fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
vio committed Feb 10, 2025
1 parent 2b7b714 commit 02960e9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions bin/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env node

// eslint-disable-next-line
const cli = require('../lib/cli').default;

(async () => {
Expand Down
12 changes: 7 additions & 5 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const filename = fileURLToPath(import.meta.url);
const dirname = path.dirname(filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
baseDirectory: dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
Expand All @@ -21,18 +21,20 @@ export default [
plugins: {
jest,
},

languageOptions: {
globals: {
...jest.environments.globals.globals,
AGENT_VERSION: true,
describe: true,
it: true,
},
parserOptions: {
ecmaVersion: 'latest',
},
},

rules: {
'no-console': 'off',
'no-unused-vars': ['error', { varsIgnorePattern: '^_', argsIgnorePattern: '^_' }],
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': [
'error',
Expand Down
4 changes: 2 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function getCommitMessage() {

try {
message = childProcess.execSync('git log -1 --pretty=%B').toString().trim();
} catch (err) {
} catch (error) { // eslint-disable-line no-unused-vars
console.error('Error reading the commit message from git');
}

Expand Down Expand Up @@ -75,7 +75,7 @@ export function getSlugFromGitURL(repositoryURL) {
const url = new URL(repositoryURL);
return url.pathname.replace(GIT_PATHNAME_SLUG_PATTERN, '$1');
} catch (err) {
console.warn(err.message); // eslint-disable-line no-console
console.warn(err.message);
return undefined;
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/webpack-plugin-webpack-v4.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
jest.mock('isomorphic-fetch');
jest.mock('webpack', () => require('webpack4')); // eslint-disable-line

const webpack = require('webpack4'); // eslint-disable-line
const webpack = require('webpack4');
const MemoryFS = require('memory-fs');
const fetch = require('isomorphic-fetch');
const { merge } = require('lodash');
Expand Down

0 comments on commit 02960e9

Please sign in to comment.