@under-io/eslint
v1.0.2
Published
Under engineering ESLint configurations
Downloads
8
Readme
Implementation
Battle tested: The
@under-io/eslintrules have been vetted across a broad set of projects, teams, and requirements. These rules embody a way of working that scales.Designed for Prettier: The
@under-io/eslintruleset is intentionally designed to be paired with the Prettier code formatter. This synergy streamlines development by sparing developers from being inundated with lint "errors" for minor concerns such as spaces and commas. These issues are resolved automatically when you save or commit a file. Prettier also circumvents unnecessary debates, as its default settings have undergone extensive community discussions and widespread adoption, eliminating the need to rehash established conventions.Explicit: The ruleset deliberately refrains from importing any "recommended" templates from other ESLint packages (other than comments). This choice alleviates concerns related to precedence issues arising from import order and mitigates the confusion associated with files overriding or undoing settings from one another. Instead, the ruleset takes a transparent approach by explicitly defining all the rules it deems important, ensuring clarity and consistency in rule configuration.
Minimal configuration: To implement this ruleset, you'll need to configure your eslint.config.mjs file with two lines of code. Our aim is to streamline repository maintenance by offering a concise collection of eslint.config.mjs configurations that can be shared across various projects. Occasionally, this approach may include rules that have no impact on a particular project. However, in practice, the cost of installing and executing unused rules proves to be minimal.
Getting Started
Implementing the ruleset into your project is an easy and straightforward process. Start by installing the package, then proceed to generate an eslint.config.mjs configuration file and export the Under eslint config.
Installation
To install the package, do this:
$ cd your-project-folder
$ npm install --save-dev eslint typescript @under-io/eslintAfter package installation, create an eslint.config.mjs config file in the root of your project and paste the following:
eslint.config.mjs
import Config from '@under-io/eslint'
export default ConfigThe @under-io/eslint ruleset is designed and intended to be used in conjunction with the Prettier code formatter. For general instructions on setting that up, please refer to the Prettier docs.
Making Changes
Testing changes locally before publishing is straightforward. The easiest way to test updates is by creating a .tgz package using npm pack and installing it in a local project.
Run the following command in the root of the repository:
npm packThis generates a .tgz file in the project directory, which bundles the package as it would appear when published.
In a separate project where you want to test the package, paste the .tgz file and run:
npm install /path/to/@under-io-eslint-1.0.0.tgzReplace @under-io-eslint-1.0.0.tgz with the name of the generated .tgz that you copied
Publishing
Publishing changes to @under-io/eslint follows an automated workflow using Changesets and our repository pipeline.
When you've finished making changes, run the Changeset CLI to generate a new version bump:
npm run changesetThis will prompt you to describe the change and determine whether it's a patch, minor, or major update.
Then commit and push the changes, including the generated changeset file. Once the PR is created, the pipeline takes over and handles publishing to npm automatically.
License
Distributed under the MIT License. See LICENSE.txt for more information.
@under-io/eslint is part of the Under family of projects.
