Giter Club home page Giter Club logo

eslint-config-werk85's People

Contributors

ankrut avatar david-zacharias avatar

Watchers

 avatar

Forkers

mlegenhausen

eslint-config-werk85's Issues

Naming convetions

Wollen wir diese - z.B. in SBF-Fragen 2.0 verwendete - Regeln in unser großes Regelset übernehmen?

 "@typescript-eslint/naming-convention": [
      "error",
      {
        "selector": [
          "variable",
          "typeProperty",
          "parameter"
        ],
        "types": [
          "boolean"
        ],
        "format": [
          "PascalCase"
        ],
        "prefix": [
          "can",
          "did",
          "disable",
          "has",
          "is",
          "should",
          "show",
          "will",
          "with",
          "$can",
          "$did",
          "$disable",
          "$has",
          "$is",
          "$should",
          "$show",
          "$will",
          "$with"
        ]
      }
    ]
  

Extract jest configuration from modern config

A new separate rule set should be created with the name werk85/jest that can be added on demand, this allows to use the modern rule in projects that do not use jest like the yacht-navigator-app.

Restrict import from lib-folders

In vielen Projekten haben wir folgend Regel um nicht aus lib/* Verzeichnissen zu importieren:

    "no-restricted-imports": [
      "error",
      {
        "patterns": [
          {
            "group": [
              "*/lib/*"
            ],
            "message": "Use the non lib import instead"
          }
        ]
      }
    ],

Add react rules

I found few interesting rules for react to ensure code style and eventual perfomance issues. I would like to add

'react/void-dom-elements-no-children': 'error',
'react/self-closing-comp': 'error',
'react/jsx-curly-brace-presence': ['error', 'never'],
'react/jsx-no-constructed-context-values': 'error'

Those are the most interesting I found from the list of rules of eslint-plugin-react apart from the recommended which are already added.

Another is

'react/jsx-no-useless-fragment': 'error'

though it is in conflict with our empty React component (i.e. <></>) which is then marked as useless.

Add arrow-body-style rule

I suggest to add the arrow-body-style rule, to ensure consistent styling of arrow bodies. I would take the default settings which seem most convenient.

The main motivation is to convert arrow functions with unnecessary block style to an expression style. An unnecessary block style would look like

const foo = () => {
  return 'bar'
}

// auto-fixable to
const foo = () => 'bar' 

The eslint rule is

'arrow-body-style': ['error', 'as-needed']

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.