{"action":"created","issue":{"url":"https://api.github.com/repos/stylelint/stylelint/issues/395","labels_url":"https://api.github.com/repos/stylelint/stylelint/issues/395/labels{/name}","comments_url":"https://api.github.com/repos/stylelint/stylelint/issues/395/comments","events_url":"https://api.github.com/repos/stylelint/stylelint/issues/395/events","html_url":"https://github.com/stylelint/stylelint/issues/395","id":107943002,"number":395,"title":"Autoprefixer and property-no-vendor-prefix","user":{"login":"ntwb","id":1016458,"avatar_url":"https://avatars.githubusercontent.com/u/1016458?v=3","gravatar_id":"","url":"https://api.github.com/users/ntwb","html_url":"https://github.com/ntwb","followers_url":"https://api.github.com/users/ntwb/followers","following_url":"https://api.github.com/users/ntwb/following{/other_user}","gists_url":"https://api.github.com/users/ntwb/gists{/gist_id}","starred_url":"https://api.github.com/users/ntwb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ntwb/subscriptions","organizations_url":"https://api.github.com/users/ntwb/orgs","repos_url":"https://api.github.com/users/ntwb/repos","events_url":"https://api.github.com/users/ntwb/events{/privacy}","received_events_url":"https://api.github.com/users/ntwb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-23T15:13:27Z","updated_at":"2015-09-25T02:31:35Z","closed_at":"2015-09-25T02:31:35Z","body":"Sorry if this isn't the clearest bug report, trying to wrap my head around all of this :smirk: \r\n\r\nWe use autoprefixer to manage vendor prefixes, one issue I now have is how to lint vendor prefixes and issues with the `property-no-vendor-prefix` rule\r\n\r\nWe commit the vendor prefixes added by Autoprefixer to our primary repo, as such we have CSS code with the `-webkit-box-shadow` vendor prefix, if based on our browser configs a vendor prefix is no longer required then Autoprefixer will remove that vendor prefix and then that code is also no longer in our repo\r\n\r\n\r\n```css\r\n.wp-core-ui .button.focus,\r\n.wp-core-ui .button:focus,\r\n.wp-core-ui .button-secondary:focus,\r\n.wp-core-ui .button-link:focus {\r\n    -webkit-box-shadow:\r\n        0 0 0 1px #5b9dd9,\r\n        0 0 2px 1px rgba(30, 140, 190, 0.8);\r\n    box-shadow:\r\n        0 0 0 1px #5b9dd9,\r\n        0 0 2px 1px rgba(30, 140, 190, 0.8);\r\n}\r\n```\r\n\r\nNow given the rule docs for [property-no-vendor-prefix](https://github.com/stylelint/stylelint/blob/master/src/rules/property-no-vendor-prefix/README.md) I'm not sure if what I am doing is right or wrong.\r\n\r\nWe have the following Stylelint rule defined: `\"property-no-vendor-prefix\": 2,\r\n\r\nFor the above CSS I get the following warning:\r\n```\r\n165:2\t⚠  Unexpected vendor-prefixed property \"-webkit-box-shadow\" (property-no-vendor-prefix) [stylelint]\r\n```\r\n\r\nWe use `grunt-postcss` and here's my relevant lint grunt task from our `Gruntfile.js`:\r\n\r\n```js\r\n\t\t\tlint: {\r\n\t\t\t\toptions: {\r\n\t\t\t\t\tsyntax: require('postcss-scss'),\r\n\t\t\t\t\tprocessors: [\r\n\t\t\t\t\t\tautoprefixer({\r\n\t\t\t\t\t\t\tbrowsers: ['Android >= 2.1', 'Chrome >= 21', 'Edge >= 1', 'Explorer >= 7', 'Firefox >= 17', 'Opera >= 12.1', 'Safari >= 6.0'],\r\n\t\t\t\t\t\t\tcascade: false,\r\n\t\t\t\t\t\t\tremove: true  // Remove old vendor prefixes\r\n\t\t\t\t\t\t}),\r\n\t\t\t\t\t\tstylelint(config),\r\n\t\t\t\t\t\treporter({\r\n\t\t\t\t\t\t\tclearMessages: true\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t],\r\n\t\t\t\t},\r\n\t\t\t\texpand: true,\r\n\t\t\t\tcwd: SOURCE_DIR,\r\n\t\t\t\tsrc: [\r\n\t\t\t\t\t'**/*.css',\r\n\t\t\t\t\t'**/*.scss'\r\n\t\t\t\t]\r\n\t\t\t}\r\n```\r\n\r\nIf I change my Autoprefixer browser config to `browsers: ['last 2 versions'],` aagin I see the same warning:\r\n\r\n```\r\n165:2\t⚠  Unexpected vendor-prefixed property \"-webkit-box-shadow\" (property-no-vendor-prefix) [stylelint]\r\n```\r\n\r\nUsing the Autoprefixer demo with the above CSS and browser configs I'm expecting the browser config using the `last 2 versions` to be the only config that reports a warning, I shouldn't get a warning for my config as `Android >= 2.1` component of my browser config requires the `-webkit-box-shadow` vendor prefix.\r\n\r\nThis can be tested using https://autoprefixer.github.io/ and the above CSS example, test by pasting that CSS and then testing each of these browser config settings: `Android >= 2.1` and `last 2 versions`\r\n"},"comment":{"url":"https://api.github.com/repos/stylelint/stylelint/issues/comments/143106903","html_url":"https://github.com/stylelint/stylelint/issues/395#issuecomment-143106903","issue_url":"https://api.github.com/repos/stylelint/stylelint/issues/395","id":143106903,"user":{"login":"ntwb","id":1016458,"avatar_url":"https://avatars.githubusercontent.com/u/1016458?v=3","gravatar_id":"","url":"https://api.github.com/users/ntwb","html_url":"https://github.com/ntwb","followers_url":"https://api.github.com/users/ntwb/followers","following_url":"https://api.github.com/users/ntwb/following{/other_user}","gists_url":"https://api.github.com/users/ntwb/gists{/gist_id}","starred_url":"https://api.github.com/users/ntwb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ntwb/subscriptions","organizations_url":"https://api.github.com/users/ntwb/orgs","repos_url":"https://api.github.com/users/ntwb/repos","events_url":"https://api.github.com/users/ntwb/events{/privacy}","received_events_url":"https://api.github.com/users/ntwb/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T02:31:35Z","updated_at":"2015-09-25T02:31:35Z","body":"> Does that help?\r\n\r\nYes :smile:  Your reply accurately and clearly stated what the issue is :+1: \r\n\r\n> the linted stylesheet should only contain standard (non-prefixed) properties\r\n\r\nThat's _our_ primary issue here because we run Autoprefixer to add these vendor prefixes to our CSS and 'commit' these changes made by Autoprefixer, primarily we do this to allow people to hack on our source code without having to install NodeJS, Grunt, etc and run the build scripts just to get a working copy up and running and displaying as expected in their browser of choice.\r\n\r\nIn my idea of an ideal world and future version of Stylelint what I'd like to be able to do is to supply Stylelint the same browser matrix/config and the end result would be that those vendor prefixes added in our source would be ignored because they are valid for our configuration. That said though Autoprefixer really does handle this itself by detecting and removing old/unused vendor prefixes.\r\n\r\nAnyway, closing this and will do as you suggest and have Stylelint ignore vendor prefixes and just let Autoprefixer do it's thing here and take care of everything in vendor prefix world :smile: "}}