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-config-ct-prodeng

v1.4.0

Published

Common linting rules for frontend web projects.

Downloads

758

Readme

Usage

  • Add eslint-config-ct-prodeng to your project's (dev-)dependencies.
  • Create a .eslintrc file at the root of your project or close to your JS code depending on your project settings.
  • Add the following content to your newly created .eslintrc file:
    {
    	"extends": "eslint-config-ct-prodeng"
    }
  • You can easily overwrite and extend this set of rules by adding your own rules in your project's .eslintrc file:
    {
      "extends": "...",
      "rules": {
        ...
      }
    }

Usage in IntelliJ

If you want to enable the linting rules for the .vue files in IntelliJ, you'll also have to add the vue plugin to your .eslintrc file:

  {
  	"extends": "eslint-config-ct-prodeng",
  	"plugins": [
  	  "vue"
  	]
  }

About Typescript-Linting

Enforced Rules

  • "@typescript-eslint/ban-ts-ignore": "warn"
    (this is a long term goal as we will probably have to use // @ts-ignore in the beginning)

  • "@typescript-eslint/camelcase": "warn" (no error because it is not enforced in Javascript yet [the default is: "@typescript-eslint/camelcase": ["error", { "properties": "always" }]])

  • "@typescript-eslint/indent": ["warn", 4, {"SwitchCase": 1}]
    (could be a long term goal if the indent rule from ESLint may not work correctly but could also be fixed in the future for TS files)

  • "@typescript-eslint/member-naming": ["warn", { "private": "^_"}]
    (optionally as we already name private methods with the prefix _*)

  • "@typescript-eslint/member-ordering": "error"
    (default order is: field, constructor, method)

  • "@typescript-eslint/no-for-in-array": "error"

  • "@typescript-eslint/no-require-imports": "warn"
    (this is a long term goal, because require-imports still appear in some projects and the d.ts-autocompletion [by esri] also uses them)

  • "@typescript-eslint/no-unnecessary-type-assertion": "warn"

  • "@typescript-eslint/no-useless-constructor": "error"

  • ~~"@typescript-eslint/prefer-interface": "error"~~
    ~~(This rule is deprecated. In the future we might have to use the following "@typescript-eslint/consistent-type-definitions": ["error", "interface"]. It is not clear to me when the update will happen, maybe in version 2.0.0)~~

  • "@typescript-eslint/consistent-type-definitions": ["error", "interface"] (this is a replacement for the "prefer-interface" rule. However this is not part of the recommended rules anymore, so should be discussed in the future.)

  • "@typescript-eslint/restrict-plus-operands": "error"


Suggested Rules

So far we are using the recommended rule set but in the future we could look into adjusting the rules to our needs. Here are some recommended rules:

  • "@typescript-eslint/adjacent-overload-signatures": "warn"

  • "@typescript-eslint/ban-types": "error"
    (the types we want to use need to be defined, e.g. string instead of String ["String": "Use string instead"]to use a common type pattern)

  • "@typescript-eslint/class-name-casing": "error"

  • "@typescript-eslint/explicit-function-return-type": "warn"

  • "@typescript-eslint/explicit-member-accessibility": "error"

  • "@typescript-eslint/interface-name-prefix": "never"
    (needs a decision on how we want to name interfaces but should then be enforced)

  • "@typescript-eslint/member-delimiter-style": "error"
    (The default requires semicolons)

  • "@typescript-eslint/no-array-constructor": "error"

  • "@typescript-eslint/no-empty-interface": "warn"

  • "@typescript-eslint/no-explicit-any": "warn"
    (another long term goal, however, we can already show warnings for explicit any usages and as soon as we have all the type definitions ready we can throw errors then)

  • "@typescript-eslint/no-misused-new": "warn"

  • "@typescript-eslint/no-namespace": "error"

  • "@typescript-eslint/no-non-null-assertion": "error"

  • "@typescript-eslint/no-parameter-properties": "error"

  • "@typescript-eslint/no-unused-vars": "error"
    (we already have this rule for our JS files)

  • "@typescript-eslint/no-use-before-define": "error"

  • "@typescript-eslint/type-annotation-spacing": "error"


see

all supported typescript rules

About vue-a11y-linting

An eslint plugin helping to support a11y in custom developed vue components. It will check for required ARIA attributes, roles and alternate keyboard events when defining @mouse... events. Currently, we are using the recommended set of rules. Documentation for the rules with passing and failing examples can be found in the docs.