Code Monkey home page Code Monkey logo

stylelint-config-recommended's Introduction

stylelint-config-recommended

NPM version Build Status

The recommended shareable config for Stylelint.

It turns on most of the Stylelint rules that help you avoid errors.

You can use this as a foundation for your own config, but we suggest most people use our standard config instead which extends this config and adds a few more rules to enforce common conventions.

Installation

npm install stylelint-config-recommended --save-dev

Usage

Set your stylelint config to:

{
  "extends": "stylelint-config-recommended"
}

Extending the config

Add a "rules" key to your config, then add your overrides and additions there.

For example, to change the at-rule-no-unknown rule to use its ignoreAtRules option, turn off the block-no-empty rule, and add the unit-allowed-list rule:

{
  "extends": "stylelint-config-recommended",
  "rules": {
    "at-rule-no-unknown": [
      true,
      {
        "ignoreAtRules": ["extends"]
      }
    ],
    "block-no-empty": null,
    "unit-allowed-list": ["em", "rem", "s"]
  }
}

stylelint-config-recommended's People

Contributors

andreasnasman avatar chinesedfan avatar dependabot-preview[bot] avatar dependabot[bot] avatar greenkeeper[bot] avatar howiezhao avatar hudochenkov avatar jeddy3 avatar krienow avatar mattxwang avatar ntwb avatar ota-meshi avatar raunofreiberg avatar sapegin avatar tysongach avatar ybiquitous avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stylelint-config-recommended's Issues

Add declaration-block-no-duplicate-custom-properties

What is the problem you're trying to solve?

declaration-block-no-duplicate-custom-properties was added to stylelint 13.10.0, but it does not exist in stylelint-config-standard yet.

What solution would you like to see?

I believe it would be a nice addition to this config.

Disable declaration-block-no-redundant-longhand-properties

The declaration-block-no-redundant-longhand-properties may lead to less readable code. Some shorthands are hard to remember, for example flex. Even padding and margin requires me to think a bit every time I use them, especially if some values are missed (padding: 1px 2px 3px).

I guess the reason to have this rule is to make code shorter but we have CSS minifiers and I’d recommend to use one instead of doing their work manually. So let developers be clear and explicit when they feel it’s needed.

A few links and discussions:

Why somes possible errors are not turned on ?

Hello,

Some rules listed in the possible errors list are not turned on by this config :

  • font-family-no-missing-generic-family-keyword
  • no-descending-specificity
  • no-duplicate-at-import-rules
  • no-duplicate-selectors
  • no-unknown-animations

Since this recommended config is turning on all possible errors rules, I am wondering if there is a reason for the fact that these rules are not turned on in this config.

Would be happy to make a PR if it is just an oversight.

Thanks !

For some reason extending with stylelint removes other rules like no-dupe-keys

Clearly describe the bug

Extending with stylelint seems to disabled other rules like no-dupe-keys

What steps are needed to reproduce the bug?

{ "env": { "browser": true, "es2021": true, "jest/globals": true }, "extends": [ //"stylelint-config-recommended", "eslint:recommended", "plugin:react/recommended", "prettier", "plugin:react-hooks/recommended" ], "parserOptions": { "ecmaFeatures": { "jsx": true }, "ecmaVersion": 12, "sourceType": "module" }, "plugins": ["react", "prettier", "jest"], "rules": { "react/prop-types": 1, "no-var": 2, "prefer-const": 2, "no-console": ["warn", { "allow": ["warn", "error", "info"] }], "func-names": 0, "no-useless-rename": 2, "no-duplicate-imports": 1, "react/display-name": 0 } }

This is my .eslintrc.json, uncommenting the stylelint line turns off other rules like no-dupe-keys

What did you expect to happen?

no-dupe-keys linting should still happen

What actually happened (e.g. what warnings or errors did you get)?

no-dupe-keys is no longer being shown as an error

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

Remove function-calc-no-invalid

What is the problem you're trying to solve?

Suppress Unknown rule function-calc-no-invalid errors raised when using stylelint-config-recommended (or stylelint-config-standard) with Stylelint version 14.

What solution would you like to see?

Remove function-calc-no-invalid from the list of enabled options. Since the option was removed in release version 14 of Stylelint, the option should be removed in this project as well.

Update remark

Hey! 👋

remark changed a bit recently. You should upgrade!

Feel free to ping me if you have questions.

Cheers,
Titus

Replace unit-whitelist with unit-allowed-list

Clearly describe the documentation issue

As discussed in stylelint/stylelint#4844 and stylelint/stylelint#4845, we are transitioning from -whitelist/-blacklist rules to -allowed-list/-disallowed-list rules. We should update all instances of this in all of our documentation, including the two instances of unit-whitelist with unit-allowed-list in the README.

What solution would you like to see?

Well, let's replace those rules!

Change `declaration-block-no-duplicate-properties` option to `consecutive-duplicates-with-different-syntaxes`

What is the problem you're trying to solve?

Currently, the rule has an option of ignore: ['consecutive-duplicates-with-different-values']:

'declaration-block-no-duplicate-properties': [
true,
{
ignore: ['consecutive-duplicates-with-different-values'],
},
],

What solution would you like to see?

The next version of Stylelint will have a new option ignore: ['consecutive-duplicates-with-different-syntaxes']. If changing the current option to a new one, we can detect the following problematic code:

a {
  width: min-content;
  width: max-content; /* Currently, the rule doesn't warn due to `consecutive-duplicates-with-different-values` */
}

Ref: stylelint/stylelint#6632

Note: This change will produce a major update because detected problems will increase.

Using stylelint-config-recommended v12, stylelint gives syntax error

What steps are needed to reproduce the bug?

  1. Upgrade stylelint-config-recommended from v11.0.0 to v12.0.0. (declaration-block-no-duplicate-properties option from ignore: ['consecutive-duplicates-with-different-values'] to ignore: ['consecutive-duplicates-with-different-syntaxes'])

  2. Run stylelint against a code base containing duplicate css entries

For example, I'm using css-in-js, setting a clip-path to a default, then conditionally setting it to another value.

const ClipPath = styled.div`
  clip-path: polygon(0 0, 100% 100%, 100% 0, 0 0);
  clip-path: ${(p) => p.$up && 'polygon(100% 0, 0 100%, 0 0, 100% 0)'};
`;

What did you expect to happen?

I expected stylelint to either tell me my codebase is fine or tell me where my codebase fails to meet the new v12 recommended rules.

What actually happened?

SyntaxError: Unexpected input
at TokenStream.error (/Users/ken/Documents/Software/pulltask-dev/node_modules/.pnpm/[email protected]/node_modules/css-tree/cjs/parser/create.cjs:270:19)
at parse (/Users/ken/Documents/Software/pulltask-dev/node_modules/.pnpm/[email protected]/node_modules/css-tree/cjs/parser/create.cjs:324:20)
at isEqualValueSyntaxes (/Users/ken/Documents/Software/pulltask-dev/node_modules/.pnpm/[email protected]/node_modules/stylelint/lib/rules/declaration-block-no-duplicate-properties/index.js:79:21)
at /Users/ken/Documents/Software/pulltask-dev/node_modules/.pnpm/[email protected]/node_modules/stylelint/lib/rules/declaration-block-no-duplicate-properties/index.js:207:46
at Array.forEach ()
at /Users/ken/Documents/Software/pulltask-dev/node_modules/.pnpm/[email protected]/node_modules/stylelint/lib/rules/declaration-block-no-duplicate-properties/index.js:134:4
at each (/Users/ken/Documents/Software/pulltask-dev/node_modules/.pnpm/[email protected]/node_modules/stylelint/lib/utils/eachDeclarationBlock.js:55:5)
at eachDeclarationBlock (/Users/ken/Documents/Software/pulltask-dev/node_modules/.pnpm/[email protected]/node_modules/stylelint/lib/utils/eachDeclarationBlock.js:60:2)

There are four unknown rules

What steps are needed to reproduce the bug?

I installed stylelint-config-recommended-vue , which depends on stylelint-config-recommended , reporting an error like this:

image

I checked out stylelint-config-recommended
There are indeed these four rules, and I will not report an error if I remove them

unknown rule list:

annotation-no-unknown
function-no-unknown
keyframe-block-no-duplicate-selectors
selector-anb-no-unmatchable

Note: [email protected]

What did you expect to happen?

no error

What actually happened?

a error happened

`Cannot parse selector` with double dash comments @ Emotion JS

What steps are needed to reproduce the bug?

Use a SPA (React) with Emotion JS where double slash comments are allowed.

Rule added: 'no-invalid-double-slash-comments': null.

Example:

const classNameStyles = css`
	display: flex;
	align-items: center;

	// Comment throws a parse error
	.class-target {
		max-width: 100px;
	}
`;

There is a way to avoid this? If yes, which extended configuration should we use?

What did you expect to happen?

It passes since this is allowed with our configuration (@emotion/babel-plugin). Or there was a way to exclude with a rule.

What actually happened?

It shows a parseError:

✖ Cannot parse selector parseError

Enable Ionic Shadow Parts

What is the problem you're trying to solve?

I want to access a shadow part from ionic element, i attach the example below:

<ion-back-button> #shadow-root <span> <ion-icon part="icon"></ion-icon>. </span> </ion-back-button>

Actually i cant use the following css selector:

ion-back-button::part(icon) {}

What solution would you like to see?

I just want to be able to use the ion-back-button::part(icon) {} selector without need to update my .stylelintrc.json rules.

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Unknown rule function-no-unknown. Did you mean unit-no-unknown?

What steps are needed to reproduce the bug?

Update all packages, stylelint to 14.5.3. Try to revert back to stylelint 14.2.0.

Package.json:

{
  "name": "alpa",
  "version": "1.0.0",
  "description": "alpa powered by dudestack + devpackages",
  "author": "Digitoimisto Dude Oy ([email protected])",
  "devDependencies": {
    "@babel/core": "^7.17.5",
    "@hint/hint-axe": "^4.4.8",
    "@hint/hint-button-type": "^3.0.10",
    "@hint/hint-compat-api": "^4.4.7",
    "@ronilaukkarinen/gulp-stylelint": "^14.0.6",
    "@ronilaukkarinen/stylelint-a11y": "^1.2.4",
    "@ronilaukkarinen/stylelint-value-no-unknown-custom-properties": "^3.0.1",
    "autoprefixer": "^10.4.2",
    "babel-eslint": "^10.1.0",
    "babel-loader": "^8.2.3",
    "babel-preset-airbnb": "^5.0.0",
    "browser-sync": "^2.27.7",
    "caniuse-lite": "^1.0.30001312",
    "eslint": "^8.10.0",
    "eslint-config-airbnb": "^19.0.4",
    "eslint-plugin-import": "^2.25.4",
    "eslint-plugin-jsx-a11y": "^6.5.1",
    "eslint-plugin-react": "^7.29.2",
    "eslint-plugin-react-hooks": "^4.3.0",
    "gulp": "4.0.2",
    "gulp-clean-css": "4.3.0",
    "gulp-eslint": "^6.0.0",
    "gulp-notify": "^4.0.0",
    "gulp-phpcs": "^3.1.0",
    "gulp-postcss": "^9.0.1",
    "gulp-rename": "^2.0.0",
    "gulp-sass": "^5.1.0",
    "gulp-sourcemaps": "^3.0.0",
    "hint": "^6.1.9",
    "npm-check-updates": "^12.5.0",
    "postcss": "^8.4.7",
    "sass": "^1.49.9",
    "stylelint": "^14.2.0",
    "stylelint-config-recommended": "^7.0.0",
    "stylelint-config-recommended-scss": "^5.0.2",
    "stylelint-config-standard": "^25.0.0",
    "stylelint-declaration-strict-value": "^1.8.0",
    "stylelint-order": "^5.0.0",
    "stylelint-scss": "^4.1.0",
    "terser-webpack-plugin": "^5.3.1",
    "vinyl-named": "^1.1.0",
    "vue": "^2.6.14",
    "vue-loader": "^15.9.7",
    "vue-template-compiler": "^2.6.14",
    "webpack": "^5.69.1",
    "webpack-stream": "^7.0.0"
  },
  "dependencies": {
    "airbnb-browser-shims": "^3.3.0",
    "npx": "^10.2.2"
  }
}

.stylleintrc:

{
  "defaultSeverity": "warning",
  "plugins": [
    "@ronilaukkarinen/stylelint-a11y",
    "@ronilaukkarinen/stylelint-value-no-unknown-custom-properties",
    "stylelint-declaration-strict-value",
    "stylelint-scss",
    "stylelint-order"
  ],
  "extends": [
    "stylelint-config-standard",
    "stylelint-config-recommended-scss"
  ],
  "customSyntax": "postcss-scss",
  "rules": {
    "order/order": [
      {
        "type": "at-rule",
        "name": "import"
      },
      {
        "type": "at-rule",
        "name": "include"
      },
      {
        "type": "at-rule",
        "name": "extend"
      },
      "custom-properties",
      "dollar-variables",
      "declarations",
      "rules",
      {
        "type": "at-rule",
        "name": "media"
      }
    ],
    "order/properties-alphabetical-order": true,
    "a11y/no-outline-none": true,
    "a11y/selector-pseudo-class-focus": true,
    "alpha-value-notation": "number",
    "declaration-block-no-redundant-longhand-properties": null,
    "custom-property-empty-line-before": "never",
    "block-closing-brace-empty-line-before": "never",
    "property-case": "lower",
    "color-no-invalid-hex": true,
    "color-hex-case": "lower",
    "color-hex-length": "short",
    "selector-pseudo-element-case": "lower",
    "selector-type-case": "lower",
    "selector-pseudo-class-parentheses-space-inside": "never",
    "function-parentheses-space-inside": "never",
    "function-comma-newline-after": "never-multi-line",
    "function-name-case": "lower",
    "function-max-empty-lines": 0,
    "max-empty-lines": 1,
    "unit-case": "lower",
    "selector-pseudo-class-case": "lower",
    "value-keyword-case": "lower",
    "selector-attribute-brackets-space-inside": "never",
    "selector-attribute-quotes": "always",
    "selector-combinator-space-after": "always",
    "selector-combinator-space-before": "always",
    "selector-descendant-combinator-no-non-space": true,
    "comment-whitespace-inside": "always",
    "indentation": 2,
    "linebreaks": "unix",
    "selector-max-specificity": "1,5,5",
    "block-no-empty": true,
    "declaration-colon-newline-after": null,
    "declaration-empty-line-before": null,
    "number-leading-zero": "never",
    "number-no-trailing-zeros": true,
    "value-list-comma-newline-after": "never-multi-line",
    "selector-list-comma-newline-after": "always",
    "declaration-colon-space-before": "never",
    "declaration-block-trailing-semicolon": "always",
    "no-eol-whitespace": true,
    "no-empty-first-line": true,
    "no-missing-end-of-source-newline": true,
    "block-opening-brace-newline-after": "always",
    "block-closing-brace-newline-after": "always-multi-line",
    "string-quotes": null,
    "media-feature-colon-space-after": "always",
    "media-feature-colon-space-before": "never",
    "media-feature-parentheses-space-inside": "never",
    "media-feature-range-operator-space-after": "always",
    "media-feature-range-operator-space-before": "always",
    "media-query-list-comma-newline-after": "never-multi-line",
    "media-feature-name-case": "lower",
    "font-family-no-missing-generic-family-keyword": true,
    "font-family-name-quotes": "always-where-required",
    "at-rule-no-unknown": null,
    "no-invalid-position-at-import-rule": null,
    "declaration-no-important": true,
    "comment-empty-line-before": null,
    "at-rule-name-newline-after": null,
    "at-rule-semicolon-newline-after": null,
    "at-rule-semicolon-space-before": "never",
    "at-rule-name-space-after": "always",
    "at-rule-name-case": "lower",
    "function-url-quotes": "always",
    "unit-no-unknown": true,
    "property-no-unknown": true,
    "no-duplicate-selectors": true,
    "no-extra-semicolons": true,
    "length-zero-no-unit": true,
    "font-weight-notation": "numeric",
    "number-max-precision": 3,
    "selector-class-pattern": null,
    "selector-max-class": 4,
    "selector-max-combinators": 4,
    "selector-max-compound-selectors": 4,
    "selector-max-pseudo-class": 4,
    "selector-max-universal": 1,
    "property-no-vendor-prefix": true,
    "selector-no-vendor-prefix": true,
    "selector-no-qualifying-type": null,
    "declaration-block-no-duplicate-properties": true,
    "no-unknown-animations": true,
    "selector-pseudo-element-colon-notation": "double",
    "shorthand-property-no-redundant-values": true,
    "declaration-block-single-line-max-declarations": 1,
    "scale-unlimited/declaration-strict-value": [
      "/color$/",
      {
        "ignoreValues": [
          "transparent",
          "currentColor",
          "unset"
        ]
      }
    ],
    "csstools/value-no-unknown-custom-properties": [
      true,
      {
        "importFrom": [
          "content/themes/alpa/css/dev/global.css"
        ]
      }
    ],
    "rule-empty-line-before": [
      "always-multi-line",
      {
        "except": [
          "first-nested",
          "after-single-line-comment"
        ],
        "ignore": [
          "inside-block"
        ]
      }
    ],
    "at-rule-empty-line-before": [
      "always",
      {
        "except": [
          "first-nested",
          "blockless-after-same-name-blockless",
          "blockless-after-blockless"
        ],
        "ignore": [
          "after-comment"
        ]
      }
    ],
    "no-descending-specificity": [
      true,
      {
        "severity": "warning"
      }
    ],
    "max-nesting-depth": [
      3,
      {
        "ignore": [
          "blockless-at-rules",
          "pseudo-classes"
        ]
      }
    ],
    "declaration-property-unit-allowed-list": [
      {
        "font-size": [
          "rem",
          "em",
          "px"
        ],
        "/^animation/": [
          "ms",
          "s"
        ],
        "line-height": [
          "px",
          "%",
          ""
        ]
      }
    ],
    "a11y/font-size-is-readable": [
      true,
      {
        "severity": "warning"
      }
    ],
    "a11y/line-height-is-vertical-rhythmed": [
      null,
      {
        "severity": "warning"
      }
    ],
    "a11y/no-display-none": [
      true,
      {
        "severity": "warning"
      }
    ],
    "a11y/no-obsolete-element": [
      true,
      {
        "severity": "warning"
      }
    ],
    "a11y/no-text-align-justify": [
      true,
      {
        "severity": "warning"
      }
    ],
    "property-disallowed-list": [
      "font",
      "animation",
      "background"
    ]
  }
}

When I take away stylelint-config-standard from extends, it works without the error:

  "extends": [
    "stylelint-config-standard",
    "stylelint-config-recommended-scss"
  ],

What did you expect to happen?

Stylelint to work normally.

What actually happened?

Stylelint reports:

Unknown rule function-no-unknown. Did you mean unit-no-unknown?

Grep output points to [email protected]:

node_modules//stylelint-config-recommended/index.js:		'function-no-unknown': true,
node_modules//stylelint/lib/rules/index.js:	'function-no-unknown': importLazy('./function-no-unknown'),
node_modules//stylelint/lib/rules/function-no-unknown/index.js:const ruleName = 'function-no-unknown';
node_modules//stylelint/lib/rules/function-no-unknown/index.js:	url: 'https://stylelint.io/user-guide/rules/list/function-no-unknown',

[v13] media-query-no-invalid is not appropriate for Sass

What steps are needed to reproduce the bug?

Use stylelint-config-recommended v13 in a project that uses Sass and media queries like this one:

@media screen and (max-width: $screen-md) {
  overflow: hidden;
}

This seems to be because media-query-no-invalid is not appropriate for Sass.

Note: As far as I can see, the README doesn't mention that stylelint-config-recommended is not compatible with Sass projects.

What did you expect to happen?

Stylelint should not complain.

What actually happened?

Stylelint complains:

  134:23  ✖  Unexpected invalid media query "(max-width: $screen-md)"  media-query-no-invalid

An in-range update of eslint-config-stylelint is breaking the build 🚨

The devDependency eslint-config-stylelint was updated from 8.2.0 to 8.3.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-config-stylelint is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for 8.3.0
  • Changed: eslint-plugin-jest rules to error
Commits

The new version differs by 3 commits.

  • 76293bf Prepare 8.3.0
  • c579256 Update CHANGELOG.md
  • c4a2e71 Switch eslint-plugin-jest rules from warn to error (#54)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Update peer dependency to Stylelint 10

Latest version of Stylelint is 10. On installation of config get the following warning:

npm WARN [email protected] requires a peer of stylelint@^8.3.0 || ^9.0.0 but none is installed. You must install peer dependencies yourself.

Please update peer dependency.

node version

What steps are needed to reproduce the bug?

node -v
14.21.0
yarn add stylelint-config-recommended
[email protected]: The engine "node" is incompatible with this module. Expected version ">=18.12.0". Got "14.21.0"

What did you expect to happen?

nothing happend, success install.

What actually happened?

In the readme docs, node just than 14 is ok, but this error message talk me I need more than 18

Allow Custom Element Type Selectors

Clearly describe the bug

When using stylelint-config-recommended, stylelint throws an error against the selector-type-no-unknown rule when using a Type Selector to style a HTML Custom Element.

What steps are needed to reproduce the bug?

Run stylelint-config-recommended against some CSS which includes a Type Selector of an HTML Custom Element, for example:

custom-element { color: red; }

What did you expect to happen?

That stylelint would not error against the selector-type-no-unknown rule when using a Type Selector to style a HTML Custom Element, because they are valid HTML according the WHATWG HTML Living Standard.

selector-type-no-unknown has an option for ignoring Custom Elements, which I feel should be enabled in this config, so that it doesn’t consider a valid selector a possible error.

What actually happened (e.g. what warnings or errors did you get)?

stylelint outputs the following error:

Unexpected unknown type selector "custom-element"   selector-type-no-unknown

Invalid Option: Invalid value "consecutive-duplicates-with-different-syntaxes" for option "ignore" of rule "declaration-block-no-duplicate-properties"

What steps are needed to reproduce the bug?

Invalid Option: Invalid value "consecutive-duplicates-with-different-syntaxes" for option "ignore" of rule "declaration-block-no-duplicate-properties"

What did you expect to happen?

No error when stylelint run.

What actually happened?

After run stylelint, thrown error:
Invalid Option: Invalid value "consecutive-duplicates-with-different-syntaxes" for option "ignore" of rule "declaration-block-no-duplicate-properties"

7.0.0 fails to lint Styled Components

What steps are needed to reproduce the bug?

Upgrade 7.0.0 and run the linter

What did you expect to happen?

Passes

What actually happened?

Fails


The introduction of the rule function-no-unknown breaks for styled components because of the wild ass syntax of Styled Components.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.