@rootreeweb/linting
v4.2.5
Published
Shared configurations for ESLint and Stylelint
Downloads
616
Readme
@rootreeweb/linting
What is This?
The package provides our standard configurations for ESLint, Prettier, and Stylelint.
Getting Started
The first step (if you haven't done so already) is to setup authentication for using our private packages. You can find instructions for doing that within the Rootree Web Wiki.
The second step is to add the library to your package file. This would typically be done with:
yarn add @rootreeweb/linting
ESLint
Separate modules are available as are common preset configurations. The presets can also add in additional modules as needed. An example of this would be a next site that is part of a TurboRepo.
All examples here belong in eslint.config.js
Preset
Available presets:
- presetBase
- presetReact
- presetNext
import { presetBase } from "@rootreeweb/linting";
export default presetBase;Mix and Match
Available modules:
- basic
- jsdoc
- react
- tailwind
- next
- turbo
import {
basic,
jsdoc,
next,
react,
tailwind,
turbo,
} from "@rootreeweb/linting";
const config = [
...basic,
...jsdoc,
...react,
...tailwind,
...next,
...turbo,
{
rules: {
"tailwindcss/no-contradicting-classname": "warn",
"tailwindcss/no-custom-classname": [
"warn",
{
callees: ["twMerge"],
},
],
},
},
{
ignores: ["data"],
},
];Next preset with TurboRepo example:
import { presetNext, turbo } from "@rootreeweb/linting";
export default [...presetNext, ...turbo];Stylelint
stylelint.config.js example:
import { stylelint } from "@rootreeweb/linting";
export default stylelint;