Skip to content

invoke-ai/code-quality-configs

Repository files navigation

Code Quality Configs

A selection of code quality configs intended for use in Invoke's applications.

Usage - Templates

The templates must be copied and pasted.

Usage - NPM Packages

Be sure to install the peer dependencies.

You may need to add auto-install-peers=true to your .npmrc for this to happen automatically.

eslint-config-react

  1. Install the package.

    pnpm i -D @invoke-ai/eslint-config-react
  2. Extend the config in your eslint config. You can then override any rules per usual.

    // .eslintrc.cjs
    module.exports = {
      extends: ['@invoke-ai/eslint-config-react'],
      rules: {
        'i18next/no-literal-string': 'off', // no i18n here
      },
    };

prettier-config-react

  1. Install the package.

    pnpm i -D @invoke-ai/prettier-config-react
  2. Spread the config in your prettier config. You can then override any individual rules by specifying them after the spread.

    // .prettierrc.cjs
    module.exports = {
      ...require('@invoke-ai/prettier-config-react'),
      printWidth: 9001, // slightly increase printWidth
    };