UNPKG

@jsse/eslint-config

Version:

@jsse/eslint-config ~ WYSIWYG

114 lines (84 loc) 2.69 kB
# @jsse/eslint-config <sup> [![Version Badge][npm-version-svg]][package-url]</sup> Eslint config - eslint flat config - double quotes + semi - react, react-hooks & react-refresh, OH MY! - no vue (I don't use vue (as of 2023-10-12) don't want/need the vue plugins/parsers/etc) - assumes you're using prettier - Based on: - My old, very long, and very messy (non-flat) eslint config (`.eslintrc.js`) - antfu eslint-config [eslint-config](https://github.com/antfu/eslint-config) - sxzz eslint-config [eslint-config](https://github.com/sxzz/eslint-config) ## Usage ### Install ```bash pnpm i -D eslint @jsse/eslint-config ``` ### Create config file With [`"type": "module"`](https://nodejs.org/api/packages.html#type) in `package.json` (recommended): ```js // eslint.config.js import jsse from "@jsse/eslint-config"; export default jsse({ // options // typescript: { // tsconfigPath: "tsconfig.json", // or ["tsconfig.json", "tsconfig.eslint.json", ...] // }, // react: true }); ``` With CJS: ```js // eslint.config.js module.exports = require("@jsse/eslint-config").jsse({ // options // typescript: { // tsconfigPath: "tsconfig.json", // or ["tsconfig.json", "tsconfig.eslint.json", ...] // }, // react: true }); ``` > Note that `.eslintignore` no longer works in Flat config, see > [customization](#customization) for more details. ### Add script for package.json For example: ```json { "scripts": { "lint": "eslint .", "lint:fix": "eslint . --fix" } } ``` ### Type Aware Rules You can optionally enable the [type aware rules](https://typescript-eslint.io/linting/typed-linting/) by passing the options object to the `typescript` config: ```js // eslint.config.js import jsse from "@jsse/eslint-config"; export default jsse({ typescript: { tsconfigPath: "tsconfig.json", // or ["tsconfig.json", "tsconfig.eslint.json", ...] }, }); ``` ## Thanks - [antfu](https://github.com/antfu) and [sxzz](https://github.com/sxzz) for their eslint-configs which this is based on - Younger me for being more willing to spend time configuring eslint - My fans for being my fans ## FAQ ### Why use prettier? I DO NOT CARE ANYMORE... My current stance on formatters is pick one that is stable, and use it, preferably with the default config. A younger me (jessekrubin) would take the time to configure a formatter/linter/code style to my liking, but I really don't care anymore... ## License [MIT](./LICENSE) License &copy; 2023-PRESENT [jesse rubin](https://github.com/jessekrubin) [package-url]: https://www.npmjs.com/package/@jsse/eslint-config [npm-version-svg]: https://badge.fury.io/js/@jsse%2Feslint-config.svg