@entryscape/linting-config
v1.1.1
Published
Shared ESLint and Prettier configurations for MetaSolutions AB projects
Readme
@entryscape/linting-config
Shared ESLint and Prettier configurations for MetaSolutions AB projects.
Installation
pnpm add -D bitbucket:metasolutions/linting-config#main eslint prettierThis will be changed to the below line once we get around to publishing to NPM (and then this part of the readme should be removed)
pnpm add -D @entryscape/linting-config eslint prettierQuick Setup
Generate config files using the included CLI tool:
# Default (base config)
pnpm lint-setup
# Node.js project
pnpm lint-setup --eslint=node
# React project with prettier config
pnpm lint-setup --eslint=react --prettier
# Multiple configs
pnpm lint-setup --eslint=base,react --prettierCLI Options
| Option | Description |
|--------|-------------|
| --eslint=<configs> | Comma-separated list: base, node, react (default: base) |
| --prettier | Generate prettier.config.js |
| --help | Show help message |
Manual Configuration
ESLint
Create eslint.config.js in your project root:
Single config:
Available configs are base, node and react
All configs include the base config
import { node } from '@entryscape/linting-config';
export default [
...node,
{
rules: {
// Your overrides
},
},
];Mixed config:
import { react, node } from '@entryscape/linting-config';
export default [
...node,
...react,
{
rules: {
// Your overrides
},
},
];Prettier
Option 1: Via package.json (no extra file)
{
"prettier": "@entryscape/linting-config/prettier"
}Option 2: Via config file (allows overrides)
import config from '@entryscape/linting-config/prettier';
export default {
...config,
// Local overrides
// printWidth: 120,
// tabWidth: 4,
};Available Configurations
| Export | Description |
|--------|-------------|
| base (default) | General JavaScript rules |
| node | Node.js environment rules |
| react | React rules with Hooks and a11y |
Development
# Lint the package itself
pnpm lint
# Test configs against fixtures
pnpm test