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

eslint-config-zl-asica

v1.0.17

Published

A shareable and reusable Eslint configuration by ZL-Asica.

Downloads

824

Readme

eslint-config-zl-asica

npm version License code style: eslint Sponsor

English | 中文

A shareable and reusable ESLint configuration by ZL Asica, designed to provide consistent linting rules across JavaScript, TypeScript, and React projects with Prettier compatibility. (For Prettier configuration, please check here)

Table of Contents

Installation

Install this package as a development dependency in your project (npm 7+):

npm install --save-dev eslint eslint-config-zl-asica
# or with Yarn
yarn add -D eslint eslint-config-zl-asica
# or with pnpm
pnpm add -D eslint eslint-config-zl-asica

Usage

This configuration offers three modular configurations: default (JavaScript), TypeScript, and React. You can import each as needed.

Basic Usage (JavaScript Projects)

For JavaScript projects, import the base configuration:

// `eslint.config.js` or `eslint.config.mjs`
import { zlAsicaConfig } from 'eslint-config-zl-asica';

export default [
  ...zlAsicaConfig,

  // Custom modifications
  {
    rules: {
      'no-console': 'warn',
    },
  },
];

TypeScript Projects

For TypeScript projects, use zlAsicaTsConfig, which includes the base configuration plus TypeScript rules:

// `eslint.config.js` or `eslint.config.mjs`
import { zlAsicaTsConfig } from 'eslint-config-zl-asica';

export default [
  ...zlAsicaTsConfig,

  // Custom modifications
  {
    rules: {
      'no-console': 'warn',
    },
  },
];

React Projects

For React projects, use zlAsicaReactConfig, which includes the base configuration plus React rules:

// `eslint.config.js` or `eslint.config.mjs`
import { zlAsicaReactConfig } from 'eslint-config-zl-asica';

export default [
  ...zlAsicaReactConfig,

  // Custom modifications
  {
    rules: {
      'no-console': 'warn',
    },
  },
];

TypeScript + React Combined

For projects using both TypeScript and React, use zlAsicaTsReactConfig, a combination of all configurations:

// `eslint.config.js` or `eslint.config.mjs`
import { zlAsicaTsReactConfig } from 'eslint-config-zl-asica';

export default [
  ...zlAsicaTsReactConfig,

  // Custom modifications
  {
    rules: {
      'no-console': 'warn',
    },
  },
];

Configuration Details

This configuration includes the following rule sets and plugins:

  • JavaScript Rules: Consistent formatting and style conventions for JavaScript (and jsx).
  • TypeScript Rules: Type-safe coding standards for TypeScript projects.
  • React Rules: React-specific rules for React and React hooks.
  • Prettier Compatibility: Integrates eslint-config-prettier to disable formatting rules that might conflict with Prettier.

Plugins and Settings

  • import/ignore: Ignores CSS and other stylesheets for imports.
  • import/order: External first then internal, newline in between.
  • React Version Detection: Automatically detects the installed React version.

Why Use This Configuration?

This configuration ensures:

  • A consistent code style across multiple projects.
  • Easy integration with JavaScript, TypeScript, and React projects.
  • Compatibility with Prettier, reducing formatting conflicts.

Contributing

If you’d like to suggest improvements, please feel free to open a pull request or issue on GitHub.

License

This project is licensed under the MIT License.