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

Dev/update to stylelint 14 #3

Merged
merged 28 commits into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
030eb42
build(npm): upgrade stylelint version to 14
goester-team23 Feb 15, 2022
e4d54a7
build(commitizen): make repo commitizen friendly
goester-team23 Feb 15, 2022
61a7e2d
build(.npmrc): remove file as package-lock.json should always be gene…
goester-team23 Feb 15, 2022
74736da
chore(.gitignore): remove package-lock.json from .gitignore
goester-team23 Feb 15, 2022
76104d7
feat(linting rules): update stylelint configuration
goester-team23 Feb 15, 2022
67901f5
chore(prettier): configure prettier
goester-team23 Feb 15, 2022
02962fd
style(prettier): run prettier with new configuration
goester-team23 Feb 15, 2022
5e25cca
docs(changelog.md): reverse changelog order
goester-team23 Feb 15, 2022
ec0616e
docs(license): fix copyright
goester-team23 Feb 15, 2022
514a8fa
ci(gitlab): remove unused gitlab-ci.yml
goester-team23 Feb 15, 2022
f03cbba
ci(travis): remove unused travis.yml
goester-team23 Feb 15, 2022
bea2c70
build(npm): update dependencies to match those used in stylelint-conf…
goester-team23 Feb 16, 2022
737d008
feat: add stylelint-config-prettier
goester-team23 Feb 16, 2022
1f41d84
feat(index.js): add at-rules from team23-scss
goester-team23 Feb 18, 2022
fad49f9
feat(index.js): remove at-rule-no-unknown
goester-team23 Feb 18, 2022
68a7550
docs(changelog): update dependency versions
goester-team23 Feb 21, 2022
ce55bf4
docs: update readme
goester-team23 Feb 21, 2022
5c61432
npm(stylelint): update to 14.5.1
goester-team23 Feb 21, 2022
58ceb45
build(npm): add pretty-quick
goester-team23 Feb 21, 2022
73629f4
feat(index.js): disable no-empty-source rule
goester-team23 Feb 21, 2022
a0d372e
feat(index.js): disable rules
goester-team23 Feb 22, 2022
11821d1
docs: update changelog
goester-team23 Feb 22, 2022
798bf36
CI: add github workflow to run tests
goester-team23 Feb 22, 2022
2460df9
CI: run workflow on push only on master
goester-team23 Feb 22, 2022
920aa9f
CI: add dependabot
goester-team23 Feb 22, 2022
1863821
chore: use index.js as stylelint config
goester-team23 Feb 22, 2022
d235161
feat: increase max-nesting-depth to 4
goester-team23 Mar 9, 2022
eb7b42c
v1.0.0
goester-team23 Mar 18, 2022
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
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
# Enable version updates for npm
- package-ecosystem: 'npm'
# Look for `package.json` and `lock` files in the `root` directory
directory: '/'
# Check the npm registry for updates every day (weekdays)
schedule:
interval: 'daily'
29 changes: 29 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [master]
pull_request:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
node_modules
package-lock.json
15 changes: 0 additions & 15 deletions .gitlab-ci.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx pretty-quick --staged
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package.json
package-lock.json
__tests__/css-invalid.css
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "all",
"printWidth": 140
}
1 change: 1 addition & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./index.js');
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

254 changes: 251 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,254 @@
# 0.1.0
# 1.0.0

## Dependencies

- updated `stylelint` from `^13.7.2` to `^14.5.0`
- updated `stylelint-config-standard` from `^20.0.0` to `^25.0.0`
- updated `stylelint` peer dependency to `^14.4.0`, i.e. removed support for older versions
- added `stylelint-config-prettier` dependency

## Changes to linting rules

- increased `max-nesting-depth` to 4.

- added rules:

```js
'at-rule-disallowed-list': ['debug'],
'selector-type-no-unknown': null,
'function-no-unknown': null,
'no-empty-source': null,
```

- removed duplicate rules that were or became standard in stylelint-config-standard or stylelint-config-recommended:

```js
'property-no-vendor-prefix': true,
'at-rule-no-vendor-prefix': true,
'selector-no-vendor-prefix': true,
'value-no-vendor-prefix': true,
'function-url-quotes': 'always',
'font-family-name-quotes': 'always-where-recommended',
'selector-attribute-quotes': 'always',
```

- by adding `stylelint-config-prettier`, all rules that might cause conflict when using prettier are disabled.

