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

@scayle/eslint-config-storefront

v4.3.2

Published

SCAYLE Commerce Engine specific eslint configuration

Downloads

22,037

Readme

@scayle/eslint-config-storefront

A shared eslint config for SCAYLE Storefront projects and packages. Provides SCAYLE-specific eslint configuration for Frontend and Node.js projects using TypeScript.

We migrated to eslint@9 and ESLint Flat config, to provide improved organization and composition.

Should you require support for eslint@8, please use @scayle/eslint-config-storefront@3.


Install

Add the @scayle/eslint-config-storefront manually to your project:

pnpm i -D eslint @scayle/eslint-config-storefront

yarn add -D eslint @scayle/eslint-config-storefront

And create a eslint.config.mjs in your project root:

// eslint.config.mjs
import eslintConfigStorefront from '@scayle/eslint-config-storefront'

export default eslintConfigStorefront()

Add script for package.json

For example:

{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  }
}

VS Code support (auto fix on save)

Install VS Code ESLint extension

Add the following settings to your .vscode/settings.json:

{
  // Enable the ESlint flat config support
  "eslint.experimental.useFlatConfig": true,

  // Auto fix
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit",
    "source.organizeImports": "never"
  },

  // Enable eslint for all supported languages
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "vue",
    "html",
    "markdown",
    "json",
    "jsonc",
    "yaml"
  ]
}

Customization

Provides shared configurations

Default config / @scayle/eslint-config-storefront

Normally you only need to import the antfu preset:

// eslint.config.mjs
import eslintConfigStorefront from '@scayle/eslint-config-storefront'

export default eslintConfigStorefront()

Extended Configuration

// eslint.config.mjs
import eslintConfigStorefront from '@scayle/eslint-config-storefront'

export default eslintConfigStorefront({
  // If set to `true` removes all rule configurations
  // that are provided by the `@nuxt/eslint` package
  isNuxt: true, // Default via auto-detection of package `@nuxt/eslint`

  // If set to `true` adds `eslint-plugin-tailwind`
  isTailwind: true, // Default via auto-detection of package `eslint-plugin-tailwind`

  typescript: {
    // Enables type-aware rules
    // Only works if `isNuxt` is `false`!
    // <https://github.com/antfu/eslint-config?tab=readme-ov-file#type-aware-rules>
    tsconfigPath: 'path/to/tsconfig.ts',
  },
})

Plugins Renaming

Since flat config requires us to explicitly provide the plugin names (instead of the mandatory convention from npm package name), we renamed some plugins to make the overall scope more consistent and easier to write.

| New Prefix | Original Prefix | Source Plugin | | ---------- | ---------------------- | ------------------------------------------------------------------------------------------ | | import/* | import-x/* | eslint-plugin-import-x | | node/* | n/* | eslint-plugin-n | | yaml/* | yml/* | eslint-plugin-yml | | ts/* | @typescript-eslint/* | @typescript-eslint/eslint-plugin | | test/* | vitest/* | eslint-plugin-vitest | | test/* | no-only-tests/* | eslint-plugin-no-only-tests |

When you want to override rules, or disable them inline, you need to update to the new prefix:

-// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
+// eslint-disable-next-line ts/consistent-type-definitions
type foo = { bar: 2 }

View what rules are enabled

Anthony Fu built a visual tool to help you view what rules are enabled in your project and apply them to what files, @eslint/config-inspector.

Go into your project root that contains eslint.config.js and run:

npx @eslint/config-inspector

License

Licensed under the MIT License