Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jellydn/eslint-fixer

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jellydn/eslint-fixer

Welcome to @jellydn/eslint-fixer 👋

  • 0.2.1-0
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
0
Weekly downloads
 
Created
Source

Welcome to @jellydn/eslint-fixer 👋

Version

Motivation

Until this ☂️ Type-aware linter · Issue #3187 · biomejs/biome is resolved, we continue to use @typescript-eslint/parser and @typescript-eslint/eslint-plugin to lint TypeScript files.

Add the following recommended rules to your ESLint configuration for effective linting of TypeScript files:

{
  "@typescript-eslint/await-thenable": "error",
  "@typescript-eslint/no-floating-promises": "error",
  "@typescript-eslint/no-for-in-array": "error",
  "@typescript-eslint/no-misused-promises": "error",
  "@typescript-eslint/no-redundant-type-constituents": "error",
  "@typescript-eslint/no-unnecessary-type-assertion": "error",
  "@typescript-eslint/require-await": "error"
}

Usage

To use eslint-fixer, follow these steps:

# Install eslint-fixer
npm install --global @jellydn/eslint-fixer

# Run eslint-fixer
npx @jellydn/eslint-fixer "examples/**/*.ts"

How to use with Neovim

To use eslint-fixer with lazy.nvim and nvim-lint. What you need is add below to your custom linter.

return {
  {
    "mfussenegger/nvim-lint",
    event = "VeryLazy",
    opts = {
      linters_by_ft = {
        ["*"] = { "cspell", "codespell" },
        javascript = { "oxlint" },
        typescript = { "oxlint", "eslint_fixer" },
        javascriptreact = { "oxlint" },
        typescriptreact = { "oxlint" },
      },
    },
    init = function()
      -- Register customer linter
      require("lint").linters.eslint_fixer = {
        name = "eslint_fixer",
        cmd = "eslint-fixer", -- e.g: npm install -g @jellydn/eslint-fixer
        stdin = false,
        stream = "stdout",
        ignore_exitcode = true,
        parser = function(output, bufnr)
          local trimmed_output = vim.trim(output)
          if trimmed_output == "" then
            return {}
          end
          -- Skip if Parsing error on output
          if string.match(trimmed_output, "Parsing error") then
            return {}
          end

          -- Parse output base on Eslint errorformat
          local diagnostic = require("lint.parser").from_errorformat("%f %l:%c %m", {
            error = vim.diagnostic.severity.ERROR,
          })(trimmed_output, bufnr)

          return diagnostic
        end,
      }
    end,
    config = function(_, opts)
      -- Your setup here
    end,
  },
}

GitHub Actions

To use eslint-fixer in GitHub Actions, follow these steps:

name: ESLint Fixer

on:
  push:
    branches:
      - main

jobs:
  eslint-fixer:
    name: ESLint Fixer
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npx --yes @jellydn/eslint-fixer@0.2.0 "examples/**/*.ts" # change to the latest release
  oxlint:
    name: Lint JS
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npx --yes oxlint@0.0.0 --deny-warnings # change to the latest release
  quality:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Setup Biome
        uses: biomejs/setup-biome@v2
        with:
          version: latest
      - name: Run Biome
        run: biome ci .

How to publish

make build
npm publish --access public

Resources

Show Your Support

If this project has helped you, please give it a ⭐️!

Keywords

FAQs

Package last updated on 11 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc