Registry / testing / lint-staged-config-airlight

lint-staged-config-airlight

JSON →
library4.1.5jsnpmunverified

An almost zero-config lint-staged configuration for JavaScript/TypeScript projects. Versions 4.x are the latest stable releases, updated frequently to keep peer dependencies current (e.g., Biome, ESLint, Prettier, Stylelint). This package is now deprecated in favor of lefthook for better performance and flexibility. It provides pre-configured lint stages for multiple languages (JS, TS, CSS, Markdown, Dockerfile, etc.) and is designed to work out of the box with the Airlight ecosystem of lint configurations.

npm install lint-staged-config-airlight
INSTALL
IMPORT
SIG · LINT-STAGED-CONFIG
L
lint-staged-config-airlight
testingjavascriptv4.1.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const config = require('lintstaged-config-airlight');
CJS require is the documented usage. The package does not provide ESM exports.
default (ESM)
import config from 'lintstaged-config-airlight';
import { config } from 'lintstaged-config-airlight';
Named import will fail; only a default export is available, but ESM support is not guaranteed (CJS only).
config invocation
module.exports = require('lintstaged-config-airlight')(['js', 'ts']);
module.exports = require('lintstaged-config-airlight');
The default export is a function; calling it without arguments returns config for all languages. The wrong pattern omits the function call, assigning the function itself.

Create a lint-staged config file that invokes the airlight configuration for specified languages.

// .lintstagedrc.cjs module.exports = require('lintstaged-config-airlight')(['js', 'ts', 'css']); // Or if you want all languages: // module.exports = require('lintstaged-config-airlight')();
Debug
Known issues
deprecatedPackage is deprecated. Use lefthook instead.
fix
Migrate to lefthook and remove lint-staged-config-airlight from dependencies.
affects: >=4.1.5
breakingPeer dependency versions may cause incompatibility if not aligned with the config's expected versions. For example, ESLint 9+ requires flat config, but this package may still use legacy config.
fix
Ensure all peer dependencies are installed and at the correct versions. Check package.json or README for exact version ranges.
affects: >=4.0.0
gotchaThe default export is a function, not an object. Forgetting to call it assigns the function to lint-staged, causing errors.
fix
Always call the function: require('lintstaged-config-airlight')(languages).
affects: >=1.0.0
gotchaESM imports may not work as the package does not export ESM. Using import may result in undefined or errors.
fix
Use CommonJS require() or configure a bundler that handles CJS interop.
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/lint-staged-config-airlight/index.mjs not supported.
The package might be incorrectly configured as ESM but actually is CJS, or the Node.js runtime expects CJS.
fix
Ensure your project uses CommonJS (type: 'commonjs' in package.json or .cjs extension). If you need ESM, use a dynamic import: const config = await import('lintstaged-config-airlight');
TypeError: require(...) is not a function
The require() did not call the default export function but assigned the function itself.
fix
Change module.exports = require('lintstaged-config-airlight') to module.exports = require('lintstaged-config-airlight')();
TypeError: config is not a function
ESM import results in the default export being a function, but it wasn't called.
fix
Call the imported default: import config from 'lintstaged-config-airlight'; const finalConfig = config(['js']);
Upgrade
Version history
4.1.5latest on npm
Audit
Dependencies
lint-stagedrequiredRuntime peer dependency: the config is applied via lint-staged
@biomejs/biomeoptionalOptional peer: needed if linting TypeScript/JavaScript with Biome
eslintoptionalOptional peer: needed if linting JavaScript with ESLint
prettieroptionalOptional peer: needed if formatting with Prettier
Agent activity
2 hits · last 30 days
node
2
Resources
lint-staged-config-airlight — npm install lint-staged-config-airlight · libregistry