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

@veri.co/eslint-plugin-veri

v5.1.0

Published

Custom Eslint rules not available otherwise

Downloads

148

Readme

Eslint Plugin Veri

This package also shares common ESlint rules between different Veri projects.

What to include

Include common ESlint rules like basic Javascript, React and Node related rules that can be easily shared.

What not to include

Don't include rules that are specific to a technology that is only used in a single project. For example, don't include RealmJS related rules since at the time of writing this it's only used in Veri app. Hence no reason to share them with other projects.

How to use the shared linting rules

  1. Setup eslint in your project that is part of the monorepo.

  2. Inside the project, run:

    yarn add -D @veri.co/eslint-plugin-veri

  3. Then in .eslintrc add:

    plugins: [ "@veri.co/veri" ]

  4. To use presets, you also have to extend it:

    extends: [ "plugin:@veri.co/veri/node", "plugin:@veri.co/veri/react", "plugin:@veri.co/veri/react_native" ]

  5. Finally install required peer dependencies.

    • Node

      • yarn add -D eslint-plugin-jsx-falsy eslint-plugin-prettier eslint-plugin-simple-import-sort prettier eslint-plugin-node @waltari/eslint-plugin-ban-falsy-enum-values
    • React

      • yarn add -D eslint-plugin-react eslint-plugin-react-hooks
    • React Native

      • yarn add -D @react-native/eslint-config @react-native/eslint-plugin eslint-plugin-react-native

How to develop locally

  1. In eslint-plugin-veri folder run:

    yarn link

  2. Then in the projects folder you want to link it to e.g. app run:

    yarn link "@veri.co/eslint-plugin-veri"

  3. Now you can star making changes to config files which are under src/

  4. After you have done changes, build the configs

    yarn build

Now all the changes you make to eslint-plugin-veri are "copied" into the projects node_modules. Remember you still have to add "veri" to the plugins array in your .eslintrc file.

Note: You have to run yarn build every time you make some changes.

How to publish to npm

  1. Update package version number in package.json
  2. npm publish

Useful resources

Working with Abstract Syntax tree (AST)

Some useful resources are: https://astexplorer.net/ https://typescript-eslint.io/play/#ts=4.6.2&sourceType=module&showAST=es

In astexplorer you can even develop code for your rules and see in real time if they work with the AST. You can also add your own code and also see the resulting AST. Highly recommended to check it out if you start working with eslint rules.

In astexplorer try setting "ESLint v8" for Transform and "Typescript" for syntax. One difference between eslint-plugin-veri is that the rule listeners need to be "TSInterfaceDeclaration" instead of "InterfaceDeclaration" like in astexplorer in order to work. So make sure to append that "TS" prefix when working on eslint-plugin-veri on your computer, even though its not needed in astexplorer.