- disabled all stylistic rules as recommended by stylelint [here](https://stylelint.io/user-guide/rules/list/#stylistic-issues), by changing

```js
'max-empty-lines': 2,
'string-quotes': 'single',
'value-keyword-case': [
'lower',
{
ignoreProperties: ['font-family', '/^\\$font-family-.*/']
}
]
```

to

```js
'max-empty-lines': null,
'string-quotes': null,
'value-keyword-case': null,
```

- and by adding the following to disable all other stylistic rules which might come with stylelint-config-standard. Those should be handled by a pretty printer instead.

```js
'function-name-case': null,
'custom-property-empty-line-before': null,
'selector-type-case': null,
'rule-empty-line-before': null,
'at-rule-empty-line-before': null,
'comment-empty-line-before': null,
'comment-whitespace-inside': null,
'color-hex-case': null,
'function-comma-newline-after': null,
'function-comma-newline-before': null,
'function-comma-space-after': null,
'function-comma-space-before': null,
'function-max-empty-lines': null,
'function-parentheses-newline-inside': null,
'function-parentheses-space-inside': null,
'function-whitespace-after': null,
'number-leading-zero': null,
'number-no-trailing-zeros': null,
'unit-case': null,
'value-list-comma-newline-after': null,
'value-list-comma-newline-before': null,
'value-list-comma-space-after': null,
'value-list-comma-space-before': null,
'value-list-max-empty-lines': null,
'property-case': null,
'declaration-bang-space-after': null,
'declaration-bang-space-before': null,
'declaration-colon-newline-after': null,
'declaration-colon-space-after': null,
'declaration-colon-space-before': null,
'declaration-empty-line-before': null,
'declaration-block-semicolon-newline-after': null,
'declaration-block-semicolon-newline-before': null,
'declaration-block-semicolon-space-after': null,
'declaration-block-semicolon-space-before': null,
'declaration-block-trailing-semicolon': null,
'block-closing-brace-empty-line-before': null,
'block-closing-brace-newline-after': null,
'block-closing-brace-newline-before': null,
'block-closing-brace-space-after': null,
'block-closing-brace-space-before': null,
'block-opening-brace-newline-after': null,
'block-opening-brace-newline-before': null,
'block-opening-brace-space-after': null,
'block-opening-brace-space-before': null,
'selector-attribute-brackets-space-inside': null,
'selector-attribute-operator-space-after': null,
'selector-attribute-operator-space-before': null,
'selector-combinator-space-after': null,
'selector-combinator-space-before': null,
'selector-descendant-combinator-no-non-space': null,
'selector-max-empty-lines': null,
'selector-pseudo-class-case': null,
'selector-pseudo-class-parentheses-space-inside': null,
'selector-pseudo-element-case': null,
'selector-list-comma-newline-after': null,
'selector-list-comma-newline-before': null,
'selector-list-comma-space-after': null,
'selector-list-comma-space-before': null,
'media-feature-colon-space-after': null,
'media-feature-colon-space-before': null,
'media-feature-name-case': null,
'media-feature-parentheses-space-inside': null,
'media-feature-range-operator-space-after': null,
'media-feature-range-operator-space-before': null,
'media-query-list-comma-newline-after': null,
'media-query-list-comma-newline-before': null,
'media-query-list-comma-space-after': null,
'media-query-list-comma-space-before': null,
'at-rule-name-case': null,
'at-rule-name-newline-after': null,
'at-rule-name-space-after': null,
'at-rule-semicolon-newline-after': null,
'at-rule-semicolon-space-before': null,
'indentation': null,
'linebreaks': null,
'max-line-length': null,
'no-eol-whitespace': null,
'no-missing-end-of-source-newline': null,
'no-empty-first-line': null,
'no-extra-semicolons': null,
```

## Changes to stylelint-config-standard

The update from stylelint-config-standard from version 20.0.0 to 25.0.0 introduced the following changes in stylelint-config-standard:

- Initial release
**added:**

```js
'alpha-value-notation': [
'percentage',
{
exceptProperties: ['opacity'],
},
],
'at-rule-no-vendor-prefix': true,
'color-function-notation': 'modern',
'custom-media-pattern': [
'^([a-z][a-z0-9]*)(-[a-z0-9]+)*$',
{
message: 'Expected custom media query name to be kebab-case',
},
],
'custom-property-pattern': [
'^([a-z][a-z0-9]*)(-[a-z0-9]+)*$',
{
message: 'Expected custom property name to be kebab-case',
},
],
'declaration-block-no-redundant-longhand-properties': true,
'function-url-quotes': 'always',
'hue-degree-notation': 'angle',
'keyframes-name-pattern': [
'^([a-z][a-z0-9]*)(-[a-z0-9]+)*$',
{
message: 'Expected keyframe name to be kebab-case',
},
],
'max-line-length': 120,
'media-feature-name-no-vendor-prefix': true,
'no-empty-first-line': true,
'no-irregular-whitespace': true,
'number-max-precision': 4,
'property-no-vendor-prefix': true,
'selector-attribute-quotes': 'always',
'selector-class-pattern': [
'^([a-z][a-z0-9]*)(-[a-z0-9]+)*$',
{
message: 'Expected class selector to be kebab-case',
},
],
'selector-id-pattern': [
'^([a-z][a-z0-9]*)(-[a-z0-9]+)*$',
{
message: 'Expected id selector to be kebab-case',
},
],
'selector-no-vendor-prefix': true,
'shorthand-property-no-redundant-values': true,
'string-quotes': 'double',
'value-no-vendor-prefix': true,
```

**removed:** none

**updated:** none

## Changes to stylelint-config-recommended

As stylelint-config-standard depends on stylelint-config-recommended and the stylelint-config-recommended dependency was updated from version 3.0.0 to 6.0.0 in stylelint-config-standard version 25.0.0, the following changes are introduced to stylelint-config-recommended:

**added:**

```js
'custom-property-no-missing-var-function': true,
'declaration-block-no-duplicate-custom-properties': true,
'named-grid-areas-no-invalid': true,
'no-invalid-position-at-import-rule': true,
'no-irregular-whitespace': true,
```

**removed:**

```js
'function-calc-no-invalid': true,
```

**udpated:**

from

```js
'selector-type-no-unknown': true,
```

to

```js
'selector-type-no-unknown': [
true,
{
ignore: ['custom-elements'],
},
],
```

# 0.2.0
- Update to use stylelint 13 and stylelint-config standard 20

- Update to use stylelint 13 and stylelint-config standard 20

# 0.1.0

- Initial release
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 stylelint
Copyright (c) 2016-present TEAM23 GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading