Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stylelintrc config #1769

Merged
merged 8 commits into from
Feb 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
261 changes: 261 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,261 @@
{
"rules": {
"at-rule-empty-line-before": [
"always",
{
"except": [
"blockless-after-same-name-blockless",
"first-nested"
],
"ignore": ["after-comment"],
"severity": "warning"
}
],
"at-rule-name-case": ["lower", { "severity": "warning" }],
"at-rule-name-space-after": [
"always-single-line",
{ "severity": "warning" }
],
"at-rule-semicolon-newline-after": [
"always",
{ "severity": "warning" }
],
"block-no-empty": true,
"block-closing-brace-empty-line-before": [
"never",
{ "severity": "warning" }
],
"block-closing-brace-newline-after": [
"always",
{ "severity": "warning" }
],
"block-closing-brace-newline-before": [
"always-multi-line",
{ "severity": "warning" }
],
"block-closing-brace-space-before": [
"always-single-line",
{ "severity": "warning" }
],
"block-opening-brace-newline-after": [
"always-multi-line",
{ "severity": "warning" }
],
"block-opening-brace-space-after": [
"always-single-line",
{ "severity": "warning" }
],
"block-opening-brace-space-before": [
"always",
{ "severity": "warning" }
],
"color-no-invalid-hex": true,
"color-hex-case": ["lower", { "severity": "warning" }],
"color-hex-length": ["short", { "severity": "warning" }],
"comment-no-empty": true,
"comment-empty-line-before": [
"always",
{
"except": ["first-nested"],
"ignore": ["stylelint-commands"],
"severity": "warning"
}
],
"comment-whitespace-inside": ["always", { "severity": "warning" }],
"custom-property-empty-line-before": [
"always",
{
"except": ["after-custom-property", "first-nested"],
"ignore": ["after-comment", "inside-single-line-block"],
"severity": "warning"
}
],
"declaration-block-no-duplicate-properties": [
true,
{ "severity": "warning" }
],
"declaration-block-no-shorthand-property-overrides": true,
"declaration-bang-space-after": ["never", { "severity": "warning" }],
"declaration-bang-space-before": ["always", { "severity": "warning" }],
"declaration-block-semicolon-newline-after": [
"always-multi-line",
{ "severity": "warning" }
],
"declaration-block-semicolon-space-after": [
"always-single-line",
{ "severity": "warning" }
],
"declaration-block-semicolon-space-before": [
"never",
{ "severity": "warning" }
],
"declaration-block-single-line-max-declarations": [
1,
{ "severity": "warning" }
],
"declaration-block-trailing-semicolon": [
"always",
{ "severity": "warning" }
],
"declaration-colon-newline-after": [
"always-multi-line",
{ "severity": "warning" }
],
"declaration-colon-space-after": [
"always-single-line",
{ "severity": "warning" }
],
"declaration-colon-space-before": ["never", { "severity": "warning" }],
"declaration-empty-line-before": [
"always",
{
"except": ["after-declaration", "first-nested"],
"ignore": ["after-comment", "inside-single-line-block"],
"severity": "warning"
}
],
"font-family-no-duplicate-names": true,
"font-family-no-missing-generic-family-keyword": [
true,
{ "severity": "warning" }
],
"function-calc-no-unspaced-operator": [true, { "severity": "warning" }],
"function-linear-gradient-no-nonstandard-direction": true,
"function-comma-newline-after": [
"always-multi-line",
{ "severity": "warning" }
],
"function-comma-space-after": [
"always-single-line",
{ "severity": "warning" }
],
"function-comma-space-before": ["never", { "severity": "warning" }],
"function-max-empty-lines": [0, { "severity": "warning" }],
"function-name-case": ["lower", { "severity": "warning" }],
"function-parentheses-newline-inside": [
"always-multi-line",
{ "severity": "warning" }
],
"function-parentheses-space-inside": [
"never-single-line",
{ "severity": "warning" }
],
"function-whitespace-after": ["always", { "severity": "warning" }],
"keyframe-declaration-no-important": [true, { "severity": "warning" }],
"length-zero-no-unit": [true, { "severity": "warning" }],
"max-empty-lines": [1, { "severity": "warning" }],
"media-feature-name-no-unknown": true,
"media-feature-colon-space-after": [
"always",
{ "severity": "warning" }
],
"media-feature-colon-space-before": [
"never",
{ "severity": "warning" }
],
"media-feature-name-case": ["lower", { "severity": "warning" }],
"media-feature-parentheses-space-inside": [
"never",
{ "severity": "warning" }
],
"media-feature-range-operator-space-after": [
"always",
{ "severity": "warning" }
],
"media-feature-range-operator-space-before": [
"always",
{ "severity": "warning" }
],
"media-query-list-comma-newline-after": [
"always-multi-line",
{ "severity": "warning" }
],
"media-query-list-comma-space-after": [
"always-single-line",
{ "severity": "warning" }
],
"media-query-list-comma-space-before": [
"never",
{ "severity": "warning" }
],
"no-duplicate-at-import-rules": true,
"no-duplicate-selectors": [true, { "severity": "warning" }],
"no-empty-source": true,
"no-extra-semicolons": [true, { "severity": "warning" }],
"no-eol-whitespace": [true, { "severity": "warning" }],
"no-missing-end-of-source-newline": [true, { "severity": "warning" }],
"no-invalid-double-slash-comments": [true, { "severity": "warning" }],
"number-leading-zero": ["always", { "severity": "warning" }],
"number-no-trailing-zeros": [true, { "severity": "warning" }],
"property-no-unknown": [true, { "severity": "warning" }],
"property-case": ["lower", { "severity": "warning" }],
"rule-empty-line-before": [
"always-multi-line",
{
"except": ["first-nested"],
"ignore": ["after-comment"],
"severity": "warning"
}
],
"selector-pseudo-class-no-unknown": true,
"selector-pseudo-element-no-unknown": true,
"selector-type-no-unknown": true,
"selector-attribute-brackets-space-inside": [
"never",
{ "severity": "warning" }
],
"selector-attribute-operator-space-after": [
"never",
{ "severity": "warning" }
],
"selector-attribute-operator-space-before": [
"never",
{ "severity": "warning" }
],
"selector-combinator-space-after": [
"always",
{ "severity": "warning" }
],
"selector-combinator-space-before": [
"always",
{ "severity": "warning" }
],
"selector-descendant-combinator-no-non-space": [
true,
{ "severity": "warning" }
],
"selector-list-comma-newline-after": [
"always",
{ "severity": "warning" }
],
"selector-list-comma-space-before": [
"never",
{ "severity": "warning" }
],
"selector-max-empty-lines": [0, { "severity": "warning" }],
"selector-pseudo-class-case": ["lower", { "severity": "warning" }],
"selector-pseudo-class-parentheses-space-inside": [
"never",
{ "severity": "warning" }
],
"selector-pseudo-element-case": ["lower", { "severity": "warning" }],
"selector-pseudo-element-colon-notation": [
"double",
{ "severity": "warning" }
],
"selector-type-case": ["lower", { "severity": "warning" }],
"string-no-newline": [true, { "severity": "warning" }],
"unit-no-unknown": true,
"unit-case": ["lower", { "severity": "warning" }],
"value-list-comma-newline-after": [
"always-multi-line",
{ "severity": "warning" }
],
"value-list-comma-space-after": [
"always-single-line",
{ "severity": "warning" }
],
"value-list-comma-space-before": ["never", { "severity": "warning" }],
"value-list-max-empty-lines": [0, { "severity": "warning" }]
}
}
2 changes: 0 additions & 2 deletions jsapp/scss/components/_kobo.collection-asset-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@
position: relative;
overflow: visible;

&--visible {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would guess that someone left these empty blocks as a hint for future developers. You're the one working on it, though, so if you want to get rid of them, that's fine with me :)


&--collapsed {
max-height: 0px;
overflow: hidden;
Expand Down
6 changes: 0 additions & 6 deletions jsapp/scss/components/_kobo.list-view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ $mult: 0.5;
float: left;
}

.list-view {
// @extend %demo-panel;
}

.list-view__attr {}

.list-view__attr--name {
font-size: larger;
}
Expand Down
2 changes: 0 additions & 2 deletions jsapp/scss/components/asset-dashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ $permEditorColor: #999;
}
}

.k-history {}

.k-history--empty {
opacity: 0.4;

Expand Down
2 changes: 1 addition & 1 deletion jsapp/scss/libs/alertify.overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@
.ajs-message.ajs-warning {box-shadow: 0 2px 0 0 $cool-orange inset;}

.ajs-message .ajs-close {
background-image: none;
background: transparent;
background-image: none;
right: 15px;
top: 50%;
margin-top: -10px;
Expand Down
4 changes: 0 additions & 4 deletions jsapp/scss/libs/react-select.overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
}
}

.kobo-select__value-container {}

.kobo-select__input input {
// HACK: most of the global styles are removed by react-select itself, but
// some we need to remove ourself (until our global input[type="text"]
Expand All @@ -42,8 +40,6 @@
color: $cool-gray;
}

.kobo-select__indicators {}

.kobo-select__indicator-separator {
display: none;
}
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
"select2": "3.5.2-browserify",
"spark-md5": "^3.0.0",
"style-loader": "^0.23.0",
"stylelint": "^9.9.0",
"stylelint-webpack-plugin": "^0.10.5",
"underscore": "^1.8.3",
"webfonts-generator": "^0.4.0",
"webpack": "^4.20.2",
Expand Down
7 changes: 7 additions & 0 deletions webpack/dev.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const path = require('path');
const webpack = require('webpack');
const WebpackCommon = require('./webpack.common');
const BundleTracker = require('webpack-bundle-tracker');
const StyleLintPlugin = require('stylelint-webpack-plugin');
var isPublicDomainDefined = process.env.KOBOFORM_PUBLIC_SUBDOMAIN &&
process.env.PUBLIC_DOMAIN_NAME;
var publicDomain = isPublicDomainDefined ? process.env.KOBOFORM_PUBLIC_SUBDOMAIN
Expand Down Expand Up @@ -30,6 +31,12 @@ module.exports = WebpackCommon({
host: '0.0.0.0'
},
plugins: [
new StyleLintPlugin({
failOnError: false,
emitErrors: true,
syntax: 'scss',
files: './jsapp/**/*.scss'
}),
new BundleTracker({path: __dirname, filename: '../webpack-stats.json'}),
new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin()
Expand Down
7 changes: 7 additions & 0 deletions webpack/webpack.common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path');
const webpack = require('webpack');
const BundleTracker = require('webpack-bundle-tracker');
const StyleLintPlugin = require('stylelint-webpack-plugin');
var merge = require('lodash.merge');

// HACK: we needed to define this postcss-loader because of a problem with
Expand Down Expand Up @@ -74,6 +75,12 @@ var defaultOptions = {
}
},
plugins: [
new StyleLintPlugin({
failOnError: false,
emitErrors: true,
syntax: 'scss',
files: './jsapp/**/*.scss'
}),
new BundleTracker({path: __dirname, filename: '../webpack-stats.json'})
]
}
Expand Down