Git Product home page Git Product logo

eslint-config's People

Contributors

tbhesswebber avatar

Watchers

 avatar

eslint-config's Issues

Naming Conventions doesn't allow numeric-prefixed properties

Rule

@typescript-eslint/naming-conventions

Current Behavior

Yells when using numbers as prefixes in properties

Desired Behavior

Should be able to use numbers and numerically prefixed values

const sizes = {
	3xl: "2rem";
}

Can do this by adding:

      {
        "selector": "property",
        "format": null,
        "filter": {
          "regex": "^[0-9]+",
          "match": true
        }
      }

Configuration(s) Used

  • default
  • core
  • typescript
  • react
  • format

Naming convention doesn't allow classes with PascalCase?

Rule

@typescript-eslint/naming-convention

Current Behavior

Yells about import SwaggerParser from "@apidevtools/swagger-parser"

Desired Behavior

Allow me to import it in PascalCase

Configuration(s) Used

  • default
  • core
  • typescript
  • react
  • format

Challenging to verify updates

We really should add a test directory that references this eslint configuration, validating that rule changes are actually being applied as we expect.

[RULE] Never prefer default exports unless a user supplies overrides

Rule

import/prefer-default-export

Current Behavior

Files with a single export error

VSCode Screenshot A screenshot of the error in a TS/NextJs codebase

Desired Behavior

We should generally prefer named exports in a file unless there are certain circumstances within a codebase (like next) where there are conventions for certain files.

Configuration(s) Used

  • default
  • core
  • typescript
  • react
  • format

[RULE] React Component files should not be kebab cased

Rule

unicorn/filename-case

Current Behavior

Yells about kebab-casing filenames for *.tsx files (probably also *.jsx).

VSCode Screenshot A screenshot showing the error in a TS/React application

Desired Behavior

Enforces pascal-case for React files

Configuration(s) Used

  • default
  • core
  • typescript
  • react
  • format

Allow magic numbers in certain contexts

Rule

@typescript-eslint/no-magic-number

Current Behavior

Errors in enums, numeric literals, type indices, and read-only class properties.

Desired Behavior

Should not error for enums, numeric literals, or read-only class properties. Type indices should be configured as needed because changes to function signatures have a much higher potential to increase hard to discover flake

Configuration(s) Used

  • default
  • core
  • typescript
  • react
  • format

[RULE] Prevent abbreviations yells about "Props" in React

Rule

unicorn/prevent-abbreviations

Current Behavior

Currently, the rule, when used with React, doesn't allow for the use of props in any form (see screenshot).

VSCode Screenshot An example of the above behavior in a TypeScript and React codebasessssssssssssssssssssssssssssssssssssss

Desired Behavior

While props is technically an abbreviation, it is semantically appropriate within a React codebase.

Configuration(s) Used

  • default
  • core
  • typescript
  • react
  • format

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.