👮 Skyltmax Config

CI

Reasonable ESLint, Prettier, TypeScript, and Rubocop configs.

Based on @epic-web/config.

Installation

JavaScript/TypeScript

npm install --save-dev @signmax/config eslint prettier typescript
# or
pnpm add -D @signmax/config eslint prettier typescript

Every ESLint and Prettier plugin is a regular dependency of this package and resolves from here — consumers never declare plugins. The three CLIs are peer dependencies with version ranges (see peerDependencies): they must live in your project root so the eslint/prettier/tsc binaries and your editor's extensions can find them. Plugin versions are owned and tested in this repo and arrive via ordinary @signmax/config releases.

Ruby

Include the gem in your Gemfile:

gem "skyltmax_config"

Usage

Rubocop

Inherit the configs from the gem in your .rubocop.yml:

inherit_gem:
  skyltmax_config:
    - rubocop.yml
    - rubocop.rails.yml

Prettier

The easiest way to use this config is in your package.json:

"prettier": "@signmax/config/prettier"
Customizing Prettier

If you want to customize things, you should probably just copy/paste the built-in config. But if you really want, you can override it using regular JavaScript stuff.

Create a .prettierrc.js file in your project root with the following content:

import defaultConfig from "@signmax/config/prettier"

/** @type {import("prettier").Options} */
export default {
  ...defaultConfig,
  // .. your overrides here...
}

TypeScript

Create a tsconfig.json file in your project root with the following content:

{
  "extends": ["@signmax/config/typescript"],
  "include": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
  "compilerOptions": {
    "paths": {
      "#app/*": ["./app/*"],
      "#tests/*": ["./tests/*"]
    }
  }
}

Create a reset.d.ts file in your project with these contents:

import "@signmax/config/reset.d.ts"
Customizing TypeScript

Learn more from the TypeScript docs here.

ESLint

Create a eslint.config.js file in your project root with the following content:

import { config as defaultConfig } from "@signmax/config/eslint"

/** @type {import("eslint").Linter.Config[]} */
export default [...defaultConfig]
Customizing ESLint

Learn more from the Eslint docs here.

There are endless rules we could enable. However, we want to keep our configurations minimal and only enable rules that catch real problems (the kind that are likely to happen). This keeps our linting faster and reduces the number of false positives.

Publishing

This repo publishes a Ruby gem (skyltmax_config) and an npm package (@signmax/config) whenever a GitHub Release is published. A manual run is also available.

Setup (one-time):

  • In rubygems and npmjs configure trusted publishing.
  • Ensure package and gem versions match. The workflow verifies that the git tag version equals both versions.

How to release:

  1. Update versions:
    • package.json: "version": "x.y.z"
    • lib/skyltmax_config/version.rb: VERSION = "x.y.z"
  2. Commit and push changes.
  3. Create a Git tag vX.Y.Z and a GitHub Release for that tag (or run the "Publish release" workflow with that ref).

What the workflow does:

  • Verifies tag version matches package.json and version.rb
  • Publishes the npm package with provenance enabled
  • Builds and pushes the gem to RubyGems

License

MIT