Skip to content

Commit 2602267

Browse files
feat: initial rules set
0 parents  commit 2602267

9 files changed

Lines changed: 7532 additions & 0 deletions

File tree

.eslintrc.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
module.exports = {
2+
'parserOptions': {
3+
'ecmaVersion': 2017,
4+
},
5+
'env': {
6+
'es6': true,
7+
},
8+
'rules': {
9+
'array-bracket-newline': [
10+
'error',
11+
'always',
12+
],
13+
'array-element-newline': [
14+
'error',
15+
'always',
16+
],
17+
'comma-dangle': [
18+
'error',
19+
'always-multiline',
20+
],
21+
'indent': [
22+
'error',
23+
2,
24+
],
25+
'object-curly-newline': [
26+
'error',
27+
'always',
28+
],
29+
'quotes': [
30+
'error',
31+
'single',
32+
],
33+
'semi': [
34+
'error',
35+
'always',
36+
],
37+
'quote-props': [
38+
'error',
39+
'always',
40+
],
41+
},
42+
};

CHANGELOG.md

Whitespace-only changes.

CODE_OF_CONDUCT.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Contributor Code of Conduct
2+
3+
As contributors and maintainers of the Terminus UI project, we pledge to respect everyone who
4+
contributes by posting issues, updating documentation, submitting pull requests, providing feedback
5+
in comments, and any other activities.
6+
7+
Communication through any of the Terminus channels (GitHub, Gitter, Slack, IRC, mailing lists,
8+
Google+, Twitter, etc.) must be constructive and never resort to personal attacks, trolling, public
9+
or private harassment, insults, or other unprofessional conduct.
10+
11+
We promise to extend courtesy and respect to everyone involved in this project regardless of gender,
12+
gender identity, sexual orientation, disability, age, race, ethnicity, religion, or level of
13+
experience. We expect anyone contributing to the Terminus UI project to do the same.
14+
15+
If any member of the community violates this code of conduct, the maintainers of the Terminus UI
16+
project may take action, removing issues, comments, and PRs or blocking accounts as deemed
17+
appropriate.
18+
19+
If you are subject to or witness unacceptable behavior, or have any other concerns, please email us
20+
at [dev@terminus.com](mailto:dev@terminus.com).

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2019 Terminus Software, LLC.
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
13+
all 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
21+
THE SOFTWARE.

README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<h1>Terminus stylelint Frontend Configuration</h1>
2+
3+
[![CircleCI][circle-badge]][circle-link]
4+
[![semantic-release][semantic-release-badge]][semantic-release]
5+
[![MIT License][license-image]][license-url]
6+
[![NPM version][npm-version-image]][npm-url]
7+
[![Github release][gh-release-badge]][gh-releases]
8+
9+
A collection of SCSS lint rules for Terminus frontend codebases.
10+
11+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
12+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
13+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
14+
15+
16+
## Installation
17+
18+
```
19+
$ yarn add stylelint @terminus/stylelint-config-frontend -D
20+
```
21+
22+
## Set up
23+
24+
#### 1. Create the file and extend our ruleset
25+
26+
Create a stylelint config file at the root level named `stylelint.config.js` and extend the base ruleset:
27+
28+
```json
29+
{
30+
"extends": "@terminus/stylelint-config-frontend"
31+
}
32+
```
33+
34+
35+
#### 2. Add a linting command to `package.json`
36+
37+
- The `--project` flag reference should point to the primary app `tsconfig` file.
38+
- The `--config` flag reference should point to the ci `tslint` file.
39+
40+
```json
41+
{
42+
"name": "My Project",
43+
"scripts": {
44+
"lint:scss": "npx stylelint 'your/path/to/styles/**/*.scss'"
45+
}
46+
}
47+
```
48+
49+
50+
51+
52+
<!--
53+
LINKS
54+
-->
55+
56+
<!-- BADGES -->
57+
[circle-badge]: https://circleci.com/gh/GetTerminus/stylelint-config-frontend/tree/release.svg?style=shield
58+
[npm-version-image]: http://img.shields.io/npm/v/@terminus/stylelint-config-frontend.svg
59+
[semantic-release-badge]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
60+
[license-image]: http://img.shields.io/badge/license-MIT-blue.svg
61+
[gh-release-badge]: https://img.shields.io/github/release/GetTerminus/stylelint-config-frontend.svg
62+
[gh-releases]: https://github.com/GetTerminus/stylelint-config-frontend/releases/
63+
[circle-link]: https://circleci.com/gh/GetTerminus/stylelint-config-frontend/tree/release
64+
[semantic-release]: https://github.com/semantic-release/semantic-release
65+
[npm-url]: https://npmjs.org/package/@terminus/stylelint-config-frontend
66+
[license-url]: https://github.com/GetTerminus/stylelint-config-frontend/blob/release/LICENSE

