forked from nervosnetwork/ckb-explorer-frontend
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: stylelint ineffectiveness and differences in stylelint execution…
… on different os (#107) * fix: stylelint ineffectiveness and differences in stylelint execution on different os * chore: format by stylelint * fix: manually fixing some stylelint issues that can't be fixed automatically * feat: stylelint only exec from the staged files * fix: code error caused by merge PR #103
- Loading branch information
1 parent
8d19adc
commit 3365797
Showing
48 changed files
with
758 additions
and
247 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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn lint:css | ||
yarn lint-staged | ||
yarn test | ||
npx lint-staged |
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,64 @@ | ||
const package = require('./package.json') | ||
|
||
module.exports = { | ||
customSyntax: 'postcss-scss', | ||
extends: ['stylelint-config-standard'], | ||
rules: { | ||
'no-empty-source': null, | ||
// Due to the large number of non-standard names previously used, it is not possible to quickly correct all names, | ||
// so these rules have been temporarily disabled. | ||
'selector-class-pattern': null, | ||
'selector-id-pattern': null, | ||
'custom-property-pattern': null, | ||
// This rule provides little benefit relative to the cost of implementing it, so it has been disabled. | ||
'no-descending-specificity': null, | ||
|
||
'selector-pseudo-class-no-unknown': [ | ||
true, | ||
{ | ||
// to support `:global` | ||
ignorePseudoClasses: ['global'], | ||
}, | ||
], | ||
}, | ||
|
||
overrides: [ | ||
{ | ||
files: ['*.scss', '**/*.scss'], | ||
extends: ['stylelint-config-standard-scss'], | ||
rules: { | ||
'scss/dollar-variable-pattern': null, | ||
}, | ||
}, | ||
{ | ||
files: ['*.tsx', '**/*.tsx'], | ||
customSyntax: 'postcss-styled-syntax', | ||
// Currently, it is difficult to integrate postcss into styled-components to achieve CSS compatibility, unless a complex but not robust implementation is done manually. | ||
// However, considering the implementation cost and the possibility that we may gradually abandon styled-components in the future, we do not adopt this solution. | ||
// Therefore, without postcss to automatically handle compatibility, we need to handle it manually and avoid introducing syntax that is too high for stylelint. | ||
// So here we introduce stylelint-no-unsupported-browser-features to help identify unsupported features and manually disable some stylelint rules that involve high-version features. | ||
plugins: ['stylelint-no-unsupported-browser-features'], | ||
rules: { | ||
'media-feature-range-notation': null, | ||
'plugin/no-unsupported-browser-features': [ | ||
true, | ||
{ | ||
browsers: package.browserslist, | ||
// TODO: Perhaps the browserslist should be adjusted to a more reasonable range, at least to a level that is compatible with CSS variables. | ||
ignore: [ | ||
'css-nesting', | ||
'css-sticky', | ||
'css-variables', | ||
'mdn-text-decoration-shorthand', | ||
'css-unset-value', | ||
'flexbox-gap', | ||
'css-font-stretch', | ||
'css-overscroll-behavior', | ||
], | ||
ignorePartialSupport: true, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
} |
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
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.
3365797
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
ckb-explorer-frontend-in-magickbase-repo – ./
ckb-explorer-frontend-in-magickbase-repo-git-develop-magickbase.vercel.app
ckb-explorer.magickbase.vercel.app
ckb-explorer-frontend-in-magickbase-repo-magickbase.vercel.app
ckb-explorer-six.vercel.app