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

@aerisweather/eslint-plugin

v1.0.4

Published

This package provides AerisWeather's .eslintrc and custom [ESLint](https://eslint.org/) plugins as an extensible shared configuration.

Downloads

197

Readme

@aerisweather/eslint-plugin

This package provides AerisWeather's .eslintrc and custom ESLint plugins as an extensible shared configuration.

Dependencies

Our ESLint rules build on top of other existing configurations. The following third-party dependencies are required in your project to use this plugin: eslint, eslint-config-airbnb, eslint-plugin-import, and eslint-plugin-unicorn.

eslint-config-airbnb

A widely-used set of reasonable Javascript best practices and syntax formatting rules from AirBnB to use with ESLint. See their Javascript style guide for more details.

eslint-plugin-import

An ESLint plugin that intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names.

eslint-plugin-unicorn

Adds some additional rules not included in ESLint that are useful for adhering to a predefined set of coding best practices.

@typescript-eslint

Includes the parser and plugin required for ESLint to support Typescript.

Custom AerisWeather Rules

This plugin also includes some custom rules for our own projects and development. Many of these rules are borrowed from the eslint-plugin-putout package to be used without requiring the complete putout dependency.

Usage

  1. Install the package:

    npm install --dev @aerisweather/eslint-plugin
    yarn add -D @aerisweather/eslint-plugin
  2. Add plugin:@aerisweather/recommended to the extends property of your project's ESLint configuration:

    extends: ['plugin:@aerisweather/recommended']
  3. Add @aerisweather to the plugins property of your project's ESLint configuration:

    plugins: ['@aerisweather']

You can then lint your project's code using one of the following commands, where the latter will automatically fix issues when possible. This assumes your project's source code is located within the src directory:

eslint 'src/**/*.{js,ts,tsx}'
eslint --fix 'src/**/*.{js,ts,tsx}'

Commit Hooks

To ensure your code is properly linted and any issues are addressed before committing, you will want to set up a commit hook to run ESLint on your code.

For this we recommend using Husky, so install the required dependencies:

npm install --save-dev husky lint-staged
yarn add -D husky lint-staged

And add the following to your package.json:

"husky": {
    "pre-commit": "lint-staged",
    "pre-push": "yarn lint"
},
"lint-staged": {
    "**/*.{js,ts,tsx}": [
        "eslint --fix",
        "git add"
    ]
}

Now whenever you commit any change and that commit contains a Javascript or Typescript file, Husky will check if those files meet all the ESLint requirements or not. If not, it won't let you commit unless you fix those issues.

Setting Up Your IDE

You will typically want your IDE to lint and fix any issues when possible whenever you save changes to a file within your project. Set up one of the available ESLint plugins for your particular IDE.

What About Prettier?

Oftentimes you will see ESLint and Prettier used together such that Prettier is responsible for code formatting and ESLint is responsible for code smells and errors only. However, the two often don't work well together and can result in conflicting rules and results which makes for a miserable development experience.

Also, Prettier is a highly-opinionated tool and intentionally lacks the ability to override rules you don't necessarily agree with. This sounds great, but their rules favor better handling of git changes and conflicts and code reviews over proper structure and readability. This means it often forces your code into formats and structures that make it hard to read or follow from a developer perspective. It's also clear that the maintainers of Prettier feel strongly about not expanding the options and that plugin support isn't coming anytime soon.

ESLint is our preferred linter and formatter, and we don't recommend using both. ESLint is considerably more flexible and can automatically fix issues for you similar to Prettier, so it's better to just stick with it instead of trying to combine the two.