npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@paro-paro/eslint-config

v1.2.1

Published

ESLint config preset by @paro-paro

Downloads

25

Readme

@paro-paro/eslint-config

npm

ESLint config preset for JavaScript, TypeScript, JSX, TSX, Vue, JSON, Yaml, Markdown, JSDoc and more.

Credit: sxzz & antfu

Features

  • One line setup! :rocket:

  • ESLint for both linting and formatting :wrench:

  • Flat config. No prettier :sunglasses:

  • Fully customizable. Easily composable :ok_hand:

  • Vue auto-detection :sparkles:

  • First class TypeScript support :heart:

  • Strict, although reasonable, out-of-the-box preset :muscle:

  • Powered by @stylistic and more :point_down:

Install

Use your favorite package manager.

pnpm add -D @paro-paro/eslint-config

Requires eslint >= 8.21.0

Usage

eslint.config.js

import { paroparo } from '@paro-paro/eslint-config'

export default paroparo()

And that's it!

Note: This setup assumes that you are using ESM in your project.

Even though is highly discouraged, you can use CommonJS as well.

const { paroparo } = require('@paro-paro/eslint-config')

module.exports = paroparo()

Note: ts/no-var-requires and ts/no-require-imports errors are thrown when using CommonJS syntax.

Configuration

Make sure you read the ESLint flat config documentation first.

import { paroparo } from '@paro-paro/eslint-config'

export default paroparo(
  {
    // configuration options (see below)
  },

  // extend or override the default configuration by passing any number of flat config objects!
  {
    files: ['**/*.ts'],
    rules: {
      'no-console': 'off',
    },
  },

  {
    files: ['**/*.vue'],
    rules: {
      'vue/component-name-in-template-casing': ['warn', 'kebab-case'],
    },
  },

  // ...
)

VS Code

Install VS Code ESLint extension and configure it to your liking.

{
  "prettier.enable": false,
  "eslint.experimental.useFlatConfig": true,
  "eslint.validate": ["typescript", "json"]
}

Editor auto-fixing: :boom:

{
  "editor.formatOnSave": false,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true,
    "source.organizeImports": false
  }
}

Editor customizations :boom:

{
  "eslint.rules.customizations": [
    {
      "rule": "stylistic/*",
      "severity": "off"
    },
    {
      "rule": "perfectionist/*",
      "severity": "info"
    }
  ]
}

Configuration Options

Types

function paroparo(options?: ConfigOptions, ...userConfigs: FlatESLintConfigItem[]): FlatESLintConfigItem[]

interface ConfigOptions {
  ts?: boolean
  vue?: boolean
  json?: boolean
  yml?: boolean
  markdown?: boolean
  jsdoc?: boolean
  stylistic?: boolean
  sort?: boolean
  globals?: boolean
  ignores?: IgnoresOptions | boolean
  gitignore?: GitIgnoreOptions | boolean
  tsOptions?: TsOptions
  stylisticOptions?: StylisticOptions
  renameRules?: boolean
}

Details

  • Rules for ts and vue will be automatically enabled if related packages are locally installed.

  • Rules for json, yml, markdown, jsdoc and stylistic are enabled by default.

  • Use the appropiate option to explicitly enable or disable them.

  • Use the sort option if you want to disable sort related rules.

  • Use the globals option if you do not want to include the predefined set of globals.

  • Use the ignores option if you need to disable, extend or override the predefined set of excluded globs.

  • eslint-config-flat-gitignore package is supported through the gitignore option (disabled by default).

  • To enable type aware linting use the tsOptions object. The preset does not include any of these rules by default. Check docs for details.

  • Customize quotes, semi and indentation using the stylisticOptions object.

  • Both tsOptions and stylisticOptions objects have no effect if ts or stylistic options are explicitly disabled.

Supported plugins

| Plugin | Rules's prefix | | --- | --- | | @stylistic/eslint-plugin | stylistic/* | | @typescript-eslint/eslint-plugin | ts/* | | eslint-config-flat-gitignore | - | | eslint-plugin-antfu | antfu/* | | eslint-plugin-eslint-comments | eslint-comments/* | | eslint-plugin-i | import/* | | eslint-plugin-jsdoc | jsdoc/* | | eslint-plugin-jsonc | jsonc/* | | eslint-plugin-markdown | - | | eslint-plugin-n | node/* | | eslint-plugin-perfectionist | perfectionist/* | | eslint-plugin-sort-exports | sort-exports/* | | eslint-plugin-unicorn | unicorn/* | | eslint-plugin-unused-imports | unused-imports/* | | eslint-plugin-vue | vue/* | | eslint-plugin-yml | yml/* |

Set renameRules to false in case you want to use @stylistic and @typescript-eslint instead.

This option does not apply to any other plugin.

Wiki

You can read more about the rationale behind not using prettier in this great post from Anthony Fu.

Also, there is a great utility package for debugging your ESLint flat config (Anthony, again :astonished:).

All credit to his outstanding and inspirational work.

Check also

License

MIT License © 2023-PRESENT Antonio Parody