npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

eslint-plugin-lintfix

v1.1.0

Published

ESLint auto fix plugins

Downloads

8

Readme

lintfix

Install & usage

npm i eslint-plugin-lintfix -D

add prefix "lintfix" to the rulename in eslintrc:

{
  "plugins": ["lintfix"],
  "rules": {
    "lintfix/jsx-a11y": ["error", { label: "my-label" }],
    "lintfix/boundary-types": ["error", { includeAny: false }],
    "lintfix/maxlen": ["error", { code: 180 }],
    "lintfix/console": "error",
    "no-console": ["error", { allow: ["error", "warn", "debug"]}] // allow error and warn 
  }
}
npx eslint . --fix

Supported rules

Name | Description ----- | ----- lintfix/eqeqeq | require the use of === and !== lintfix/ts-ignore | Disallow @ts- comments or require descriptions after directives. lintfix/no-unescaped | Disallow unnecessary escape characters. lintfix/boundary-types | Require explicit return and argument types on exported functions' and classes' public class methods. lintfix/implicit-any | The any type in TypeScript is a dangerous "escape hatch" from the type system. lintfix/no-unused-imports | Verifies that all named imports are part of the set of named exports in the referenced module. lintfix/no-unused-vars | Disallow unused variables. lintfix/console | Disallow the use of some console functions. lintfix/maxlen | Enforce a maximum line length. lintfix/prefer-const | Require const declarations for variables that are never reassigned after declared. lintfix/jsx-a11y | Enforce onClick is accompanied by at least one of the following: onKeyUp, onKeyDown, onKeyPress. lintfix/jsx-a11y | Enforce that a label tag has a text label and an associated control. lintfix/react | DisplayName allows you to name your component. This name is used by React in debugging messages. lintfix/no-duplicate-props | Creating JSX elements with duplicate props can cause unexpected behavior in your application.

Recommend Settings

module.exports = {
  plugins: ['@typescript-eslint', 'lintfix'],
  extends: [
    'eslint:recommended',
    'plugin:@typescript-eslint/recommended',
    'plugin:react/recommended',
    'plugin:jsx-a11y/recommended',
    'plugin:import/recommended'
  ],
  rules: {
    'lintfix/eqeqeq': 'error',
    'lintfix/ts-ignore': 'error',
    'lintfix/no-unescaped': 'error',
    'react/no-unescaped-entities': 'warn', // `'` can be escaped with `'`, `‘`, `'`, `’`  -> lintfix/no-unescaped
    'lintfix/boundary-types': ['error', { includeAny: false }],
    '@typescript-eslint/explicit-module-boundary-types': 'warn', // Argument '...' should be typed with a non-any type -> lintfix/boundary-types
    'lintfix/implicit-any': 'error',
    '@typescript-eslint/no-explicit-any': 'warn', // Unexpected any. Specify a different type -> lintfix/implicit-any
    'lintfix/no-unused-imports': 'error',
    'import/named': 'warn', // ... not found in '...' -> lintfix/no-unused-imports
    'lintfix/no-unused-vars': 'error',
    '@typescript-eslint/no-unused-vars': 'warn', // is defined but never used -> lintfix/no-unused-vars
    'lintfix/console': 'error',
    'no-console': ['error', { allow: ['error', 'warn', 'debug'] }], // Unexpected console statement -> lintfix/console
    'lintfix/maxlen': ['error', { code: 180 }],
    'max-len': 'off', // This line has a length of xxx. Maximum allowed is 80 -> lintfix/maxlen
    'lintfix/prefer-const': 'error',
    'prefer-const': 'off', // '...' is never reassigned. Use 'const' instead -> lintfix/prefer-const'
    'lintfix/jsx-a11y': 'error',
    'jsx-a11y/click-events-have-key-events': 'warn', // Visible, non-interactive elements with click handlers must have at least one keyboard listener -> lintfix/jsx-a11y
    'jsx-a11y/label-has-associated-control': 'warn', // A form label must be associated with a control -> lintfix/jsx-a11y
    'lintfix/react': 'error',
    'react/display-name': 'error', // Component definition is missing display name -> lintfix/react
    'lintfix/no-duplicate-props': 'error',
    'react/jsx-no-duplicate-props': 'warn', // No duplicate props allowed  -> lintfix/no-duplicate-props