cooking-lint
raw JSON → 0.1.4 verified Fri May 01 auth: no javascript
cooking-lint is a lint plugin for the cooking build system, currently at version 0.1.4. It provides an opinionated linting setup for JavaScript projects, bundling ESLint 2.x, eslint-loader, eslint-friendly-formatter, and multiple ESLint configurations and plugins (eslint-config-defaults, eslint-config-elemefe, eslint-plugin-vue, eslint-plugin-html, eslint-plugin-react). It is intended for use with cooking and is not actively maintained.
Common errors
error Cannot find module 'cooking-lint' ↓
cause cooking-lint not installed or not in node_modules.
fix
Run 'npm install cooking-lint --save-dev'.
error cooking.use is not a function ↓
cause cooking not initialized or wrong import.
fix
Ensure 'cooking' package is installed and required: 'const cooking = require('cooking');'
error ESLint configuration error: Invalid config 'defaults' ↓
cause eslint-config-defaults not installed or mismatched.
fix
Run 'npm install eslint-config-defaults@* --save-dev' and ensure it's resolvable.
Warnings
gotcha cooking-lint requires cooking build system; standalone usage not supported. ↓
fix Install cooking first and use cooking as the build runner.
gotcha ESLint version pinned to ^2.10.0; incompatible with ESLint 3+. ↓
fix Do not upgrade ESLint beyond 2.x in project's package.json; cooking-lint may break.
gotcha Multiple peer dependencies are automatically installed; may conflict with project's existing ESLint plugins. ↓
fix Check package.json and remove duplicate entries if conflicts arise.
gotcha Plugin config is set via cooking.set('lint', ...), not directly on plugin object. ↓
fix Use cooking.set with key 'lint' to pass options.
Install
npm install cooking-lint yarn add cooking-lint pnpm add cooking-lint Imports
- default (plugin) wrong
import cookingLint from 'cooking-lint'correctconst cookingLint = require('cooking-lint') - Register with cooking wrong
cooking.use(cookingLint)correctcooking.use('lint', cookingLint) - Configure options wrong
cookingLint.options = { ... }correctcooking.set('lint', { options: { /* ... */ } })
Quickstart
const cooking = require('cooking');
const cookingLint = require('cooking-lint');
cooking.use('lint', cookingLint);
cooking.set('lint', {
config: 'defaults',
rules: {
'no-console': 'off'
},
formatter: 'eslint-friendly-formatter'
});
cooking.build();