-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(stylelint-config): add @modular-css/stylelint-config package (#637)
* feat(stylelint-config): add @modular-css/stylelint-config package Provides a basic stylelint config that can be used with the `extends` feature in stylelint to easily prevent it from barfing on modular-css features.
- Loading branch information
Showing
5 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
coverage/ | ||
profiling/ | ||
test/ | ||
.* | ||
CHANGELOG.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Pat Cavit | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@modular-css/stylelint-config [![NPM Version](https://img.shields.io/npm/v/@modular-css/stylelint-config.svg)](https://www.npmjs.com/package/@modular-css/stylelint-config) [![NPM License](https://img.shields.io/npm/l/@modular-css/stylelint-config.svg)](https://www.npmjs.com/package/@modular-css/stylelint-config) [![NPM Downloads](https://img.shields.io/npm/dm/@modular-css/stylelint-config.svg)](https://www.npmjs.com/package/@modular-css/stylelint-config) | ||
=========== | ||
|
||
<p align="center"> | ||
<a href="https://gitter.im/modular-css/modular-css"><img src="https://img.shields.io/gitter/room/modular-css/modular-css.svg" alt="Gitter" /></a> | ||
</p> | ||
|
||
Sharable stylelint config for [`modular-css`](https://m-css). By default stylelint will complain about things like `@value`, `@composes`, `composes: fooga;`, and other bits of custom modular-css syntax. This configures the relevant stylelint rules so that those bits of functionality are ignored so that you don't get a bunch of bogus warnings or errors for using modular-css. | ||
|
||
Someday it might even validate things for you, but that's a trickier proposition. For now not barfing errors/warnings everywhere is a good start. | ||
|
||
- [Install](#install) | ||
- [Usage](#usage) | ||
|
||
## Install | ||
|
||
```bash | ||
> npm i @modular-css/stylelint -D | ||
``` | ||
|
||
## Usage | ||
|
||
Inside your [stylelint config](https://stylelint.io/user-guide/configuration/) you'll specify an [`extends`](https://stylelint.io/user-guide/configuration/#extends) property pointing to this package. | ||
|
||
```js | ||
{ | ||
"extends" : "@modular-css/stylelint-config", | ||
"rules" : { | ||
// ... | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "@modular-css/stylelint-config", | ||
"version": "24.2.2", | ||
"description": "Stylelint config to suport modular-css syntax", | ||
"main": "./stylelint.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/tivac/modular-css.git", | ||
"directory": "packages/stylelint" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/tivac/modular-css/issues" | ||
}, | ||
"author": "Pat Cavit <npm@patcavit.com>", | ||
"homepage": "https://m-css.com", | ||
"license": "MIT", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"keywords": [ | ||
"stylelint", | ||
"stylelint-config", | ||
"css", | ||
"css-modules", | ||
"modular-css", | ||
"postcss" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"use strict"; | ||
|
||
module.exports = { | ||
rules : { | ||
"at-rule-no-unknown" : [ true, { | ||
ignoreAtRules : [ | ||
"value", | ||
"composes" | ||
] | ||
}], | ||
|
||
"declaration-block-no-duplicate-properties" : [ true, { | ||
ignoreProperties : [ | ||
"composes" | ||
] | ||
}], | ||
|
||
"property-no-unknown" : [ true, { | ||
ignoreProperties : [ | ||
"composes" | ||
] | ||
}], | ||
|
||
"selector-pseudo-class-no-unknown" : [ true, { | ||
ignorePseudoClasses : [ | ||
"global", | ||
"external", | ||
] | ||
}], | ||
} | ||
}; |