Skip to content

Commit

Permalink
Chore: migrate to eslint@9
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias committed Apr 25, 2024
1 parent 760274f commit 9346711
Show file tree
Hide file tree
Showing 111 changed files with 230 additions and 1,033 deletions.
110 changes: 0 additions & 110 deletions .eslintrc.json

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
node-version: 20
cache: 'yarn'
- run: yarn install --immutable --immutable-cache
- name: Typescript
run: yarn turbo tsc
- name: Eslint
run: yarn eslint .
- name: Validate package setup
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/has-npm-1.0.3-b7f00631c1-a449f3185b.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
68 changes: 68 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// @ts-check
import eslint from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import nodePlugin from 'eslint-plugin-n';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import eslintPluginUnicorn from 'eslint-plugin-unicorn';

export default tseslint.config(
{
ignores: [
'.git',
'node_modules',
'coverage',
'packages/*/dist/**',
'packages/*/node_modules/**',
'packages/*/__snapshots__/**',
],
},
{
languageOptions: {
globals: {
...globals.nodeBuiltin,
},
},
plugins: {
unicorn: eslintPluginUnicorn,
},
rules: {
'unicorn/no-abusive-eslint-disable': 'error',
'unicorn/prefer-module': 'error',
'unicorn/prefer-node-protocol': 'error',
},
},
eslint.configs.recommended,
nodePlugin.configs['flat/recommended-module'],
{
files: ['**/*.mts', '**/*.ts'],
extends: [...tseslint.configs.recommended],
},
{
files: ['**/*.cjs'],
extends: [nodePlugin.configs['flat/recommended-script']],
languageOptions: {
globals: {
...globals.node,
},
},
},
{
files: ['packages/inquirer/test/**', 'packages/**/*.test.*'],
rules: {
'n/no-extraneous-import': [
'error',
{
allowModules: ['vitest'],
},
],
'n/no-extraneous-require': [
'error',
{
allowModules: ['vitest'],
},
],
},
},
eslintPluginPrettierRecommended,
);
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,17 @@
],
"devDependencies": {
"@arethetypeswrong/cli": "^0.15.3",
"@eslint/js": "^9.1.1",
"@sindresorhus/tsconfig": "^5.0.0",
"@types/node": "^20.12.7",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"@vitest/coverage-v8": "^1.5.2",
"@vitest/ui": "^1.5.2",
"eslint": "^8.57.0",
"eslint": "^9.1.1",
"eslint-config-prettier": "^9.1.0",
"eslint-config-xo": "^0.44.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^17.3.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-unicorn": "^52.0.0",
"globals": "^15.0.0",
"globby": "^14.0.1",
"husky": "^9.0.11",
"lerna": "^8.1.2",
Expand All @@ -69,6 +67,7 @@
"ts-node": "^10.9.2",
"turbo": "^1.13.3",
"typescript": "^5.4.5",
"typescript-eslint": "^7.7.1",
"vitest": "^1.5.2"
},
"resolutions": {
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/lib/use-state.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { withPointer, handleChange } from './hook-engine.mjs';

// eslint-disable-next-line @typescript-eslint/ban-types
type NotFunction<T> = T extends Function ? never : T;

export function useState<Value>(
Expand Down
2 changes: 0 additions & 2 deletions packages/inquirer/examples/filter-validate-progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

import inquirer from '../lib/inquirer.js';

/* eslint-disable no-promise-executor-return */

const questions = [
{
type: 'input',
Expand Down
1 change: 0 additions & 1 deletion packages/inquirer/lib/objects/choice.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export default class Choice {
constructor(val, answers) {
// Don't process Choice and Separator object
if (val instanceof Choice || val.type === 'separator') {
// eslint-disable-next-line no-constructor-return
return val;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/inquirer/test/helpers/readline.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Object.assign(stub, {
const ReadlineStub = function () {
this.line = '';
this.input = new EventEmitter();
// eslint-disable-next-line prefer-rest-params

EventEmitter.apply(this, arguments);
};

Expand Down
1 change: 1 addition & 0 deletions packages/type/src/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export class CancelablePromise<T> extends Promise<T> {

export type Prettify<T> = {
[K in keyof T]: T[K];
// eslint-disable-next-line @typescript-eslint/ban-types
} & {};

export type PartialDeep<T> = T extends object
Expand Down

0 comments on commit 9346711

Please sign in to comment.