UNPKG

canonical

Version:

Canonical code style linter and formatter for JavaScript, SCSS and CSS.

78 lines (77 loc) 8.22 kB
{ "_args": [ [ "eslint-plugin-lodash3@https://registry.npmjs.org/eslint-plugin-lodash3/-/eslint-plugin-lodash3-0.3.0.tgz", "/Users/gajus/Documents/dev/canonical-code-style/canonical" ] ], "_from": "eslint-plugin-lodash3@>=0.3.0 <0.4.0", "_id": "eslint-plugin-lodash3@0.3.0", "_inCache": true, "_location": "/eslint-plugin-lodash3", "_phantomChildren": {}, "_requested": { "name": "eslint-plugin-lodash3", "raw": "eslint-plugin-lodash3@https://registry.npmjs.org/eslint-plugin-lodash3/-/eslint-plugin-lodash3-0.3.0.tgz", "rawSpec": "https://registry.npmjs.org/eslint-plugin-lodash3/-/eslint-plugin-lodash3-0.3.0.tgz", "scope": null, "spec": "https://registry.npmjs.org/eslint-plugin-lodash3/-/eslint-plugin-lodash3-0.3.0.tgz", "type": "remote" }, "_requiredBy": [ "/eslint-config-canonical-lodash" ], "_resolved": "https://registry.npmjs.org/eslint-plugin-lodash3/-/eslint-plugin-lodash3-0.3.0.tgz", "_shasum": "3d5bd84b0318cf6b705e313b10209f2f39360a72", "_shrinkwrap": null, "_spec": "eslint-plugin-lodash3@https://registry.npmjs.org/eslint-plugin-lodash3/-/eslint-plugin-lodash3-0.3.0.tgz", "_where": "/Users/gajus/Documents/dev/canonical-code-style/canonical", "author": { "email": "?+npm@gmail.com", "name": "IdoK" }, "bugs": { "url": "https://github.com/wix/eslint-plugin-lodash3/issues" }, "dependencies": { "lodash": "^3.10.1" }, "description": "Lodash specific linting rules for ESLint", "devDependencies": { "coveralls": "2.11.4", "eslint": "1.9.0", "eslint-config-wix-editor": "0.0.1", "istanbul": "0.4.0", "mocha": "2.3.3" }, "files": [ "LICENSE", "README.md", "index.js", "lib" ], "homepage": "https://github.com/wix/eslint-plugin-lodash3", "keywords": [ "eslint", "eslint-plugin", "eslintplugin", "lodash" ], "license": "MIT", "main": "index.js", "name": "eslint-plugin-lodash3", "optionalDependencies": {}, "readme": "ESLint-plugin-lodash3\n===================\n\n[![Maintenance Status][status-image]][status-url] [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coverage-image]][coverage-url]\n\nLodash3 specific linting rules for ESLint\n\n# Installation\n\nInstall [ESLint](https://www.github.com/eslint/eslint) either locally or globally.\n\n npm install eslint\n\nIf you installed `ESLint` globally, you have to install lodash3 plugin globally too. Otherwise, install it locally.\n\n $ npm install eslint-plugin-lodash3\n\n# Configuration\n\nAdd `plugins` section and specify ESLint-plugin-lodash3 as a plugin.\n\n```json\n{\n \"plugins\": [\"lodash3\"]\n}\n```\n\n\nFinally, enable all of the rules that you would like to use.\n\n```json\n{\n \"rules\": {\n \"lodash3/prop-shorthand\": 1,\n \"lodash3/matches-shorthand\": [1,3],\n \"lodash3/matches-prop-shorthand\": 1,\n \"lodash3/prefer-chain\": 1,\n \"lodash3/preferred-alias\": 1,\n \"lodash3/no-single-chain\": 1,\n \"lodash3/prefer-reject\": [1,3],\n \"lodash3/prefer-filter\": [1,3],\n \"lodash3/no-unnecessary-bind\": 1,\n \"lodash3/unwrap\": 1,\n \"lodash3/prefer-compact\": 1,\n \"lodash3/no-double-unwrap\": 1,\n \"lodash3/prefer-map\": 1,\n \"lodash3/prefer-wrapper-method\": 1,\n \"lodash3/prefer-invoke\": 1,\n \"lodash3/prefer-thru\": 1,\n \"lodash3/prefer-lodash-chain\": 1,\n \"lodash3/prefer-lodash-method\": 1,\n \"lodash3/prefer-lodash-typecheck\": 1,\n \"lodash3/no-commit\": 1,\n \"lodash3/prefer-get\": [1,3],\n \"lodash3/collection-return\": 1,\n \"lodash3/prefer-matches\": 1,\n \"lodash3/prefer-times\": 1\n }\n}\n```\n\n# List of supported rules\n\n* [prop-shorthand](docs/rules/prop-shorthand.md): Prefer property shorthand syntax\n* [matches-prop-shorthand](docs/rules/matches-prop-shorthand.md): Prefer matches property shorthand syntax\n* [matches-shorthand](docs/rules/matches-shorthand.md): Prefer matches shorthand syntax\n* [preferred-alias](docs/rules/preferred-alias.md): Preferred aliases\n* [prefer-chain](docs/rules/prefer-chain.md): Prefer chain over nested lodash calls\n* [no-single-chain](docs/rules/no-single-chain.md): Prevent chaining syntax for single method, e.g. `_(x).map().value()`\n* [prefer-reject](docs/rules/prefer-reject.md): Prefer `_.reject` over filter with `!(expression)` or `x.prop1 !== value`\n* [prefer-filter](docs/rules/prefer-filter.md): Prefer `_.filter` over `_.forEach` with an `if` statement inside.\n* [no-unnecessary-bind](docs/rules/no-unnecessary-bind.md): Prefer passing `thisArg` over binding.\n* [unwrap](docs/rules/unwrap.md): Prevent chaining without evaluation via `value()` or non-chainable methods like `max()`.,\n* [prefer-compact](docs/rules/prefer-compact.md): Prefer `_.compact` over `_.filter` for only truthy values.\n* [no-double-unwrap](docs/rules/no-double-unwrap.md): Do not use `.value()` on chains that have already ended (e.g. with `max()` or `reduce()`)\n* [prefer-map](docs/rules/prefer-map.md): Prefer `_.map` over `_.forEach` with a `push` inside.\n* [prefer-wrapper-method](docs/rules/prefer-wrapper-method.md): Prefer using array and string methods in the chain and not the initial value, e.g. `_(str).split(' ')...`\n* [prefer-invoke](docs/rules/prefer-invoke.md): Prefer using `_.invoke` over `_.map` with a method call inside.\n* [prefer-thru](docs/rules/prefer-thru.md): Prefer using `_.prototype.thru` in the chain and not call functions in the initial value, e.g. `_(x).thru(f).map(g)...`\n* [prefer-lodash-chain](docs/rules/prefer-lodash-chain.md): Prefer using Lodash chains (e.g. `_.map`) over native and mixed chains.\n* [prefer-lodash-method](docs/rules/prefer-lodash-method.md): Prefer using Lodash collection methods (e.g. `_.map`) over native array methods.\n* [prefer-lodash-typecheck](docs/rules/prefer-lodash-typecheck.md): Prefer using `_.is*` methods over `typeof` and `instanceof` checks when applicable.\n* [no-commit](docs/rules/no-commit.md): Do not use `.commit()` on chains that should end with `.value()`\n* [prefer-get](docs/rules/prefer-get.md): Prefer using `_.get` or `_.has` over expression chains like `a && a.b && a.b.c`.\n* [collection-return](docs/rules/collection-return.md): Always return a value in iteratees of lodash collection methods that aren't `forEach`.\n* [prefer-matches](docs/rules/prefer-matches.md): Prefer `_.matches` over conditions like `a.foo === 1 && a.bar === 2 && a.baz === 3`.\n* [prefer-times](docs/rules/prefer-times.md): Prefer `_.times` over `_.map` without using the iteratee's arguments.\n\n# License\n\nESLint-plugin-lodash3 is licensed under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n\n[npm-url]: https://npmjs.org/package/eslint-plugin-lodash3\n[npm-image]: http://img.shields.io/npm/v/eslint-plugin-lodash3.svg?style=flat-square\n\n[travis-url]: https://travis-ci.org/wix/eslint-plugin-lodash3\n[travis-image]: http://img.shields.io/travis/wix/eslint-plugin-lodash3/master.svg?style=flat-square\n\n[deps-url]: https://david-dm.org/wix/eslint-plugin-lodash3\n[deps-image]: https://img.shields.io/david/dev/wix/eslint-plugin-lodash3.svg?style=flat-square\n\n[coverage-url]: https://coveralls.io/r/wix/eslint-plugin-lodash3?branch=master\n[coverage-image]: http://img.shields.io/coveralls/wix/eslint-plugin-lodash3/master.svg?style=flat-square\n\n[climate-url]: https://codeclimate.com/github/wix/eslint-plugin-lodash3\n[climate-image]: http://img.shields.io/codeclimate/github/wix/eslint-plugin-lodash3.svg?style=flat-square\n\n[status-url]: https://github.com/wix/eslint-plugin-lodash3/pulse\n[status-image]: http://img.shields.io/badge/status-maintained-brightgreen.svg?style=flat-square\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/wix/eslint-plugin-lodash3.git" }, "scripts": { "coveralls": "cat ./reports/coverage/lcov.info | coveralls", "lint": "eslint ./", "test": "npm run lint && npm run unit-test", "unit-test": "istanbul cover --dir reports/coverage node_modules/mocha/bin/_mocha tests/**/*.js -- --reporter dot" }, "version": "0.3.0" }