index.js

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
module.exports = {
2+
'plugins': [
3+
// https://github.com/hudochenkov/stylelint-order
4+
'stylelint-order',
5+
// https://github.com/kristerkari/stylelint-declaration-block-no-ignored-properties
6+
'stylelint-declaration-block-no-ignored-properties',
7+
// https://github.com/AndyOGo/stylelint-declaration-strict-value
8+
'stylelint-declaration-strict-value',
9+
// https://github.com/ssivanatarajan/stylelint-selector-no-empty
10+
'stylelint-selector-no-empty',
11+
// https://github.com/kristerkari/stylelint-scss
12+
'stylelint-scss',
13+
// https://github.com/ierhyna/stylelint-no-indistinguishable-colors
14+
'stylelint-no-indistinguishable-colors',
15+
],
16+
'rules': {
17+
'at-rule-name-case': 'lower',
18+
'at-rule-name-space-after': 'always-single-line',
19+
'at-rule-semicolon-newline-after': 'always',
20+
'block-closing-brace-empty-line-before': 'always-multi-line',
21+
'block-closing-brace-newline-after': [
22+
'always',
23+
{
24+
// Needed to avoid conflict with `at-if-closing-brace-newline-after`
25+
'ignoreAtRules': [
26+
'if',
27+
],
28+
},
29+
],
30+
'block-closing-brace-newline-before': 'always-multi-line',
31+
'block-closing-brace-space-after': 'never',
32+
'block-closing-brace-space-before': 'always-single-line',
33+
'block-no-empty': true,
34+
'block-opening-brace-newline-after': 'always-multi-line',
35+
'block-opening-brace-newline-before': 'never-multi-line',
36+
'block-opening-brace-space-after': 'always-single-line',
37+
'block-opening-brace-space-before': 'always',
38+
'color-hex-case': 'lower',
39+
'color-hex-length': 'short',
40+
'color-named': 'never',
41+
'color-no-invalid-hex': true,
42+
'comment-no-empty': true,
43+
'comment-whitespace-inside': 'always',
44+
'declaration-bang-space-after': 'never',
45+
'declaration-bang-space-before': 'always',
46+
'declaration-block-no-duplicate-properties': true,
47+
'declaration-block-no-redundant-longhand-properties': true,
48+
'declaration-block-no-shorthand-property-overrides': true,
49+
'declaration-block-semicolon-newline-after': 'always',
50+
'declaration-block-single-line-max-declarations': 1,
51+
'declaration-block-trailing-semicolon': 'always',
52+
'declaration-colon-newline-after': 'always-multi-line',
53+
'declaration-colon-space-after': 'always',
54+
'declaration-no-important': true,
55+
'font-family-name-quotes': 'always-where-required',
56+
'font-family-no-duplicate-names': true,
57+
'font-family-no-missing-generic-family-keyword': true,
58+
'font-weight-notation': 'numeric',
59+
'function-calc-no-invalid': true,
60+
'function-calc-no-unspaced-operator': true,
61+
'function-comma-space-after': 'always',
62+
'function-linear-gradient-no-nonstandard-direction': true,
63+
'function-max-empty-lines': 0,
64+
'function-name-case': 'lower',
65+
'function-parentheses-newline-inside': 'always-multi-line',
66+
'function-parentheses-space-inside': 'never',
67+
'function-whitespace-after': 'always',
68+
'indentation': 2,
69+
'keyframe-declaration-no-important': true,
70+
'length-zero-no-unit': true,
71+
'linebreaks': 'unix',
72+
'max-empty-lines': 4,
73+
'media-feature-colon-space-after': 'always',
74+
'media-feature-name-case': 'lower',
75+
'media-feature-parentheses-space-inside': 'never',
76+
'media-feature-range-operator-space-after': 'always',
77+
'media-feature-range-operator-space-before': 'always',
78+
'media-query-list-comma-space-after': 'always',
79+
'no-descending-specificity': true,
80+
'no-duplicate-at-import-rules': true,
81+
'no-duplicate-selectors': true,
82+
'no-empty-first-line': true,
83+
'no-eol-whitespace': true,
84+
'no-extra-semicolons': true,
85+
'number-leading-zero': 'never',
86+
'number-no-trailing-zeros': true,
87+
'property-case': 'lower',
88+
'property-no-unknown': true,
89+
'selector-attribute-brackets-space-inside': 'never',
90+
'selector-attribute-operator-space-after': 'never',
91+
'selector-attribute-quotes': 'always',
92+
'selector-combinator-space-after': 'always',
93+
'selector-combinator-space-before': 'always',
94+
'selector-list-comma-newline-after': 'always',
95+
'selector-pseudo-class-case': 'lower',
96+
'selector-pseudo-class-no-unknown': true,
97+
'selector-pseudo-class-parentheses-space-inside': 'never',
98+
'selector-pseudo-element-case': 'lower',
99+
'selector-pseudo-element-colon-notation': 'double',
100+
'selector-pseudo-element-no-unknown': true,
101+
'selector-type-case': 'lower',
102+
'shorthand-property-no-redundant-values': true,
103+
'string-no-newline': true,
104+
'string-quotes': 'single',
105+
'unit-case': 'lower',
106+
'unit-no-unknown': true,
107+
'value-keyword-case': 'lower',
108+
'value-list-comma-newline-after': 'always-multi-line',
109+
'value-list-comma-space-after': 'always',
110+
'value-list-max-empty-lines': 0,
111+
112+
// Plugins
113+
'at-mixin-argumentless-call-parentheses': 'never',
114+
'at-mixin-parentheses-space-before': 'never',
115+
'dollar-variable-colon-newline-after': 'always-multi-line',
116+
'dollar-variable-colon-space-after': 'at-least-one-space',
117+
'double-slash-comment-inline': 'never',
118+
'double-slash-comment-whitespace-inside': 'always',
119+
'no-duplicate-dollar-variables': true,
120+
'operator-no-newline-after': true,
121+
'operator-no-newline-before': true,
122+
'operator-no-unspaced': true,
123+
'order/properties-alphabetical-order': true,
124+
'plugin/declaration-block-no-ignored-properties': true,
125+
'plugin/stylelint-no-indistinguishable-colors': true,
126+
'plugin/stylelint-selector-no-empty': true,
127+
'scale-unlimited/declaration-strict-value': [
128+
[
129+
'box-shadow',
130+
'color',
131+
'cursor',
132+
'/font-*/',
133+
'/margin/',
134+
'/padding/',
135+
'z-index',
136+
{
137+
'ignoreKeywords': [
138+
'currentColor',
139+
'inherit',
140+
'transparent',
141+
],
142+
},
143+
],
144+
],
145+
'scss/at-function-parentheses-space-before': 'never',
146+
'scss/at-if-closing-brace-newline-after': true,
147+
'selector-nest-combinators': 'always',
148+
'selector-no-redundant-nesting-selector': true,
149+
},
150+
};

0 commit comments

Comments
 (0)