Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

eslint-config-molindo

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-molindo

Molindo ESLint config that implements our styleguide and helps to catch errors.

latest
Source
npmnpm
Version
8.0.0
Version published
Maintainers
1
Created
Source

eslint-config-molindo

Goals

  • Find errors that are detectable with static analysis.
  • Make reading code easier by providing consistent code style.
  • Make writing code faster by leveraging auto fix wherever possible.

Getting started

  • yarn add eslint eslint-config-molindo prettier --dev
  • Setup your project config in eslint.config.mjs:
import {getPresets} from 'eslint-config-molindo';

export default [
  ...(await getPresets(
    // Base config
    'typescript', // or 'javascript'

    // Optional extensions
    'react',
    'cssModules',
    'tailwind',
    'jest',
    'cypress',
    'vitest'
  )),

  {
    // Your custom config
  }
];
  • If you require globals, like browser APIs on window, you can add them to your config:
// eslint.config.mjs
import globals from 'globals';

export default [
  // ...
  {
    languageOptions: {
      globals: {
        ...globals.browser,
        ...globals.node
      }
    }
  }
];
  • To set up Prettier, add to your package.json:
"prettier": "eslint-config-molindo/.prettierrc.json"
  • If you use TypeScript, add to your tsconfig.json:
"extends": "eslint-config-molindo/tsconfig.json"

Happy linting!

Further configuration

CI integration

To validate your code in a CI pipeline, add the following to your package.json:

"scripts": {
  "lint": "eslint src && prettier src --check"
}

VSCode integration

The following two extensions are recommended:

To auto-fix errors from ESLint as well as Prettier on save, you can use the following configuration:

// settings.json (VSCode)
{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "always"
  },
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true
}

Versioning

  • Patch releases are for improved documentation, fixing a rule to stop reporting false positives and internal code changes.
  • Minor releases are for changes to rules that can automatically be fixed.
  • Major releases happen when rules are changed that can't be fixed automatically.

Keywords

eslint

FAQs

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