{"name":"tslint-react","version":"2.2.0","description":"Lint rules related to React & JSX for TSLint","main":"tslint-react.json","repository":{"type":"git","url":"git+https://github.com/palantir/tslint-react.git"},"license":"Apache-2.0","scripts":{"build":"npm-run-all -p compile lint","clean":"rm -rf build/","compile":"tsc -p ./","copy":"cp -f package.json README.md tslint-react.json build/","lint":"tslint 'src/**/*.ts'","preversion":"npm-run-all clean test copy","test":"npm-run-all build test-rules","test-rules":"scripts/verify.sh"},"devDependencies":{"colors":"^1.1.2","glob":"^7.0.3","npm-run-all":"^2.1.2","path":"^0.12.7","tslint":"^4.0.1","typescript":"^2.0.10"},"bugs":{"url":"https://github.com/palantir/tslint-react/issues"},"homepage":"https://github.com/palantir/tslint-react#readme","_id":"tslint-react@2.2.0","_shasum":"c2a080fafd4d61f0f78dd1d6c91206718157e038","_from":"build","_resolved":"file:build","_npmVersion":"2.13.5","_nodeVersion":"0.10.33","_npmUser":{"name":"palantir","email":"pt-vendor-npm@palantir.com"},"dist":{"shasum":"c2a080fafd4d61f0f78dd1d6c91206718157e038","tarball":"http://registry-npm.ywwl.com/tslint-react/download/tslint-react-2.2.0.tgz","integrity":"sha512-2bzREUeP4yfPIqvT4NsEfYdtnEFSzFUM54jb4ENzhVQgIP7y90S/VS0iHOFBj9kpTGVbae6NuXyvS2vAdiM6Kg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWzL0rA1ab75PGLtLxnZYMnKXJujbgO/umCDXgbGjy1gIgSnnlVXpnnb2ePQMeZI0ha32PTZnjNwvLw1JtTTq3ss8="}],"size":7785,"noattachment":false,"key":"/tslint-react/-/tslint-react-2.2.0.tgz"},"maintainers":[{"name":"palantir","email":"pt-vendor-npm@palantir.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/tslint-react-2.2.0.tgz_1481904553188_0.7866698657162488"},"directories":{},"readme":"[![NPM version](https://badge.fury.io/js/tslint-react.svg)](https://www.npmjs.com/package/tslint-react)\n[![Downloads](http://img.shields.io/npm/dm/tslint-react.svg)](https://npmjs.org/package/tslint-react)\n[![Circle CI](https://circleci.com/gh/palantir/tslint-react.svg?style=svg)](https://circleci.com/gh/palantir/tslint-react)\n\ntslint-react\n------------\n\nLint rules related to React & JSX for [TSLint](https://github.com/palantir/tslint/).\n\n### Usage\n\ntslint-react has peer dependencies on TSLint and TypeScript.\n\nTo use these lint rules with the default preset, use configuration inheritance via the `extends` keyword.\nHere's a sample configuration where `tslint.json` lives adjacent to your `node_modules` folder:\n\n```js\n{\n  \"extends\": [\"tslint:latest\", \"tslint-react\"],\n  \"rules\": {\n    // override tslint-react rules here\n    \"jsx-wrap-multiline\": false\n  }\n}\n```\n\nTo lint your `.ts` **and** `.tsx` files you can simply run `tslint -c tslint.json 'src/**/*.{ts,tsx}'`.\n\n### Semantic versioning\n\nThe built-in configuration preset you get with `\"extends\": \"tslint-react\"` is semantically versioned in a manner similar to TSLint's built-in presets and the TypeScript language itself. As new rules are added to tslint-react across minor versions, stricter checks may be enabled here. Your code is not guaranteed to continue passing checks across these version bumps. If you wish to ensure that `npm upgrade` or `yarn upgrade` never breaks your build, declare a tilde dependency on this package (e.g. `\"~1.0.0\"`).\n\n### Rules\n\n- `jsx-alignment`\n  - Enforces a consistent style for multiline JSX elements which promotes ease of editing via line-wise manipulations\n  as well as maintainability via small diffs when changes are made.\n  ```ts\n  // Good:\n  const element = <div\n      className=\"foo\"\n      tabIndex={1}\n  >\n      {children}\n  </div>;\n\n  // Also Good:\n  <Button\n      appearance=\"pretty\"\n      disabled\n      label=\"Click Me\"\n      size={size}\n  />\n  ```\n- `jsx-ban-elements` (since v3.4.0)\n  - Allows blacklisting of JSX elements with an optional explanatory message in the reported failure.\n- `jsx-ban-props` (since v2.3.0)\n  - Allows blacklisting of props in JSX with an optional explanatory message in the reported failure.\n- `jsx-boolean-value` (since v2.5.0)\n  - When using a boolean attribute in JSX, you can set the attribute value to true or omit the value. This rule will enforce one or the other to keep consistency in your code.\n  - Rule options: `[\"always\", \"never\"]`\n  - Default is set to `always`.\n- `jsx-curly-spacing` (since v1.1.0)\n  - Requires _or_ bans spaces between curly brace characters in JSX.\n  - Rule options: `[\"always\", \"never\"]`\n  - _Includes automatic code fix_\n- `jsx-equals-spacing` (since v3.2.0)\n  - Requires _or_ bans spaces before and after the `=` token in JSX element attributes.\n  - Rule options: `[\"always\", \"never\"]`\n  - _Includes automatic code fix_\n- `jsx-key` (since v3.2.0)\n  - Warns for missing `key` props in JSX element array literals and inside return statements of `Array.prototype.map` callbacks.\n    - N.B. This rule only does a simple check for `.map(...)` syntax and does not inspect computed types of expressions. As such, it may produce false positives if you use APIs that look similar to `.map()`.\n  - Rule options: _none_\n- `jsx-no-bind` (since v2.6.0)\n  - Forbids function binding in JSX attributes. This has the same intent as `jsx-no-lambda` in helping you avoid excessive re-renders.\n  - Note that this currently only does a simple _syntactic_ check, not a _semantic_ one (it doesn't use the type checker). So it may have some\n    rare false positives if you define your own `.bind` function and supply `this` as a parameter.\n  - Rule options: _none_\n- `jsx-no-lambda`\n  - Creating new anonymous functions (with either the `function` syntax or ES2015 arrow syntax) inside the `render` call stack works against _pure component rendering_. When doing an equality check between two lambdas, React will always consider them unequal values and force the component to re-render more often than necessary.\n  - Rule options: _none_\n- `jsx-no-multiline-js`\n  - Disallows multiline JS expressions inside JSX blocks to promote readability\n  - Rule options: _none_\n- `jsx-no-string-ref`\n  - Passing strings to the `ref` prop of React elements is considered a legacy feature and will soon be deprecated.\n    Instead, [use a callback](https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute).\n  - Rule options: _none_\n- `jsx-use-translation-function` (since v2.4.0)\n   - Enforces use of a translation function. Plain string literals are disallowed in JSX when enabled.\n   - Rule options: `[\"allow-punctuation\", \"allow-htmlentities\"]`\n   - Off by default\n- `jsx-self-close` (since v0.4.0)\n  - Enforces that JSX elements with no children are self-closing.\n  - _Includes automatic code fix_\n  ```ts\n  // bad\n  <div className=\"foo\"></div>\n  // good\n  <div className=\"foo\" />\n  ```\n  - Rule options: _none_\n- `jsx-space-before-trailing-slash`\n  - Checks that self-closing JSX elements have a space before the '/>' part.\n  - Rule options: _none_\n  - _Includes automatic code fix_\n- `jsx-wrap-multiline` (since v2.1)\n  - Enforces that multiline JSX expressions are wrapped with parentheses.\n  - Opening parenthesis must be followed by a newline.\n  - Closing parenthesis must be preceded by a newline.\n  ```ts\n  // bad\n  const button = <button type=\"submit\">\n      Submit\n  </button>;\n  // good\n  const button = (\n      <button type=\"submit\">\n          Submit\n      </button>\n  );\n  ```\n\n### Development\n\nWe track rule suggestions on Github issues -- [here's a useful link](https://github.com/palantir/tslint-react/issues?q=is%3Aissue+is%3Aopen+label%3A%22Type%3A+Rule+Suggestion%22)\nto view all the current suggestions. Tickets are roughly triaged by priority (P1, P2, P3).\n\nWe're happy to accept PRs for new rules, especially those marked as [Status: Accepting PRs](https://github.com/palantir/tslint-react/issues?q=is%3Aissue+is%3Aopen+label%3A%22Status%3A+Accepting+PRs%22).\nIf submitting a PR, try to follow the same style conventions as the [core TSLint project](https://github.com/palantir/tslint).\n\nQuick Start (requires Node v6+, yarn v0.22+):\n\n1. `yarn`\n1. `yarn verify`\n1. `yarn lint`\n\n### Changelog\n\nSee the Github [release history](https://github.com/palantir/tslint-react/releases).\n","publish_time":1481904555102,"_cnpm_publish_time":1481904555102,"dist-tags":{"latest":"5.0.0"}}