Skip to content
Open
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
-->
# Changelog

## [v4.0.0](https://github.com/nextcloud/stylelint-config/tree/v4.0.0) (unreleased)

### Breaking changes :boom:
This configuration again contains stylistic rules.
Due to no consensus on the prettier usage and the large user base of the configuration,
the stylistic rules are again part of this configuration.

If you are using prettier, you can try to extend from `@nextcloud/prettier-config/config.js` instead.

## [v3.1.0](https://github.com/nextcloud/stylelint-config/tree/v3.1.0) (2025-05-22)

### Added
Expand Down
16 changes: 16 additions & 0 deletions configs/formatting.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*!
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

/** @type {import('stylelint').Config} */
module.exports = {
plugins: ['@stylistic/stylelint-plugin'],
extends: ['@stylistic/stylelint-config'],
rules: {
// overrides to comply with config v3
'@stylistic/indentation': 'tab',
'@stylistic/string-quotes': 'single',
'@stylistic/selector-list-comma-newline-after': 'always-multi-line',
}
}
Comment thread
susnux marked this conversation as resolved.
95 changes: 95 additions & 0 deletions configs/linting.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/*!
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

const additionalPseudoSelectors = [
// Vue <style scoped>
// See: https://vuejs.org/api/sfc-css-features.html
'deep',
'slotted',

// CSS Modules (including Vue <style module>)
// See: https://github.com/css-modules/css-modules/blob/master/docs/composition.md#exceptions
'global',
'local',
]

/** @type {import('stylelint').Config} */
module.exports = {
extends: [
'stylelint-config-recommended-scss',
'stylelint-config-recommended-vue/scss',
],
plugins: ['stylelint-use-logical'],
rules: {
'selector-type-no-unknown': null,
'rule-empty-line-before': [
'always',
{
ignore: ['after-comment', 'inside-block'],
},
],
'declaration-empty-line-before': [
'never',
{
ignore: ['after-declaration'],
},
],
'comment-empty-line-before': null,
'selector-type-case': null,
'no-descending-specificity': null,
'selector-pseudo-class-no-unknown': [
true,
{
ignorePseudoClasses: additionalPseudoSelectors,
},
],
'selector-pseudo-element-no-unknown': [
true,
{
ignorePseudoElements: additionalPseudoSelectors,
},
],

// Disable until we decide if we want "always" or "never"
'scss/load-partial-extension': null,

// Logical properties
'csstools/use-logical': [
'always',
{
// TODO: make it an error in the next major or large release
severity: 'warning',
// Only lint LTR-RTL properties for now
except: [
// Position properties
'top',
'bottom',
// Position properties with directional suffixes
/-top$/,
/-bottom$/,
// also for e.g. border-bottom-color
/-top-/,
/-bottom-/,
// Size properties
'width',
'max-width',
'min-width',
'height',
'max-height',
'min-height',
],
},
],
},
overrides: [
{
files: ['*.scss', '**/*.scss'],
rules: {
'at-rule-no-unknown': null,
'scss/at-rule-no-unknown': true,
},
},
],
}
94 changes: 4 additions & 90 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,99 +1,13 @@
/*
/*!
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

const additionalPseudoSelectors = [
// Vue <style scoped>
// See: https://vuejs.org/api/sfc-css-features.html
'deep',
'slotted',

// CSS Modules (including Vue <style module>)
// See: https://github.com/css-modules/css-modules/blob/master/docs/composition.md#exceptions
'global',
'local',
]

/** @type {import('stylelint').Config} */
module.exports = {
extends: [
'stylelint-config-recommended-scss',
'stylelint-config-recommended-vue/scss'
'./configs/linting.js',
'./configs/formatting.js',
],
ignoreFiles: ['**/*.js', '**/*.ts', '**/*.svg'],
plugins: ['stylelint-use-logical'],
rules: {
// Stylistic rules conflicting with prettier
'scss/operator-no-newline-after': null,
'scss/operator-no-newline-before': null,

'selector-type-no-unknown': null,
'rule-empty-line-before': [
'always',
{
ignore: ['after-comment', 'inside-block'],
},
],
'declaration-empty-line-before': [
'never',
{
ignore: ['after-declaration'],
},
],
'comment-empty-line-before': null,
'selector-type-case': null,
'no-descending-specificity': null,
'selector-pseudo-class-no-unknown': [
true,
{
ignorePseudoClasses: additionalPseudoSelectors,
},
],
'selector-pseudo-element-no-unknown': [
true,
{
ignorePseudoElements: additionalPseudoSelectors,
},
],

// Disable until we decide if we want "always" or "never"
'scss/load-partial-extension': null,

// Logical properties
'csstools/use-logical': [
'always',
{
// TODO: make it an error in the next major or large release
severity: 'warning',
// Only lint LTR-RTL properties for now
except: [
// Position properties
'top',
'bottom',
// Position properties with directional suffixes
/-top$/,
/-bottom$/,
// also for e.g. border-bottom-color
/-top-/,
/-bottom-/,
// Size properties
'width',
'max-width',
'min-width',
'height',
'max-height',
'min-height',
],
},
],
},
overrides: [
{
files: ['*.scss', '**/*.scss'],
rules: {
'at-rule-no-unknown': null,
'scss/at-rule-no-unknown': true,
},
},
],
}
100 changes: 94 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading