Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ionic/eslint-config

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ionic/eslint-config

Common eslint rules/preferences for Ionic.

  • 0.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21K
decreased by-26.27%
Maintainers
2
Weekly downloads
 
Created
Source

@ionic/eslint-config

Shared ESLint config used in Ionic and Capacitor projects.

This is meant to be used alongside Prettier (with @ionic/prettier-config).

Usage

  1. Remove existing .eslintrc.* file, if present.

  2. Install eslint and the config.

    npm install -D eslint @ionic/eslint-config
    
  3. Add the following to package.json:

    "eslintConfig": {
      "extends": "@ionic/eslint-config/recommended"
    }
    

:memo: You can also use the base rule set: @ionic/eslint-config

With Prettier and @ionic/prettier-config

  1. Set up Prettier and @ionic/prettier-config.

  2. When using with Prettier and @ionic/prettier-config, ESLint should run first. Set up your scripts in package.json like this:

      "scripts": {
        "lint": "npm run eslint && npm run prettier -- --check",
        "fmt": "npm run eslint -- --fix && npm run prettier -- --write",
        "prettier": "prettier \"**/*.ts\"",
        "eslint": "eslint . --ext .ts",
      }
    
    • npm run lint: for checking if ESLint and Prettier complain
    • npm run fmt: attempt to autofix lint issues and autoformat code

    :memo: Not every rule in this configuration is autofixable, so npm run fmt may continue failing until lint issues are addressed manually.

With Husky

  1. Install husky:

    npm install -D husky
    
  2. Add the following to package.json:

      "husky": {
        "hooks": {
          "pre-commit": "npm run lint"
        }
      },
    

Keywords

FAQs

Package last updated on 17 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc