Socket
Socket
Sign inDemoInstall

@uwhealth/linter-configs

Package Overview
Dependencies
271
Maintainers
5
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @uwhealth/linter-configs

Collection of linter configurations for front-end projects


Version published
Maintainers
5
Created

Readme

Source

Linter Configs

lerna

Collection of linter configurations for front-end projects. Allows for standardization across projects. Includes ESLint, StyleLint, and Prettier.

npm install @uwhealth/linter-configs -D

Individual configurations

This is a mono-repo of other configurations. So, installing the linter-configs module will install the other configurations as dependencies. If you just need eslint, prettier, or stylelint configurations, then you can install them individually.

# ESLint
npm install @uwhealth/eslint-config -D
# ESLint Environments
npm install @uwhealth/eslint-plugin-environments -D
# StyleLint
npm install @uwhealth/stylelint-config -D
# Prettier
npm install @uwhealth/prettier-config -D

Adding to a project

Within the configs of eslint or stylelint, add one of the following options:

ESLint

"extends": ["@uwhealth"]

There are also environments available as a dependency of this project. They are name-spaced as @uwhealth/environments.

"env": [
    "@uwhealth/environments/t4",
    "@uwhealth/environments/rhino",
    "@uwhealth/environments/webpack"
]

StyleLint

"extends": ["@uwhealth/stylelint-config"]

This will bring along all plugins and rules to each linter.

Prettier

Prettier configurations are embedded within the eslint and stylelint configurations, so you shouldn't need to do anything extra. But some editor plugins won't use embedded prettier configurations without the existence of a prettier file.

If formatting isn't working in your editor, try adding a .prettierrc.js file at the root of your project with this as its content:

module.exports = require('@uwhealth/prettier-config');

Repo Management

This repo uses Lerna to manage publishing and versioning.

Briefly, this means that all the configs live within this single repo (./packages), but are published as individual npm modules (e.g. @uwhealth/eslint-config, @uwhealth/stylelint-config, etc.). The top level package (where this README lives) essentially just imports the other packages (and brings those others as in as dependencies). This allows projects to import one or all the different configs. Using Lerna, you can make changes to any of the sub-packages and Lerna will decide what packages need to be published (and have their version changed).

If you are making modifications to this repo for the first time, you should run the following commands:

npm install
npm run start

This will make sure you're using the local versions of the dependencies (in the ./packages folder), instead of the packages downloaded from npm. You'll want this, since you're likely making changes to the packages as well as the root directory.

To publish new changes to npm, use the following command:

npx lerna publish

You'll be prompted to decide what type of update this is (patch, minor, major). Unless there's a API change that will affect projects currently using these configs, you should choose patch.

NOTE: You have to be logged into npm and github (in your CLI) in order to publish. (using npm login).

FAQs

Last updated on 08 Apr 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc