Skip to content

Commit

Permalink
BUG: Github actions setup (linting).
Browse files Browse the repository at this point in the history
  • Loading branch information
mfendeksilverstripe committed Jan 15, 2023
1 parent 79a1568 commit 4531289
Show file tree
Hide file tree
Showing 9 changed files with 215 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('@silverstripe/webpack-config/.eslintrc');
module.exports = require('@silverstripe/eslint-config/.eslintrc');
179 changes: 179 additions & 0 deletions .sass-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# sass-lint config to match the AirBNB style guide
files:
include:
# This covers linting when running locally
- 'client/src/**/*.scss'
# This covers linting when running via Github actions
- '**/silverstripe-fluent/client/src/**/*.scss'
options:
formatter: stylish
merge-default-rules: false
rules:
# Warnings
# Things that require actual refactoring are marked as warnings
class-name-format:
- 1
- convention: hyphenatedbem
placeholder-name-format:
- 1
- convention: hyphenatedlowercase
nesting-depth:
- 1
- max-depth: 3
no-ids: 1
no-important: 1
no-misspelled-properties:
- 1
- extra-properties:
- "-moz-border-radius-topleft"
- "-moz-border-radius-topright"
- "-moz-border-radius-bottomleft"
- "-moz-border-radius-bottomright"
variable-name-format:
- 1
- allow-leading-underscore: true
convention: hyphenatedlowercase
no-extends: 1

# Warnings: these things are preferential rather than mandatory
no-css-comments: 1

# Errors
# Things that can be easily fixed are marked as errors
indentation:
- 2
- size: 2
final-newline:
- 2
- include: true
no-trailing-whitespace: 2
border-zero:
- 2
- convention: '0'
brace-style:
- 2
- allow-single-line: true
clean-import-paths:
- 2
- filename-extension: false
leading-underscore: false
no-debug: 2
no-empty-rulesets: 2
no-invalid-hex: 2
no-mergeable-selectors: 2
# no-qualifying-elements:
# - 1
# - allow-element-with-attribute: false
# allow-element-with-class: false
# allow-element-with-id: false
no-trailing-zero: 2
no-url-protocols: 2
quotes:
- 2
- style: double
space-after-bang:
- 2
- include: false
space-after-colon:
- 2
- include: true
space-after-comma:
- 2
- include: true
space-before-bang:
- 2
- include: true
space-before-brace:
- 2
- include: true
space-before-colon: 2
space-between-parens:
- 2
- include: false
trailing-semicolon: 2
url-quotes: 2
zero-unit: 2
single-line-per-selector: 2
one-declaration-per-line: 2
empty-line-between-blocks:
- 2
- ignore-single-line-rulesets: true


# Missing rules
# There are no sass-lint rules for the following AirBNB style items, but thess
# - Put comments on their own line
# - Put property delcarations before mixins

# Disabled rules

# These are other rules that we may wish to consider using in the future
# They are not part of the AirBNB CSS standard but they would introduce some strictness
# bem-depth: 0
# variable-for-property: 0
# no-transition-all: 0
# hex-length:
# - 1
# - style: short
# hex-notation:
# - 1
# - style: lowercase
# property-units:
# - 1
# - global:
# - ch
# - em
# - ex
# - rem
# - cm
# - in
# - mm
# - pc
# - pt
# - px
# - q
# - vh
# - vw
# - vmin
# - vmax
# - deg
# - grad
# - rad
# - turn
# - ms
# - s
# - Hz
# - kHz
# - dpi
# - dpcm
# - dppx
# - '%'
# per-property: {}
# force-attribute-nesting: 1
# force-element-nesting: 1
# force-pseudo-nesting: 1
# function-name-format:
# - 1
# - allow-leading-underscore: true
# convention: hyphenatedlowercase
# no-color-literals: 1
# no-duplicate-properties: 1
# mixin-name-format:
# - 1
# - allow-leading-underscore: true
# convention: hyphenatedlowercase
# shorthand-values:
# - 1
# - allowed-shorthands:
# - 1
# - 2
# - 3
# leading-zero:
# - 1
# - include: false
# no-vendor-prefixes:
# - 1
# - additional-identifiers: []
# excluded-identifiers: []
# placeholder-in-extend: 1
# no-color-keywords: 2
Binary file removed client/dist/images/menu-icon-16.png
Binary file not shown.
1 change: 0 additions & 1 deletion client/dist/js/fluent.js.map

This file was deleted.

1 change: 0 additions & 1 deletion client/dist/styles/fluent.css.map

This file was deleted.

25 changes: 13 additions & 12 deletions client/src/styles/fluent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ $fluent-color-localised: rgb(102, 15, 242);
.cms-fluent-selector-locales {
background-color: #368b39;
background-image: url("../images/menu-icon-24-white.png");
background-position: 6px center;;
background-position: 6px center;
background-repeat: none;
background-size: 12px;
border-radius: 5px;
Expand All @@ -80,6 +80,7 @@ $fluent-color-localised: rgb(102, 15, 242);
// hide text on main dropdown when collapsed, show icon only
color: transparent;
padding: 2px;

> option {
color: white;
}
Expand Down Expand Up @@ -118,7 +119,7 @@ $fluent-color-localised: rgb(102, 15, 242);

// button
.popover-actions-simulate .ui-tabs-anchor {
font-size: 1.0em;
font-size: 1em;
color: #303b4d;

&:before {
Expand All @@ -130,7 +131,7 @@ $fluent-color-localised: rgb(102, 15, 242);
&:hover,
&:active {
&:after {
display: none !important;
display: none !important;// sass-lint:disable-line no-important
}
}
}
Expand All @@ -143,7 +144,7 @@ $fluent-color-localised: rgb(102, 15, 242);
.action-description {
font-size: 0.9em;
line-height: 1em;
display: block !important;
display: block !important;// sass-lint:disable-line no-important
margin: 0;
padding: 0 11px 8px 11px;
border-bottom: 1px solid #ccc;
Expand All @@ -156,24 +157,24 @@ $fluent-color-localised: rgb(102, 15, 242);
}
}

.action-group-COPY_FROM .action-menu__toggle:before,
.action-group-COPY_TO .action-menu__toggle:before {
font-family: inherit !important;
.action-group-COPY_FROM .action-menu__toggle:before, // sass-lint:disable-line class-name-format
.action-group-COPY_TO .action-menu__toggle:before { // sass-lint:disable-line class-name-format
font-family: inherit !important;// sass-lint:disable-line no-important
line-height: 1em;
font-size: 1.0em;
font-size: 1em;
}

// Gridfield menu items
.action-group-COPY_FROM .action-menu__toggle:before {
.action-group-COPY_FROM .action-menu__toggle:before {// sass-lint:disable-line class-name-format
// force ... to turn into actual title
// @todo i18n this
content: "Copy from" !important;
content: "Copy from" !important;// sass-lint:disable-line no-important
}

.action-group-COPY_TO .action-menu__toggle:before {
.action-group-COPY_TO .action-menu__toggle:before {// sass-lint:disable-line class-name-format
// force ... to turn into actual title
// @todo i18n this
content: "Copy to" !important;
content: "Copy to" !important;// sass-lint:disable-line no-important
}

// gridfield "visible locales" column
Expand Down
9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,12 @@
"lint-clean": "phpcbf src/ tests/php/"
},
"prefer-stable": true,
"minimum-stability": "dev"
"minimum-stability": "dev",
"config": {
"allow-plugins": {
"composer/installers": true,
"silverstripe/recipe-plugin": true,
"silverstripe/vendor-plugin": true
}
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
},
"homepage": "https://github.com/tractorcow-farm/silverstripe-fluent",
"devDependencies": {
"@silverstripe/eslint-config": "^0.0.5",
"@silverstripe/webpack-config": "^0.4.1"
},
"dependencies": {
Expand Down
13 changes: 13 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
# yarn lockfile v1


"@silverstripe/eslint-config@^0.0.5":
version "0.0.5"
resolved "https://registry.yarnpkg.com/@silverstripe/eslint-config/-/eslint-config-0.0.5.tgz#ab94d58e6f328d4efbcc1910572fdff5d85fc4ec"
integrity sha512-3wpbmrK3trKpTaJhEZuh5mEKkP7fBtQ5D61nJ1BvoNUZ2CFM16pXgKHe9NQM+ct/sQxL1Ag7dANq3jjnn6OM+w==
dependencies:
eslint "^4.6.1"
eslint-config-airbnb "^15.1.0"
eslint-config-airbnb-base "^12.0.0"
eslint-loader "^1.7.1"
eslint-plugin-import "^2.7.0"
eslint-plugin-jsx-a11y "^5.1.1"
eslint-plugin-react "^7.3.0"

"@silverstripe/webpack-config@^0.4.1":
version "0.4.1"
resolved "https://registry.yarnpkg.com/@silverstripe/webpack-config/-/webpack-config-0.4.1.tgz#87b5a7fb9b04148316485d850a9a0ef2654f486e"
Expand Down

0 comments on commit 4531289

Please sign in to comment.