@ivuorinen/stylelint-config 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Ismo Vuorinen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,107 @@
1
+ # @ivuorinen/stylelint-config <!-- omit in toc -->
2
+
3
+ [![npm package][npm-badge]][npm-link]
4
+ [![license MIT][license-badge]][license-link]
5
+ [![ivuorinen's Code Style][style-badge]][style-link]
6
+
7
+ > ivuorinen's shareable configuration for [`stylelint`][stylelint-link].
8
+
9
+ ## Table of Contents <!-- omit in toc -->
10
+
11
+ - [Installation](#installation)
12
+ - [Usage](#usage)
13
+ - [CSS <sub><sup>(Default)</sup></sub>](#css-subsupdefaultsupsub)
14
+ - [SCSS](#scss)
15
+ - [Extending the config](#extending-the-config)
16
+ - [Documentations](#documentations)
17
+ - [Contributing](#contributing)
18
+ - [Changelog](#changelog)
19
+ - [License](#license)
20
+
21
+ ## Installation
22
+
23
+ Install `this config` as a _`devDependencies`_:
24
+
25
+ ```sh
26
+ # npm
27
+ npm install @ivuorinen/stylelint-config --save-dev
28
+
29
+ # Yarn
30
+ yarn add @ivuorinen/stylelint-config --dev
31
+ ```
32
+
33
+ After installing it, a _`.stylelintrc.json`_ file will be created automatically in the project's root folder with the following configuration:
34
+
35
+ ```json
36
+ {
37
+ "extends": ["@ivuorinen/stylelint-config/css"]
38
+ }
39
+ ```
40
+
41
+ ## Usage
42
+
43
+ This package provides configuration for CSS and SCSS, you can choose which one you want to extend:
44
+
45
+ ### CSS <sub><sup>(Default)</sup></sub>
46
+
47
+ ```json
48
+ {
49
+ "extends": ["@ivuorinen/stylelint-config/css"]
50
+ }
51
+ ```
52
+
53
+ ### SCSS
54
+
55
+ ```json
56
+ {
57
+ "extends": ["@ivuorinen/stylelint-config/scss"]
58
+ }
59
+ ```
60
+
61
+ ## Extending the config
62
+
63
+ The defined rules can be modified by adding other configurations, plugins or custom rules:
64
+
65
+ ```json
66
+ {
67
+ "extends": ["@ivuorinen/stylelint-config/css", "some-other-config-you-use"],
68
+ "rules": {
69
+ "at-rule-no-unknown": [
70
+ true,
71
+ {
72
+ "ignoreAtRules": ["extends", "ignores"]
73
+ }
74
+ ]
75
+ }
76
+ }
77
+
78
+ ```
79
+
80
+ ## Documentations
81
+
82
+ Read the [stylelint docs][stylelint-docs-link] for more information.
83
+
84
+ ## Contributing
85
+
86
+ If you are interested in helping contribute, please take a look at our [contribution guidelines][contributing-link] and open an [issue][issue-link] or [pull request][pull-request-link].
87
+
88
+ ## Changelog
89
+
90
+ See [CHANGELOG][changelog-link] for a human-readable history of changes.
91
+
92
+ ## License
93
+
94
+ Distributed under the MIT License. See [LICENSE][license-link] for more information.
95
+
96
+ [changelog-link]: ./CHANGELOG.md
97
+ [stylelint-docs-link]: https://stylelint.io
98
+ [stylelint-link]: https://github.com/stylelint/stylelint
99
+ [contributing-link]: https://github.com/ivuorinen/.github/blob/main/CONTRIBUTING.md
100
+ [issue-link]: https://github.com/ivuorinen/base-configs/issues
101
+ [license-badge]: https://img.shields.io/github/license/ivuorinen/base-configs?style=flat-square&labelColor=292a44&color=663399
102
+ [license-link]: ./LICENSE
103
+ [npm-badge]: https://img.shields.io/npm/v/@ivuorinen/stylelint-config?style=flat-square&labelColor=292a44&color=663399
104
+ [npm-link]: https://www.npmjs.com/package/@ivuorinen/stylelint-config
105
+ [pull-request-link]: https://github.com/ivuorinen/base-configs/pulls
106
+ [style-badge]: https://img.shields.io/badge/code_style-ivuorinen%E2%80%99s-663399.svg?labelColor=292a44&style=flat-square
107
+ [style-link]: https://github.com/ivuorinen/base-configs
package/css/index.js ADDED
@@ -0,0 +1,279 @@
1
+ /* eslint-disable sonarjs/no-duplicate-string */
2
+ /* eslint-disable unicorn/no-null */
3
+ 'use strict'
4
+
5
+ module.exports = {
6
+ extends: ['stylelint-config-standard'],
7
+ plugins: ['stylelint-order'],
8
+ rules: {
9
+ 'at-rule-empty-line-before': [
10
+ 'always',
11
+ {
12
+ except: ['blockless-after-same-name-blockless', 'first-nested']
13
+ }
14
+ ],
15
+ 'at-rule-name-space-after': 'always',
16
+ 'at-rule-no-vendor-prefix': true,
17
+ 'at-rule-semicolon-space-before': 'never',
18
+ 'block-closing-brace-empty-line-before': null,
19
+ 'block-closing-brace-newline-after': null,
20
+ 'block-opening-brace-space-before': null,
21
+ 'color-named': 'never',
22
+ 'declaration-block-semicolon-newline-before': 'never-multi-line',
23
+ 'declaration-empty-line-before': 'never',
24
+ 'font-family-name-quotes': 'always-where-recommended',
25
+ 'font-weight-notation': [
26
+ 'numeric',
27
+ {
28
+ ignore: ['relative']
29
+ }
30
+ ],
31
+ 'function-url-no-scheme-relative': true,
32
+ 'function-url-quotes': 'always',
33
+ 'max-empty-lines': 2,
34
+ 'max-line-length': null,
35
+ 'media-feature-name-no-vendor-prefix': true,
36
+ 'no-descending-specificity': null,
37
+ 'number-leading-zero': 'never',
38
+ 'order/properties-order': [
39
+ 'position',
40
+ 'top',
41
+ 'right',
42
+ 'bottom',
43
+ 'left',
44
+ 'z-index',
45
+ 'box-sizing',
46
+ 'display',
47
+ 'flex',
48
+ 'flex-align',
49
+ 'flex-basis',
50
+ 'flex-direction',
51
+ 'flex-wrap',
52
+ 'flex-flow',
53
+ 'flex-shrink',
54
+ 'flex-grow',
55
+ 'flex-order',
56
+ 'flex-pack',
57
+ 'align-content',
58
+ 'align-items',
59
+ 'align-self',
60
+ 'justify-content',
61
+ 'order',
62
+ 'float',
63
+ 'width',
64
+ 'min-width',
65
+ 'max-width',
66
+ 'height',
67
+ 'min-height',
68
+ 'max-height',
69
+ 'padding',
70
+ 'padding-top',
71
+ 'padding-right',
72
+ 'padding-bottom',
73
+ 'padding-left',
74
+ 'margin',
75
+ 'margin-top',
76
+ 'margin-right',
77
+ 'margin-bottom',
78
+ 'margin-left',
79
+ 'overflow',
80
+ 'overflow-x',
81
+ 'overflow-y',
82
+ '-webkit-overflow-scrolling',
83
+ '-ms-overflow-x',
84
+ '-ms-overflow-y',
85
+ '-ms-overflow-style',
86
+ 'columns',
87
+ 'column-count',
88
+ 'column-fill',
89
+ 'column-gap',
90
+ 'column-rule',
91
+ 'column-rule-width',
92
+ 'column-rule-style',
93
+ 'column-rule-color',
94
+ 'column-span',
95
+ 'column-width',
96
+ 'orphans',
97
+ 'widows',
98
+ 'clip',
99
+ 'clear',
100
+ 'font',
101
+ 'font-family',
102
+ 'font-size',
103
+ 'font-style',
104
+ 'font-weight',
105
+ 'font-variant',
106
+ 'font-size-adjust',
107
+ 'font-stretch',
108
+ 'font-effect',
109
+ 'font-emphasize',
110
+ 'font-emphasize-position',
111
+ 'font-emphasize-style',
112
+ 'font-smooth',
113
+ 'src',
114
+ 'hyphens',
115
+ 'line-height',
116
+ 'color',
117
+ 'text-align',
118
+ 'text-align-last',
119
+ 'text-emphasis',
120
+ 'text-emphasis-color',
121
+ 'text-emphasis-style',
122
+ 'text-emphasis-position',
123
+ 'text-decoration',
124
+ 'text-indent',
125
+ 'text-justify',
126
+ 'text-outline',
127
+ '-ms-text-overflow',
128
+ 'text-overflow',
129
+ 'text-overflow-ellipsis',
130
+ 'text-overflow-mode',
131
+ 'text-shadow',
132
+ 'text-transform',
133
+ 'text-wrap',
134
+ '-webkit-text-size-adjust',
135
+ '-ms-text-size-adjust',
136
+ 'letter-spacing',
137
+ '-ms-word-break',
138
+ 'word-break',
139
+ 'word-spacing',
140
+ '-ms-word-wrap',
141
+ 'word-wrap',
142
+ 'overflow-wrap',
143
+ 'tab-size',
144
+ 'white-space',
145
+ 'vertical-align',
146
+ 'direction',
147
+ 'unicode-bidi',
148
+ 'list-style',
149
+ 'list-style-position',
150
+ 'list-style-type',
151
+ 'list-style-image',
152
+ 'pointer-events',
153
+ '-ms-touch-action',
154
+ 'touch-action',
155
+ 'cursor',
156
+ 'visibility',
157
+ 'zoom',
158
+ 'table-layout',
159
+ 'empty-cells',
160
+ 'caption-side',
161
+ 'border-spacing',
162
+ 'border-collapse',
163
+ 'content',
164
+ 'quotes',
165
+ 'counter-reset',
166
+ 'counter-increment',
167
+ 'resize',
168
+ 'user-select',
169
+ 'nav-index',
170
+ 'nav-up',
171
+ 'nav-right',
172
+ 'nav-down',
173
+ 'nav-left',
174
+ 'background',
175
+ 'background-color',
176
+ 'background-image',
177
+ 'filter',
178
+ 'background-repeat',
179
+ 'background-attachment',
180
+ 'background-position',
181
+ 'background-position-x',
182
+ 'background-position-y',
183
+ 'background-clip',
184
+ 'background-origin',
185
+ 'background-size',
186
+ 'border',
187
+ 'border-color',
188
+ 'border-style',
189
+ 'border-width',
190
+ 'border-top',
191
+ 'border-top-color',
192
+ 'border-top-style',
193
+ 'border-top-width',
194
+ 'border-right',
195
+ 'border-right-color',
196
+ 'border-right-style',
197
+ 'border-right-width',
198
+ 'border-bottom',
199
+ 'border-bottom-color',
200
+ 'border-bottom-style',
201
+ 'border-bottom-width',
202
+ 'border-left',
203
+ 'border-left-color',
204
+ 'border-left-style',
205
+ 'border-left-width',
206
+ 'border-radius',
207
+ 'border-top-left-radius',
208
+ 'border-top-right-radius',
209
+ 'border-bottom-right-radius',
210
+ 'border-bottom-left-radius',
211
+ 'border-image',
212
+ 'border-image-source',
213
+ 'border-image-slice',
214
+ 'border-image-width',
215
+ 'border-image-outset',
216
+ 'border-image-repeat',
217
+ 'outline',
218
+ 'outline-width',
219
+ 'outline-style',
220
+ 'outline-color',
221
+ 'outline-offset',
222
+ 'box-shadow',
223
+ 'opacity',
224
+ '-ms-interpolation-mode',
225
+ 'page-break-after',
226
+ 'page-break-before',
227
+ 'page-break-inside',
228
+ 'transition',
229
+ 'transition-delay',
230
+ 'transition-timing-function',
231
+ 'transition-duration',
232
+ 'transition-property',
233
+ 'transform',
234
+ 'transform-origin',
235
+ 'perspective',
236
+ 'appearance',
237
+ 'animation',
238
+ 'animation-name',
239
+ 'animation-duration',
240
+ 'animation-play-state',
241
+ 'animation-timing-function',
242
+ 'animation-delay',
243
+ 'animation-iteration-count',
244
+ 'animation-direction',
245
+ 'animation-fill-mode',
246
+ 'fill',
247
+ 'stroke'
248
+ ],
249
+ 'property-no-vendor-prefix': true,
250
+ 'rule-empty-line-before': [
251
+ 'always',
252
+ {
253
+ except: ['after-single-line-comment', 'first-nested']
254
+ }
255
+ ],
256
+ 'selector-attribute-quotes': 'always',
257
+ 'selector-class-pattern': '^[a-z][a-z0-9\\-]*[a-z0-9]$',
258
+ 'selector-list-comma-newline-before': 'never-multi-line',
259
+ 'selector-list-comma-space-after': 'always-single-line',
260
+ 'selector-list-comma-space-before': 'never-single-line',
261
+ 'selector-max-attribute': 2,
262
+ 'selector-max-class': 4,
263
+ 'selector-max-combinators': 4,
264
+ 'selector-max-compound-selectors': 4,
265
+ 'selector-max-id': 0,
266
+ 'selector-max-specificity': null,
267
+ 'selector-max-type': 2,
268
+ 'selector-max-universal': 1,
269
+ 'selector-no-qualifying-type': true,
270
+ 'selector-no-vendor-prefix': true,
271
+ 'shorthand-property-no-redundant-values': true,
272
+ 'string-quotes': 'double',
273
+ 'unicode-bom': 'never',
274
+ 'value-list-comma-newline-after': 'never-multi-line',
275
+ 'value-list-comma-newline-before': 'never-multi-line',
276
+ 'value-list-comma-space-after': 'always',
277
+ 'value-no-vendor-prefix': true
278
+ }
279
+ }
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@ivuorinen/stylelint-config",
3
+ "version": "0.1.0",
4
+ "description": "ivuorinen's shareable configuration for stylelint.",
5
+ "author": {
6
+ "name": "Ismo Vuorinen",
7
+ "url": "https://github.com/ivuorinen"
8
+ },
9
+ "bugs": {
10
+ "url": "https://github.com/ivuorinen/base-configs/issues"
11
+ },
12
+ "engines": {
13
+ "node": ">= 12",
14
+ "npm": ">= 6",
15
+ "yarn": ">=1.20.0"
16
+ },
17
+ "files": [
18
+ "css/index.js",
19
+ "scripts/*",
20
+ "scss/index.js"
21
+ ],
22
+ "homepage": "https://github.com/ivuorinen/base-configs/tree/main/packages/stylelint-config#readme",
23
+ "keywords": [
24
+ "stylelint-config",
25
+ "stylelint",
26
+ "config",
27
+ "ivuorinen"
28
+ ],
29
+ "license": "MIT",
30
+ "main": "css/index.js",
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/ivuorinen/base-configs.git"
37
+ },
38
+ "scripts": {
39
+ "postinstall": "node scripts/postinstall.js"
40
+ },
41
+ "dependencies": {
42
+ "stylelint": "14.16.0",
43
+ "stylelint-config-recommended-scss": "8.0.0",
44
+ "stylelint-config-standard": "29.0.0",
45
+ "stylelint-order": "5.0.0",
46
+ "stylelint-scss": "4.3.0"
47
+ },
48
+ "gitHead": "0b2b89ca98caac7995c4c2a3662f0d338043938b"
49
+ }
@@ -0,0 +1,14 @@
1
+ 'use strict'
2
+
3
+ const fs = require('fs')
4
+ const path = require('path')
5
+
6
+ const filePath = path.join(process.env.INIT_CWD, '.stylelintrc.json')
7
+
8
+ const fileConfigObject = {
9
+ extends: ['@ivuorinen/stylelint-config/css']
10
+ }
11
+
12
+ if (!fs.existsSync(filePath)) {
13
+ fs.writeFileSync(filePath, JSON.stringify(fileConfigObject, undefined, 2))
14
+ }
package/scss/index.js ADDED
@@ -0,0 +1,33 @@
1
+ /* eslint-disable unicorn/no-null */
2
+ 'use strict'
3
+
4
+ module.exports = {
5
+ extends: ['stylelint-config-recommended-scss', '../css'],
6
+ rules: {
7
+ 'at-rule-no-unknown': null,
8
+ 'scss/at-function-named-arguments': 'never',
9
+ 'scss/at-function-parentheses-space-before': 'never',
10
+ 'scss/at-function-pattern': '^[a-z][a-z-]*$',
11
+ 'scss/at-import-no-partial-leading-underscore': true,
12
+ 'scss/at-import-partial-extension': 'never',
13
+ 'scss/at-mixin-argumentless-call-parentheses': 'always',
14
+ 'scss/at-mixin-named-arguments': null,
15
+ 'scss/at-mixin-parentheses-space-before': 'never',
16
+ 'scss/at-rule-no-unknown': true,
17
+ 'scss/dimension-no-non-numeric-values': true,
18
+ 'scss/dollar-variable-colon-space-after': 'at-least-one-space',
19
+ 'scss/dollar-variable-colon-space-before': 'never',
20
+ 'scss/dollar-variable-no-missing-interpolation': true,
21
+ 'scss/dollar-variable-pattern': '^[a-z][a-z-\\d]*$',
22
+ 'scss/media-feature-value-dollar-variable': null,
23
+ 'scss/no-duplicate-dollar-variables': [
24
+ null,
25
+ { ignoreInsideAtRules: ['if', 'mixin'] }
26
+ ],
27
+ 'scss/no-duplicate-mixins': true,
28
+ 'scss/operator-no-newline-after': true,
29
+ 'scss/operator-no-newline-before': true,
30
+ 'scss/operator-no-unspaced': true,
31
+ 'scss/selector-no-redundant-nesting-selector': true
32
+ }
33
+ }