Coder Social home page Coder Social logo

eslint-interactive's People

Contributors

adidahiya avatar deeeeksha avatar mizdra avatar odanado avatar renovate-bot avatar renovate[bot] avatar sisisin avatar stevenmusumeche avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

eslint-interactive's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • Update dependency eslint to v9
  • Update pnpm to v9

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
.devcontainer/Dockerfile
github-actions
.github/workflows/benchmark.yml
  • actions/checkout v3
  • actions/setup-node v3
  • actions/cache v3
.github/workflows/ci-node.yml
  • actions/checkout v3
  • actions/setup-node v3
  • actions/checkout v3
  • actions/setup-node v3
  • actions/checkout v3
  • actions/setup-node v3
npm
e2e-test/flat-config/package.json
e2e-test/global-installation/package.json
  • npm 8.14.0
e2e-test/import-as-esm-from-esm/package.json
package.json
  • boxen ^7.1.1
  • chalk ^5.3.0
  • comlink ^4.4.1
  • enquirer ^2.4.1
  • eslint-formatter-codeframe ^7.32.1
  • estraverse ^5.3.0
  • find-cache-dir ^5.0.0
  • is-installed-globally ^1.0.0
  • ora ^7.0.1
  • strip-ansi ^7.1.0
  • table ^6.8.1
  • terminal-link ^3.0.0
  • yargs ^17.7.2
  • @mizdra/eslint-config-mizdra 2.1.0-alpha.0
  • @mizdra/inline-fixture-files ^1.1.0
  • @mizdra/prettier-config-mizdra ^1.0.0
  • @tsconfig/node18 ^18.2.2
  • @tsconfig/strictest ^2.0.2
  • @types/eslint ^8.44.6
  • @types/estraverse ^5.1.6
  • @types/estree ^1.0.5
  • @types/fs-extra ^11.0.4
  • @types/node ^20.8.10
  • @types/yargs ^17.0.29
  • dedent ^1.5.1
  • eslint ^8.57.0
  • fs-extra ^11.1.1
  • import-meta-resolve ^4.0.0
  • npm-run-all ^4.1.5
  • prettier 3.0.3
  • stream-match ^4.1.0
  • typescript ^5.2.2
  • vitest ^1.1.0
  • vitest-github-actions-reporter ^0.10.0
  • node >=18.0.0
  • pnpm 8.9.0

  • Check this box to trigger a request for Renovate to run again on this repository

Fails to start on Ubuntu

log:

$ yarn run eslint-interactive .
/usr/bin/env: ‘node -r source-map-support/register’: No such file or directory
/usr/bin/env: use -[v]S to pass options in shebang lines

Environments

  • OS: Ubuntu
  • OS version: 21.04 (hirsute)
  • Node.js version: 16.13.1
  • npm version: 8.1.2
  • Yarn version: 1.22.17

More tests

I want to add more tests because there are some modules that have insufficient amount of tests or don't exist at all.

`applySuggestion` action causes ENOENT

✔ Found errors.

- 9 files (2 files passed, 7 files failed) checked.
- 32 problems (31 errors, 1 warning) found.
┌─────────────────────────────┬────────────────────────────────────┬──────────────────────────────────────┐
│ Rule                        │ Error (fixable/suggest-applicable) │ Warning (fixable/suggest-applicable) │
├─────────────────────────────┼────────────────────────────────────┼──────────────────────────────────────┤
│ semi                        │ 15 (15/0)                          │ 1 (1/0)                              │
├─────────────────────────────┼────────────────────────────────────┼──────────────────────────────────────┤
│ import/order                │ 3 (3/0)                            │ 0 (0/0)                              │
├─────────────────────────────┼────────────────────────────────────┼──────────────────────────────────────┤
│ prefer-const                │ 4 (4/0)                            │ 0 (0/0)                              │
├─────────────────────────────┼────────────────────────────────────┼──────────────────────────────────────┤
│ no-unused-vars              │ 5 (0/0)                            │ 0 (0/0)                              │
├─────────────────────────────┼────────────────────────────────────┼──────────────────────────────────────┤
│ ban-exponentiation-operator │ 3 (0/0)                            │ 0 (0/0)                              │
├─────────────────────────────┼────────────────────────────────────┼──────────────────────────────────────┤
│ null                        │ 1 (0/0)                            │ 0 (0/0)                              │
└─────────────────────────────┴────────────────────────────────────┴──────────────────────────────────────┘
✔ Which rules would you like to apply action? · semi
✔ Which action do you want to do? · applySuggestion
[Error: ENOENT: no such file or directory, open '/var/folders/dg/hj_fw8n16tv1mttdsnvxzk6r0000gn/T/eslint-interactive/filter-script/semi.js'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/var/folders/dg/hj_fw8n16tv1mttdsnvxzk6r0000gn/T/eslint-interactive/filter-script/semi.js'
}

