Socket
Book a DemoInstallSign in
Socket

eslint-stylistic-airbnb

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-stylistic-airbnb

Airbnb config for eslint using stylistic plugin

2.0.0
latest
Source
npmnpm
Version published
Weekly downloads
3.3K
61%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-stylistic-airbnb

Airbnb config for ESLint with style rules via @stylistic plugin

Installation

Install all required dependencies

npm install -D eslint @stylistic/eslint-plugin eslint-stylistic-airbnb

Add following to your eslint config:

// Flat config
// eslint.config.mjs
import stylistic from '@stylistic/eslint-plugin';
import airbnb from 'eslint-stylistic-airbnb';

export default [
  airbnb,
  {
    files: ['**/*.{js,mjs,cjs,ts}'],
    plugins: {
      '@stylistic': stylistic,
    },
  },
];
// Legacy config
// .eslintrc.js
module.exports = {
  plugins: ['@stylistic'],
  rules: {
    ...require('eslint-stylistic-airbnb').rules,
  },
  parserOptions: {
    ecmaVersion: 'latest',
  },
};

TypeScript

If you use typescript, install additional dependency:

npm install -D typescript-eslint

And add following to your eslint config:

// Flat config
// eslint.config.mjs
import tseslint from 'typescript-eslint';
import stylistic from '@stylistic/eslint-plugin';
import airbnb from 'eslint-stylistic-airbnb';

export default [
  airbnb,
  ...tseslint.configs.recommended,
  {
    files: ['**/*.{js,mjs,cjs,ts}'],
    plugins: {
      '@stylistic': stylistic,
    },
  },
];
// Legacy config
// .eslintrc.js
module.exports = {
  plugins: [
    '@typescript-eslint',
    '@stylistic',
  ],
  parser: '@typescript-eslint/parser',
  rules: {
    ...require('eslint-stylistic-airbnb').rules, 
  },
};

Notes

This config is created from the base airbnb config as is, with no changes to original rules

  • rules that required newer eslint version are enabled
  • node related rules are not implemented
  • import rules are not implemented
  • react rules are not implemented (except of some jsx style options)
  • func-style rule is turned off, just like in original config (airbnb config contradicts with airbnb styleguide, this option set to be "backward-compatible")

Keywords

eslint

FAQs

Package last updated on 23 Sep 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.