@virtuallyunknown/eslint-config
v0.1.3
Published
Common ESLint configurations.
Downloads
17
Maintainers
Readme
Installation:
- Install the package:
npm i @virtuallyunknown/eslint-config -D
pnpm add @virtuallyunknown/eslint-config -D
- Create
eslint.config.js
file and add the following:
import {
eslintBaseConfig,
eslintPluginTypescriptConfig,
eslintPluginUnicornConfig,
eslintPluginReactConfig,
eslintPluginStylisticConfig,
globals,
} from "@virtuallyunknown/eslint-config";
/** @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigFile} */
export default [
...eslintBaseConfig,
...eslintPluginTypescriptConfig,
...eslintPluginUnicornConfig,
...eslintPluginReactConfig,
...eslintPluginStylisticConfig,
{
files: ["src/**/*.{ts,tsx}"],
languageOptions: {
/**
* parserOptions.project is optional since it's
* included in the typescript plugin configuration.
*/
parserOptions: {
project: true,
},
globals: {
/**
* or other environments
*/
...globals.browser,
},
},
linterOptions: {
noInlineConfig: false,
reportUnusedDisableDirectives: true,
},
},
{
ignores: ["**/*.{js,cjs,mjs}"],
},
];
Additional configurations (not bundled with this package)
eslint-plugin-tailwindcss
npm i eslint-plugin-tailwindcss -D
pnpm add eslint-plugin-tailwindcss -D
import eslintPluginTailwindCss from "eslint-plugin-tailwindcss";
const eslintPluginTailwindCssConfig = [
{
plugins: {
tailwindcss: eslintPluginTailwindCss,
},
rules: eslintPluginTailwindCss.configs.recommended.rules,
},
];