Usage

2021-01-05.23.53.35.mov

Support Programmable API

Core is the heart of eslint-interactive. By exporting it, the user can programmatically fix problems or apply suggestions.

Add missing dependencies

There are a few packages that are directly dependent on it that are not included in package.json.

Change spinner design

Change the design of the spinner so that it doesn't bore the user and also makes them smile :)

Pass `TransformContext` to `SuggestionFilter` and `FixableMaker`

  • RuleFixer is ESLint's API.
  • This allows the user to intuitively generate Rule.Fix.
function fixableMaker(fixer, message, node) {
  if (!node) return null;
  if (!node.range) return null;

  if (message.ruleId === 'no-unused-vars' || message.ruleId === '@typescript-eslint/no-unused-vars') {
    if (node.type !== 'Identifier') return null;
-    return {
-      range: [node.range[0], node.range[0]],
-      text: '_',
-    };
+    return fixer.insertTextBefore(node, '_');
  } else {
    return null;
  }
}

Error: The codeframe formatter is no longer part of core ESLint.

log:

✔ What format do you want to display the problem message in? · withPager
Error: The codeframe formatter is no longer part of core ESLint. Install it manually with `npm install -D eslint-formatter-codeframe`
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:93:18)
    ...

Cannot write `patterns` after options

If you write the following, it will not work as expected.

eslint-interactive --ext .ts,.tsx,.vue src

This is equivalent to the behavior as if .ts,.tsx,.vue and src were passed to the ext option, according to the yargs specification (yargs/yargs#1848).

eslint-interactive --ext .ts,.tsx,.vue --ext src

This confuses for the user because it is interpreted differently than eslint.

Workaround

You can avoid this problem by always writing the directory patterns first.

eslint-interactive src --ext .ts,.tsx,.vue

Refactor `src/rules/`

The duplication rate of the code under src/rules/ is high. It needs to be refactored.

The number of errors and the number of files from which the errors originated are reversed

Actual:

✔ Found errors.

8 file(s) checked.  2 passed.  6 failed.  30 file(s)  1 file(s).
┌─────────────────────────────┬─────────────────┬───────────────────┐
│ Rule                        │ Error (fixable) │ Warning (fixable) │
├─────────────────────────────┼─────────────────┼───────────────────┤
│ semi                        │ 15 (15)         │ 1 (1)             │
├─────────────────────────────┼─────────────────┼───────────────────┤
│ import/order                │ 3 (3)           │ 0 (0)             │
├─────────────────────────────┼─────────────────┼───────────────────┤
│ prefer-const                │ 4 (4)           │ 0 (0)             │
├─────────────────────────────┼─────────────────┼───────────────────┤
│ no-unused-vars              │ 5 (0)           │ 0 (0)             │
├─────────────────────────────┼─────────────────┼───────────────────┤
│ ban-exponentiation-operator │ 3 (0)           │ 0 (0)             │
└─────────────────────────────┴─────────────────┴───────────────────┘

Expected:

✔ Found errors.

8 file(s) checked.  2 passed.  6 failed.  30 file(s)  1 file(s).
...

Spinner freezes

Since we are currently running the Core API on the main thread, the spinner will freeze while running. I want to run the Core API on a worker so that the spinner doesn't freeze.

Undo action

Sometimes users want to re-run an action multiple times while changing options.

It would be useful to have a way to restore the file modified by the action and resume from entering the action's options.

`Error: Cannot find module 'source-map-support/register'`

$ npm un source-map-support
$ npm un -g source-map-support
$ npm i -g @mizdra/eslint-interactive
$ eslint-interactive --version
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'source-map-support/register'
Require stack:
- internal/preload
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at Module._preloadModules (node:internal/modules/cjs/loader:1272:12)
    at loadPreloadModules (node:internal/bootstrap/pre_execution:474:5)
    at prepareMainThreadExecution (node:internal/bootstrap/pre_execution:77:3)
    at node:internal/main/run_main_module:7:1 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'internal/preload' ]
}

Node.js v17.2.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.