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 6a18ae8 commit 1d94a35
Show file tree
Hide file tree
Showing 109 changed files with 281 additions and 978 deletions.
98 changes: 0 additions & 98 deletions .eslintrc.json

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/main.yml
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 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.
68 changes: 68 additions & 0 deletions eslint.config.js
@@ -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,
);
15 changes: 7 additions & 8 deletions package.json
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.1",
"@vitest/ui": "^1.5.1",
"eslint": "^8.57.0",
"@vitest/coverage-v8": "^1.5.2",
"@vitest/ui": "^1.5.2",
"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,7 +67,8 @@
"ts-node": "^10.9.2",
"turbo": "^1.13.2",
"typescript": "^5.4.5",
"vitest": "^1.5.1"
"typescript-eslint": "^7.7.1",
"vitest": "^1.5.2"
},
"resolutions": {
"type-fest": "^4.0.0"
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/lib/use-state.mts
@@ -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
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
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
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
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 1d94a35

Please sign in to comment.