{"id":25876,"library":"lint-staged-config-airlight","title":"lint-staged-config-airlight","description":"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.","status":"deprecated","version":"4.1.5","language":"javascript","source_language":"en","source_url":"https://github.com/dalisoft/airlight","tags":["javascript","lint-staged","git","lint","config"],"install":[{"cmd":"npm install lint-staged-config-airlight","lang":"bash","label":"npm"},{"cmd":"yarn add lint-staged-config-airlight","lang":"bash","label":"yarn"},{"cmd":"pnpm add lint-staged-config-airlight","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime peer dependency: the config is applied via lint-staged","package":"lint-staged","optional":false},{"reason":"Optional peer: needed if linting TypeScript/JavaScript with Biome","package":"@biomejs/biome","optional":true},{"reason":"Optional peer: needed if linting JavaScript with ESLint","package":"eslint","optional":true},{"reason":"Optional peer: needed if formatting with Prettier","package":"prettier","optional":true}],"imports":[{"note":"CJS require is the documented usage. The package does not provide ESM exports.","symbol":"default","correct":"const config = require('lintstaged-config-airlight');"},{"note":"Named import will fail; only a default export is available, but ESM support is not guaranteed (CJS only).","wrong":"import { config } from 'lintstaged-config-airlight';","symbol":"default (ESM)","correct":"import config from 'lintstaged-config-airlight';"},{"note":"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.","wrong":"module.exports = require('lintstaged-config-airlight');","symbol":"config invocation","correct":"module.exports = require('lintstaged-config-airlight')(['js', 'ts']);"}],"quickstart":{"code":"// .lintstagedrc.cjs\nmodule.exports = require('lintstaged-config-airlight')(['js', 'ts', 'css']);\n\n// Or if you want all languages:\n// module.exports = require('lintstaged-config-airlight')();","lang":"javascript","description":"Create a lint-staged config file that invokes the airlight configuration for specified languages."},"warnings":[{"fix":"Migrate to lefthook and remove lint-staged-config-airlight from dependencies.","message":"Package is deprecated. Use lefthook instead.","severity":"deprecated","affected_versions":">=4.1.5"},{"fix":"Ensure all peer dependencies are installed and at the correct versions. Check package.json or README for exact version ranges.","message":"Peer 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.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Always call the function: require('lintstaged-config-airlight')(languages).","message":"The default export is a function, not an object. Forgetting to call it assigns the function to lint-staged, causing errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use CommonJS require() or configure a bundler that handles CJS interop.","message":"ESM imports may not work as the package does not export ESM. Using import may result in undefined or errors.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"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');","cause":"The package might be incorrectly configured as ESM but actually is CJS, or the Node.js runtime expects CJS.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/lint-staged-config-airlight/index.mjs not supported."},{"fix":"Change module.exports = require('lintstaged-config-airlight') to module.exports = require('lintstaged-config-airlight')();","cause":"The require() did not call the default export function but assigned the function itself.","error":"TypeError: require(...) is not a function"},{"fix":"Call the imported default: import config from 'lintstaged-config-airlight'; const finalConfig = config(['js']);","cause":"ESM import results in the default export being a function, but it wasn't called.","error":"TypeError: config is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}