Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@strv/eslint-config-react

Package Overview
Dependencies
Maintainers
4
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@strv/eslint-config-react

STRV's ESLint config for React projects

  • 4.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
158
decreased by-7.06%
Maintainers
4
Weekly downloads
 
Created
Source

@strv/eslint-config-react

STRV's ESLint config for React projects

Configurations

@strv/eslint-config-react

Use this ruleset to configure ESLint to work with React code.

@strv/eslint-config-react/optional

Use this ruleset in conjunction with the above ruleset. Provides additional insights into potential inconsistencies in the project.

For new projects, it is recommended to enable this ruleset. For existing projects, it is only recommended for the brave.

Coding styles

@strv/eslint-config-react/style

This ruleset includes rules which deal with how the code looks like and not how it works. It helps keeping the code clean and consistent. 🎨

// .eslintrc.js

'use strict'

module.exports = {
  extends: [
    '@strv/react',
    '@strv/react/optional',
    '@strv/react/style',
  ],
}
.eslintrc or .eslintrc.json
{
  "extends": [
    "@strv/react",
    "@strv/react/optional",
    "@strv/react/style"
  ]
}
package.json
{
  "eslintConfig": {
    "extends": [
      "@strv/react",
      "@strv/react/optional",
      "@strv/react/style"
    ]
  }
}

It is also recommended that you lint the whole project folder (ie. npx eslint .) instead of just some folders (ie. npx eslint src test) and create an .eslintignore file excluding any unwanted lint folders. Doing so will allow new directories to be created without worrying about having to update your tools to lint the new directory.

# .eslintignore

node_modules

# NOTE:
# The following directives are only relevant when linting the whole
# project directory, ie. running `eslint .` ⚠️

# If you compile JavaScript into some output folder, exclude it here
dist

# Highly recommended to re-include JavaScript dotfiles to lint them
# (This will cause .eslintrc.js to be linted by ESLint 🤘)
!.*.js

# Some tools use this pattern for their configuration files. Lint them!
!*.config.js

License

See the LICENSE file for information.

Keywords

FAQs

Package last updated on 18 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc