{"_id":"@auvee/stylelint-processor-styled-components","_rev":"1-4f6aaaa97be5afc4b8fbb295b6b1c0e7","name":"@auvee/stylelint-processor-styled-components","dist-tags":{"latest":"1.10.1"},"versions":{"1.10.1":{"name":"@auvee/stylelint-processor-styled-components","version":"1.10.1","description":"A stylelint processor for styled-components","main":"src/index.js","scripts":{"lint:eslint":"eslint .","lint:prettier":"prettier --list-different \"./**/*.js\"","prettier":"prettier --write \"./**/*.js\"","test":"jest"},"jest":{"testMatch":["<rootDir>/test/*.test.js"],"setupFilesAfterEnv":["./test/jest-setup.js"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"**/*.js":["npm run lint:eslint --fix","npm run lint:prettier --write"]},"repository":{"type":"git","url":"git+https://github.com/styled-components/stylelint-processor-styled-components.git"},"keywords":["stylelint","processor","stylelint-processor","styled-components","lint"],"author":{"name":"Max Stoiber"},"license":"MIT","bugs":{"url":"https://github.com/styled-components/stylelint-processor-styled-components/issues"},"homepage":"https://github.com/styled-components/stylelint-processor-styled-components#readme","greenkeeper":{"ignore":["eslint","eslint-plugin-import","eslint-config-airbnb-base","husky","jest","lint-staged","lodash","prettier"]},"devDependencies":{"@babel/core":"^7.8.3","babel-core":"^7.0.0-bridge.0","eslint":"^6.8.0","eslint-config-airbnb-base":"^14.0.0","eslint-config-prettier":"^6.10.0","eslint-plugin-import":"^2.20.0","eslint-plugin-prettier":"^3.1.2","husky":"^4.2.1","jest":"^25.1.0","lint-staged":"^10.0.3","lodash":"^4.17.15","prettier":"^1.19.1","slash":"^3.0.0","stylelint":"^13.0.0","typescript":"~3.7.5"},"peerDependency":{"stylelint-config-styled-components":"^0.1.1","stylelint":">= 10"},"dependencies":{"@babel/parser":"^7.8.3","@babel/traverse":"^7.8.3","micromatch":"^4.0.2","postcss":"^7.0.26"},"gitHead":"941fabedab855fc368a46be9eedb074769f9fd1a","_id":"@auvee/stylelint-processor-styled-components@1.10.1","_nodeVersion":"12.16.3","_npmVersion":"6.14.5","dist":{"integrity":"sha512-kv4N6+xfmfhYQusT/AwoG0QBo1fJc9b+7kkk8lBb9hG/bKZHbg7ktqOWqzA6Sh6FlkdEN9ApRFHH7cVe0PWnpw==","shasum":"979655c0d72889abc285f0f28db593167f1ad196","tarball":"https://registry.npmjs.org/@auvee/stylelint-processor-styled-components/-/stylelint-processor-styled-components-1.10.1.tgz","fileCount":72,"unpackedSize":118785,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDqp0CRA9TVsSAnZWagAAl2AQAKAl2B2K5//8y2aW+FrJ\neAgSSI0EcG+O1KKPcExIX8ILQlx0eWmHypLzeALnN2MxXXvEEr1szXE0E1fE\nKooQENV+hWl9x19up3nWF7KbBDLn3mrSkZtTd035u0fdXBdW08rJcSZ4yZ9v\n+cDw8MvWR5nqX+H4Tap7wKx9Ulwl5RFjH3l8dnU3PnqUSi1axI5wrTct4i0L\nyUMk1w5Q2tpLxmArl8zntLQIcNhQq+VMqCWsXU0MtEOSMtVf/UZA1Qu77YUf\nrVBvTt/OWlJUf9/wghkSbEtiN072R1ZA7FG4FSfrUrrSY/wBiU8NZ7BU1otT\niJBW94YZLCXT51Lypt+dyJiKXlD0oEcoQhCI0FicxYb5REpJHwE7upvivFrk\nvaGHygYDk/I2Iw2ALXaTvLIZ4KKw0kB0awDuRN3UtfJV1EtkyCBmiC8nYP4l\n22tTKIsgVxB5O1VmAW8GF+oZClwQw/oJ/TQkQ7RvzSAR3n3hQjh8lo2g19ck\nc6Wn84DU4wZeQi+WJnkh7jfifpC7YnY2OHr4mFEOe80JxvX7OHUvDOTRy2Vb\npgYvioKSgvRPUkjz5bEmVz+1W0egCib0D0PfKvIHtLAkp71mR5vp3fSbmiTY\ntYyj6Il/hEKpod3yDNfPqhjC6i8P12VJEErR6IT2w0Q9RXs3If4KQ+hTGjXR\njYGQ\r\n=gVvW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnFs2073UF5VZIdyyzG7VQZ+FfC04toNrnAw9xvhkVjgIhAIespjms9k0xxfQLSp6LBNWCIepKFkwks4OF1Y6RAUGm"}]},"maintainers":[{"name":"auver","email":"unofhy@163.com"}],"_npmUser":{"name":"auver","email":"unofhy@163.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stylelint-processor-styled-components_1.10.1_1594796660252_0.9583155220859334"},"_hasShrinkwrap":false}},"time":{"created":"2020-07-15T07:04:19.962Z","1.10.1":"2020-07-15T07:04:20.360Z","modified":"2022-04-04T16:41:26.401Z"},"maintainers":[{"name":"auver","email":"unofhy@163.com"}],"description":"A stylelint processor for styled-components","homepage":"https://github.com/styled-components/stylelint-processor-styled-components#readme","keywords":["stylelint","processor","stylelint-processor","styled-components","lint"],"repository":{"type":"git","url":"git+https://github.com/styled-components/stylelint-processor-styled-components.git"},"author":{"name":"Max Stoiber"},"bugs":{"url":"https://github.com/styled-components/stylelint-processor-styled-components/issues"},"license":"MIT","readme":"# `stylelint-processor-styled-components`\n\nLint your [styled components](https://github.com/styled-components/styled-components) with [stylelint](http://stylelint.io/)!\n\n[![Build Status][build-badge]][build-url]\n[![Coverage Status][coverage-badge]][coverage-url]\n[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/styled-components/stylelint-processor)\n[![Greenkeeper][greenkeeper-badge]][greenkeeper-url]\n\n![Video of project in use](http://imgur.com/br9zdHb.gif)\n\n## Setup\n\nYou need:\n\n- `stylelint` (duh)\n- This processor, to extract styles from `styled-components`\n- The [`stylelint-config-styled-components`](https://github.com/styled-components/stylelint-config-styled-components) config to disable stylelint rules that clash with `styled-components`\n- Your favorite `stylelint` config! (for example [`stylelint-config-recommended`](https://github.com/stylelint/stylelint-config-recommended))\n\n```\n(npm install --save-dev \\\n  stylelint \\\n  stylelint-processor-styled-components \\\n  stylelint-config-styled-components \\\n  stylelint-config-recommended)\n```\n\nNow use those in your `.stylelintrc` and run stylelint with your JavaScript files!\n\n```json\n{\n  \"processors\": [\"stylelint-processor-styled-components\"],\n  \"extends\": [\n    \"stylelint-config-recommended\",\n    \"stylelint-config-styled-components\"\n  ]\n}\n```\n\n> **NOTE:** The processor works with Flow- and TypeScript-typed files too! (we'll assume TypeScript usage if your files end in `.ts` or `.tsx`)\n\nAnd it also has some options. Their default values are,\n\n```json\n{\n  \"processors\": [[\"stylelint-processor-styled-components\", {\n    \"moduleName\": \"styled-components\",\n    \"importName\": \"default\",\n    \"strict\": false,\n    \"ignoreFiles\": [],\n    \"parserPlugins\": [\n      \"jsx\",\n      [\"decorators\", { \"decoratorsBeforeExport\": true }],\n      \"classProperties\",\n      \"exportExtensions\",\n      \"functionBind\",\n      \"functionSent\"\n    ]\n  }]]\n}\n```\n\n- Combining with `moduleName`, `importName` and `strict`, you can tell the processor what kinds of tagged template literals to lint.\n\n```\nimport styled, { css, keyframes } from 'styled-components';\n\n// `importName` from `moduleName`, which means where `styled` comes from\nstyled(Component)``;\nstyled('div')``;\nstyled.div``;\n\n// any other imports from `moduleName` (if `strict` is true, they will not be linted)\ncss``;\nkeyframes``;\n\n// special extend calls, which have been deprecated in styled-components v4\nComponent.extend``;\n\n```\n\n- `ignoreFiles` is passed to [micromatch](https://github.com/micromatch/micromatch#api) as the second parameter, which means one or more glob patterns for matching.\n\n- `parserPlugins` is used to make the processor's parser be able to parse new syntaxes. All available babel parser plugins and related options can be found in [Babel's website](https://babeljs.io/docs/en/babel-parser#plugins).\n\n## [Documentation](https://www.styled-components.com/docs/tooling#stylelint)\n\n**Further documentation for this processor lives on [the styled-components website](https://www.styled-components.com/docs/tooling#stylelint)!**\n\n- [Setup](https://www.styled-components.com/docs/tooling#setup)\n- [Webpack](https://www.styled-components.com/docs/tooling#webpack)\n- [Interpolation tagging](https://www.styled-components.com/docs/tooling#interpolation-tagging)\n- [Tags](https://www.styled-components.com/docs/tooling#tags)\n- [sc-custom](https://www.styled-components.com/docs/tooling#sc-custom)\n- [Syntax Notes](https://www.styled-components.com/docs/tooling#syntax-notes)\n\n## F.A.Q.\n\n### Why does it throw `Unexpected token`? Even thought the file didn't import `styled-components`.\n\nYou can custom babel plugins by `option.parserPlugins` now. An API example is [our test](https://github.com/styled-components/stylelint-processor-styled-components/blob/master/test/options.test.js#L211). But if someone can implement [#231](https://github.com/styled-components/stylelint-processor-styled-components/issues/231), that will be much better.\n\nIf your project includes `yarn.lock` or `package-lock.json`, an alternative cause can be that babel related dependencies, i.e. `@babel/parser` and `@babel/traverse`, are outdated, especially when linting files with new TypeScript syntaxes. You can upgrade them by removing their entries in the lockfile and reinstall dependencies.\n\n### Why does it throw unexpected lint errors?\n\nThe processor can not always parse interpolations with right things. But you can use [interpolation-tagging](https://www.styled-components.com/docs/tooling#interpolation-tagging) to help it. If you have ideas to make it more intelligent, feel free to send a PR or share your solution by an new issue.\n\nWhat's more, if set `syntax: css-in-js` in stylelint@10, it can extract styles from `styled-components` without this processor. Even though there are still lots of differences with this processor, we hope this processor's abilities can be migrated to stylelint totally in the future.\n\n### I don't want specified tagged template literal to be parsed, i.e. `css`.\n\nYou can set `option.strict`. More examples are in [#258](https://github.com/styled-components/stylelint-processor-styled-components/pull/258).\n\n## License\n\nLicensed under the MIT License, Copyright © 2017 Maximilian Stoiber. See [LICENSE.md](./LICENSE.md) for more information!\n\nBased on Mapbox' excellent [`stylelint-processor-markdown`](https://github.com/mapbox/stylelint-processor-markdown), thanks to @davidtheclark!\n\n[build-badge]: https://travis-ci.org/styled-components/stylelint-processor-styled-components.svg?branch=master\n[build-url]: https://travis-ci.org/styled-components/stylelint-processor-styled-components\n[coverage-badge]: https://coveralls.io/repos/github/styled-components/stylelint-processor-styled-components/badge.svg?branch=master\n[coverage-url]: https://coveralls.io/github/styled-components/stylelint-processor-styled-components?branch=master\n[greenkeeper-badge]: https://badges.greenkeeper.io/styled-components/stylelint-processor-styled-components.svg\n[greenkeeper-url]: https://greenkeeper.io/\n","readmeFilename":"README.md"}