@averay/codeformat

0.1.14 • Public • Published

@averay/codeformat

A very opinionated collection of configurations for a number of code formatting tools.

Default Usage

  1. Install the package with npm i -D @averay/codeformat

  2. Symlink the static configuration files to the project root:

    ln -s node_modules/@averay/codeformat/.editorconfig node_modules/@averay/codeformat/.prettierrc.json ./
  3. Import and call the relevant configuration builders for specific tools

  4. Lint the codebase with npx codeformat check, or apply automatic fixes with npx codeformat fix

ESLint

Create an eslint.config.js file and create the configuration:

// eslint.config.js
import { makeEslintConfig } from '@averay/codeformat';

export default [
  {
    ignores: ['dist/**/*'],
  },
  ...makeEslintConfig({ tsconfigPath: './tsconfig.json' }),
  // Custom overrides can be added here
];

Stylelint

Create a stylelint.config.cjs file and create the configuration:

// stylelint.config.cjs
const { makeStylelintConfig } = require('@averay/codeformat');

module.exports = makeStylelintConfig();

(Stylelint does not currently support ESM so a .cjs file with CommonJS import & export syntax must be used)

/@averay/codeformat/

    Package Sidebar

    Install

    npm i @averay/codeformat

    Weekly Downloads

    15

    Version

    0.1.14

    License

    none

    Unpacked Size

    191 kB

    Total Files

    12

    Last publish

    Collaborators

    • adamaveray