npm.io
1.1.0 • Published 5 months ago

eslint-config-lucid

Licence
MIT
Version
1.1.0
Deps
13
Size
288 kB
Vulns
0
Weekly
0

Eslint Config Lucid

A collection of eslint plugins with settings focused on reducing cognitive load and improving readability.


Disclaimer

Lucid only supports the new flat config that shipped with ESLint v8.21.0


Installation

First install peer dependencies:

npm i eslint 

Next, install eslint-config-lucid:

npm i eslint-config-lucid

Add Lucid to your eslint.config.js configuration file.

import lucid, { lucidBrowser } from 'eslint-config-lucid';

export default [
	...lucid,
	lucidBrowser,
	// ... other rule sets.
];

// Or for node
import { lucidNode } from 'eslint-config-lucid';

export default [
	...lucidNode,
	// ... other rule sets.
];


About

Lucid starts from the eslint recommended settings. These rules are modified to support the intent of Lucid (see below), and other plugins are added as listed in the Rules section below.

Intent

When it comes to formatting and syntax rules, reducing cognitive load is the primary intent of Lucid. Unlike so many code linters and formatters, I endeavor to base all my decisions on researched psychological principals. Some principles considered are:

  • Gestalt psychology

    • Many of the rule decisions regarding code formatting are grounded in Gestalt Psychology, particularly around the use of whitespace to group like things and separate unlike things.
  • Programming complexity

If you want to propose a change to a rule or suggest additional plugins, please include researched psychological principals in your issue or pull request.


Rules

babel : object

ESLint rules for @babel/eslint-plugin. Each rule corresponds to a core eslint rule, and has the same options. These allow modern ES features without throwing false errors.

core : object

Core ESLint rules.

you-dont-need-lodash-underscore : object

ESLint rules for eslint-plugin-you-dont-need-lodash-underscore.

node : object

ESLint rules for eslint-plugin-n. Note that .js files are set up for es module syntax just like .cjs.

prefer-arrow-functions : object

ESLint rules for eslint-plugin-prefer-arrow-functions.

promise : object

ESLint rules for eslint-plugin-promise.

regexp : object

ESLint rules for eslint-plugin-regexp.

security : object

ESLint rules for eslint-plugin-security.

@stylistic : object

ESLint rules for @stylistic/eslint-plugin.

unicorn : object

ESLint rules for eslint-plugin-unicorn.

Keywords