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

@lunit/eslint-config

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lunit/eslint-config

Lunit ESLnt Config

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@lunit/eslint-config

A TypeScript ESLint ruleset designed for lunit projects based on @rushstack/eslint-config.

Installation

npm install --save-dev @lunit/eslint-config

Usage

Referring to the sapmple-project folder, create eslint-config folder in the project repository root folder, add index.js file, and then extend the eslint-config folder to the .eslintrc.cjs file.

# Project folder structure
sample-project/
├── .eslintrc.cjs
└── eslint-config
    ├── index.js
    └── mixins
        └── react.js
// .eslintrc.cjs
module.exports = {
  ...
  extends: [
    './eslint-config', // Extend common ESLint config
  ],
  settings: {
    react: {
      // Specifies the current React version (e.g. version: '18.2')
      // If not specified (default 'detect'), the entire React library will be loaded,
      // which may slow down the linting process.
      version: 'detect',
    },
  },
  ...
};

If necessary, add your own mixin to the eslint-config/mixins folder and use it, or use the mixins in @rushstack/eslint-config/mixins. (Refer to eslint-config/index.js)

// eslint-config/index.js
module.exports = {
  ...
  extends: [
    // (required) Extend the @lunit/eslint-config.
    // (@rushstack/eslint-config/profile/web-app is included by default.)
    '@lunit/eslint-config',
    // React mixin provided by rushstack (requires installation of @rushstack/eslint-config package)
    // '@rushstack/eslint-config/mixins/react',
    // You can create and use your own mixin as follows.
    './mixins/react',
  ],
  ...
};

Refer to the default settings in @lunit/eslint-config/index.js & @rushstack/eslint-config/profile/web-app and add your own rules to the config if necessary. Any esconfig rule entries added must have a valid RATIONALE.

rules: {
  ...
  // RATIONALE : Enforce consistent function types for function components.
  'react/function-component-definition': 'error',
  ...
},

FAQs

Package last updated on 10 Oct 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