Skip to content

Commit

Permalink
chore: migrate to eslint v9
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalsadhu committed Aug 1, 2024
1 parent fd74b77 commit d0aa986
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 37 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

2 changes: 0 additions & 2 deletions classes/integrity.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-await-in-loop */
/* eslint-disable no-plusplus */
import abslog from 'abslog';
import { join } from 'path';
import eik from '@eik/common';
Expand Down
2 changes: 0 additions & 2 deletions classes/meta.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-await-in-loop */
/* eslint-disable no-plusplus */
import abslog from 'abslog';
import { join } from 'path';
import { schemas } from '@eik/common';
Expand Down
1 change: 0 additions & 1 deletion classes/publish/package/tasks/create-temp-directory.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable max-classes-per-file */
import mkdir from 'make-dir';
import Task from './task.js';

Expand Down
2 changes: 0 additions & 2 deletions classes/publish/package/tasks/create-zip-file.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-plusplus */
/* eslint-disable no-await-in-loop */
import fs from 'fs';
import { join, resolve, basename, dirname } from 'path';
import tar from 'tar';
Expand Down
1 change: 0 additions & 1 deletion classes/publish/package/tasks/dry-run.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-param-reassign */
import { join } from 'path';
import Task from './task.js';

Expand Down
1 change: 0 additions & 1 deletion classes/publish/package/tasks/upload-files.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-param-reassign */
import { join } from 'path';
import { request } from '../../../../utils/http/index.js';
import { typeSlug } from '../../../../utils/index.js';
Expand Down
1 change: 0 additions & 1 deletion classes/publish/package/tasks/validate-input.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable max-classes-per-file */
import { parse } from 'path';
import Task from './task.js';

Expand Down
1 change: 0 additions & 1 deletion classes/version.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable max-classes-per-file */
import { copyFileSync, writeFileSync } from 'fs';
import { join, isAbsolute, parse } from 'path';
import abslog from 'abslog';
Expand Down
3 changes: 0 additions & 3 deletions commands/integrity.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* eslint-disable prefer-template */
/* eslint-disable no-restricted-properties */
/* eslint-disable one-var */
import { join } from 'path';
import ora from 'ora';
import { helpers } from '@eik/common';
Expand Down
3 changes: 0 additions & 3 deletions commands/meta.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* eslint-disable prefer-template */
/* eslint-disable no-restricted-properties */
/* eslint-disable one-var */
import ora from 'ora';
import Meta from '../classes/meta.js';
import { Artifact } from '../formatters/index.js';
Expand Down
28 changes: 28 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import js from '@eslint/js';
import babelParser from '@babel/eslint-parser';
import globals from 'globals';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';

export default [
js.configs.recommended,
eslintPluginPrettierRecommended,
{
rules: {
'no-unused-vars': 'off',
},
languageOptions: {
parser: babelParser,
parserOptions: {
requireConfigFile: false,
ecmaVersion: 2020,
sourceType: 'module',
},
globals: {
...globals.browser,
...globals.node,
...globals.es2020,
},
},
ignores: ['coverage'],
},
];
1 change: 0 additions & 1 deletion formatters/alias.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-underscore-dangle */
import { join } from 'path';
import chalk from 'chalk';
import File from './file.js';
Expand Down
1 change: 0 additions & 1 deletion formatters/artifact.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-underscore-dangle */
import { join } from 'path';
import chalk from 'chalk';
import Version from './version.js';
Expand Down
4 changes: 0 additions & 4 deletions formatters/file.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/* eslint-disable no-restricted-properties */
/* eslint-disable prefer-template */
/* eslint-disable one-var */
/* eslint-disable no-underscore-dangle */
import { join } from 'path';
import chalk from 'chalk';

Expand Down
4 changes: 0 additions & 4 deletions formatters/version.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/* eslint-disable no-restricted-properties */
/* eslint-disable prefer-template */
/* eslint-disable one-var */
/* eslint-disable no-underscore-dangle */
import { join } from 'path';
import chalk from 'chalk';
import formatDistance from 'date-fns/formatDistance/index.js';
Expand Down
2 changes: 0 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ const boxenOptions = {
};
const msgBox = boxen(greeting, boxenOptions);

// eslint-disable-next-line no-console
console.log(msgBox);

// eslint-disable-next-line no-unused-expressions
yargs(hideBin(process.argv))
.example('eik init')
.example('eik login --server https://assets.myserver.com --key ######')
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@
"@eik/service": "2.1.0",
"@eik/sink-memory": "1.1.1",
"@eik/typescript-config": "1.0.0",
"@eslint/js": "9.8.0",
"@semantic-release/changelog": "6.0.3",
"@semantic-release/git": "10.0.1",
"cross-env": "7.0.3",
"eslint": "8.57.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-prettier": "8.10.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-prettier": "4.2.1",
"eslint": "9.8.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.2.1",
"fastify": "4.28.1",
"fs-extra": "11.2.0",
"globals": "15.8.0",
"npm-run-all": "4.1.5",
"prettier": "3.3.3",
"semantic-release": "24.0.0",
Expand Down
3 changes: 1 addition & 2 deletions utils/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ const logger = (spinner, debug = false) => ({
*/
info(message) {
if (typeof message !== 'string') {
// eslint-disable-next-line no-param-reassign
spinner.text = '';
spinner.stopAndPersist();
// eslint-disable-next-line no-console

console.log(message);
spinner.start();
} else {
Expand Down

0 comments on commit d0aa986

Please sign in to comment.