Skip to content

IgorKowalczyk/shared-configs

Repository files navigation

Shared Configs

♻️ Shareable configs

Package Version Downloads Documentation
📦 @igorkowalczyk/eslint-config Documentation
📦 @igorkowalczyk/prettier-config Documentation
📝 @igorkowalczyk/renovate-config - Documentation

Note

📦 - Package
📝 - Configuration file


📥 Installation

npm install --save-dev @igorkowalczyk/prettier-config
yarn add --dev @igorkowalczyk/prettier-config
pnpm install --save-dev @igorkowalczyk/prettier-config

🔩 Usage

// .prettierrc.js
module.exports = {
  ...require('@igorkowalczyk/prettier-config'),
};
// prettier.config.js
import prettierConfig from "@igorkowalczyk/prettier-config";

export default {
  ...prettierConfig,
};
{
  "extends": "@igorkowalczyk/prettier-config"
}

⚙️ Rules overview

Rule Style Documentation
arrowParens always Documentation
bracketSpacing true Documentation
embeddedLanguageFormatting auto Documentation
htmlWhitespaceSensitivity css Documentation
jsxSingleQuote false Documentation
printWidth 200000 Documentation
proseWrap preserve Documentation
quoteProps as-needed Documentation
requirePragma false Documentation
semi true Documentation
singleQuote false Documentation
tabWidth 1 Documentation
trailingComma es5 Documentation
useTabs false Documentation

📥 Installation

npm install --save-dev @igorkowalczyk/eslint-config
yarn add --dev @igorkowalczyk/eslint-config
pnpm install --save-dev @igorkowalczyk/eslint-config

🔩 Usage

Note

This package provides multiple ESLint configurations. You can use them in your project by importing the configuration you want to use.

Basic configuration

Basic configuration includes ESLint recommended rules, Prettier plugin and recommended rules for Prettier.

// eslint.config.js
import eslintConfig from "@igorkowalczyk/eslint-config";

export default [
 ...eslintConfig.base
];

Prettier configuration

This configuration includes recommended rules for Prettier

Warning

This configuration should be placed at the end of the configuration file! Otherwise, it may lead to unexpected behavior.

// eslint.config.js
import eslintConfig from "@igorkowalczyk/eslint-config";

export default [
  /* Other configurations */
 ...eslintConfig.prettier
];

Node.js configuration

Configuration includes recommended rules for Node.js projects.

// eslint.config.js
import eslintConfig from "@igorkowalczyk/eslint-config";

export default [
 ...eslintConfig.node
];

TypeScript configuration

Configuration includes TypeScript parser and recommended rules for TypeScript projects.

// eslint.config.js
import eslintConfig from "@igorkowalczyk/eslint-config";

export default [
 ...eslintConfig.typescript
];

React configuration

Configuration includes recommended rules for React components.

// eslint.config.js
import eslintConfig from "@igorkowalczyk/eslint-config";

export default [
 ...eslintConfig.react
];

Next.js configuration

Configuration includes recommended rules for Next.js projects.

// eslint.config.js
import eslintConfig from "@igorkowalczyk/eslint-config";

export default [
 ...eslintConfig.next
];

Tailwind CSS configuration

Configuration includes recommended rules for Tailwind CSS projects like sorting classes.

// eslint.config.js
import eslintConfig from "@igorkowalczyk/eslint-config";

export default [
 ...eslintConfig.tailwindcss
];

Astro configuration

Configuration includes Astro parser and recommended rules for Astro projects.

// eslint.config.js
import eslintConfig from "@igorkowalczyk/eslint-config";

export default [
 ...eslintConfig.astro
];

🔗 Chaining configurations

You can also chain multiple configurations together, for example, to use TypeScript and React configurations together.

// eslint.config.js
import eslintConfig from "@igorkowalczyk/eslint-config";

export default [
 ...eslintConfig.base,
 ...eslintConfig.typescript,
 ...eslintConfig.react
];

⚙️ Rules overview

You can find the full list of rules in the ESLint config inspector.


Warning

This is not a package - it is a configuration preset!

🔩 Usage

In your renovate.json file, add the following:

{
 "extends": ["github>igorkowalczyk/shared-configs//packages/renovate-config/index.json"]
}