-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
5,675 additions
and
271 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,4 @@ | ||
last 2 Chrome versions | ||
last 2 Edge versions | ||
last 2 Firefox versions | ||
last 2 Safari versions |
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,54 @@ | ||
name: Linting | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
cache-keys: | ||
name: Setup – Cache keys | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
build: build-${{ steps.build.outputs.hash }}-v2 | ||
dot-cache: dot-cache-${{ github.event.number }}-v1 | ||
node-modules: node-modules-${{ steps.node-modules.outputs.hash }}-v1 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- id: build | ||
run: echo "::set-output name=hash::${{ hashFiles('assets/**', 'content/**', 'layouts/**', 'static/**', '**/package.json', '**/package-lock.json') }}" | ||
|
||
- id: node-modules | ||
run: echo "::set-output name=hash::${{ hashFiles('**/package-lock.json') }}" | ||
|
||
test-lint: | ||
name: Test – Lint | ||
needs: cache-keys | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Get cached dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
node_modules | ||
key: ${{ needs.cache-keys.outputs.node-modules }} | ||
|
||
- name: Check that package-lock.json is valid JSON | ||
run: jq empty package-lock.json | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run linters | ||
run: npm run lint |
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 @@ | ||
name: Prettier | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
prettier: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Prettify code | ||
uses: creyD/[email protected] | ||
with: | ||
dry: True | ||
prettier_options: --check assets/js/** |
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,36 @@ | ||
[commands.lint-scripts] | ||
type = "lint" | ||
cmd = [ | ||
"npm", | ||
"run", | ||
"lint:scripts" | ||
] | ||
invoke = "once" | ||
include = ["assets/js/**/*.{ts}"] | ||
ok-exit-codes = 0 | ||
|
||
[commands.stylelint-styles] | ||
type="both" | ||
cmd = [ | ||
"npx", | ||
"stylelint" | ||
] | ||
lint-flags = [] | ||
tidy-flags = ["--fix"] | ||
path-args = "absolute-file" | ||
include = ["assets/scss/**"] | ||
ok-exit-codes = 0 | ||
|
||
[commands.prettier-scripts] | ||
type = "both" | ||
cmd = [ | ||
"npx", | ||
"prettier", | ||
"--write" | ||
] | ||
lint-flags = ["--check"] | ||
tidy-flags = ["--write"] | ||
path-args = "absolute-file" | ||
include = ["assets/js/**"] | ||
ok-exit-codes = 0 | ||
|
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,160 @@ | ||
/* eslint-disable @typescript-eslint/no-require-imports */ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
configBasedir: path.resolve(__dirname), | ||
defaultSeverity: 'error', | ||
extends: [ | ||
'stylelint-config-recommended', | ||
'stylelint-config-sass-guidelines', | ||
], | ||
plugins: [ | ||
'stylelint-no-unsupported-browser-features', | ||
'stylelint-order', | ||
], | ||
rules: { | ||
'max-nesting-depth': 4, | ||
'order/order': [ | ||
'custom-properties', | ||
'declarations', | ||
], | ||
'order/properties-alphabetical-order': true, | ||
'plugin/no-unsupported-browser-features': [ | ||
true, | ||
{ | ||
ignore: [ | ||
/** | ||
* Partial support - IE11 | ||
* | ||
* Partial support in IE11 refers to calc not working properly | ||
* with various use cases mentioned in known issues | ||
* | ||
* https://caniuse.com/calc | ||
*/ | ||
'calc', | ||
|
||
/** | ||
* Not supported - IE 11 | ||
* Partial support - Safari | ||
* | ||
* https://caniuse.com/?search=appearance | ||
*/ | ||
'css-appearance', | ||
|
||
/** | ||
* Not supported - IE11 | ||
* | ||
* https://caniuse.com/?search=css-featurequeries | ||
*/ | ||
'css-featurequeries', | ||
|
||
/** | ||
* Not supported - IE11 | ||
* | ||
* https://caniuse.com/?search=css%20filters | ||
*/ | ||
'css-filters', | ||
|
||
/** | ||
* Partial support - Safari | ||
* | ||
* Partial support in Safari and Older Firefox versions refers to | ||
* not using premultiplied colors which results in unexpected | ||
* behavior when using the transparent keyword as advised by the | ||
* spec. | ||
* | ||
* https://caniuse.com/?search=css-gradients | ||
*/ | ||
'css-gradients', | ||
|
||
/** | ||
* Not supported - IE11 | ||
* | ||
* https://caniuse.com/?search=css-initial-value | ||
*/ | ||
'css-initial-value', | ||
|
||
/** | ||
* Not supported - IE11 | ||
* | ||
* Partial support - Chromium | ||
* | ||
* Supported on th elements, but not thead or tr | ||
* | ||
* Partial support - Firefox | ||
* | ||
* Not supported on any table parts | ||
* | ||
* https://caniuse.com/?search=css-sticky | ||
*/ | ||
'css-sticky', | ||
|
||
/** | ||
* Partial support - IE11 | ||
* | ||
* Partial support is due to large amount of bugs present. | ||
* | ||
* https://caniuse.com/?search=flexbox | ||
*/ | ||
'flexbox', | ||
|
||
/** | ||
* Partial support - Chromium, Firefox | ||
* | ||
* Partial support refers to not supporting the avoid-column, | ||
* column, and avoid (in the column context) values for the | ||
* properties break-before, break-after, and break-inside. | ||
* | ||
* https://caniuse.com/?search=multicolumn | ||
*/ | ||
'multicolumn', | ||
|
||
/** | ||
* Partial support - IE11 | ||
* | ||
* Supports the value of invert for outline-color. | ||
* Does not support outline-offset. | ||
* | ||
* https://caniuse.com/?search=outline | ||
*/ | ||
'outline', | ||
|
||
/** | ||
* Partial support - IE11 | ||
* | ||
* Partial support in IE refers to not supporting the | ||
* `transform-style: preserve-3d` property. This prevents nesting 3D | ||
* transformed elements. | ||
* | ||
* https://caniuse.com/?search=transforms3d | ||
*/ | ||
'transforms3d', | ||
|
||
/** | ||
* Partial support - IE11 | ||
* | ||
* Partial support refers to not supporting the "vmax" unit. | ||
* | ||
* https://caniuse.com/viewport-units | ||
*/ | ||
'viewport-units', | ||
], | ||
}, | ||
], | ||
'selector-class-pattern': [ | ||
'[a-z]([a-zA-Z0-9]+)?$', | ||
{ | ||
resolveNestedSelectors: true, | ||
}, | ||
], | ||
'selector-max-compound-selectors': 5, | ||
'selector-pseudo-class-no-unknown': [ | ||
true, | ||
{ | ||
ignorePseudoClasses: [ | ||
'global', | ||
], | ||
}, | ||
], | ||
}, | ||
}; |
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
Oops, something went wrong.