Skip to content

Commit

Permalink
chore: integrate stylelint
Browse files Browse the repository at this point in the history
  • Loading branch information
brionmario committed Feb 13, 2023
1 parent e34dc02 commit 2e320ee
Show file tree
Hide file tree
Showing 21 changed files with 628 additions and 22 deletions.
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@
"typescriptreact",
"html",
"vue"
]
],
"css.validate": false,
"less.validate": false,
"scss.validate": false,
"stylelint.validate": ["css", "scss"]
}
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ These developer tools will help you to have a better developer experience since
* [Download for Webstorm](https://www.jetbrains.com/help/webstorm/eslint.html)
* [Download for VS Code](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)

#### Stylelint

* Type 🧰 : IDE Extension
* Description 🗒️ : Static code analysis tool for Stylesheets.
* Download Links 🔗
* [Setup for Webstorm](https://www.jetbrains.com/help/webstorm/using-stylelint-code-quality-tool.html)
* [Download for VS Code](https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint)

#### ShellCheck

* Type 🧰 : IDE Extension
Expand Down
6 changes: 5 additions & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
"scripts": {
"build": "rollup -c",
"build-storybook": "build-storybook --no-manager-cache",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"lint": "pnpm lint:es && pnpm lint:styles",
"lint:es": "eslint . --ext .js,.jsx,.ts,.tsx",
"lint:styles": "stylelint 'src/**/*.{css,scss,sass}' --config stylelint.config.cjs --allow-empty-input",
"start": "pnpm storybook",
"storybook": "start-storybook -p 6006",
"test": "NODE_OPTIONS=--experimental-vm-modules pnpm jest --passWithNoTests",
Expand Down Expand Up @@ -75,6 +77,7 @@
"@types/testing-library__jest-dom": "^5.14.5",
"@wso2/eslint-plugin": "https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/eslint-plugin?27de3d37a97801704a42e407342eca01dfd00ff6",
"@wso2/prettier-config": "https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/prettier-config?27de3d37a97801704a42e407342eca01dfd00ff6",
"@wso2/stylelint-config": "https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/stylelint-config?27de3d37a97801704a42e407342eca01dfd00ff6",
"babel-jest": "^29.3.1",
"babel-loader": "^8.3.0",
"eslint": "8.25.0",
Expand All @@ -95,6 +98,7 @@
"storybook-addon-designs": "^6.3.1",
"storybook-addon-themes": "^6.1.0",
"storybook-dark-mode": "^1.1.2",
"stylelint": "^15.1.0",
"ts-dedent": "^2.2.0",
"ts-jest": "^29.0.3",
"tsconfig-paths-webpack-plugin": "^4.0.0",
Expand Down
22 changes: 22 additions & 0 deletions packages/react/src/components/AppBar/app-bar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

.oxygen-button {
font-size: 1rem;
padding: 8px 16px;
}
4 changes: 3 additions & 1 deletion packages/react/src/components/Box/box.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@
* under the License.
*/

.oxygen-box {}
.oxygen-box {
/* Add Styles */
}
22 changes: 22 additions & 0 deletions packages/react/src/components/Button/button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

.oxygen-button {
font-size: 1rem;
padding: 8px 16px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

.oxygen-color-mode-toggle {
/* Add Styles */
}
21 changes: 21 additions & 0 deletions packages/react/src/components/Grid/grid.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

.oxygen-grid {
/* Add Styles */
}
4 changes: 3 additions & 1 deletion packages/react/src/components/IconButton/icon-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@
* under the License.
*/

.oxygen-icon-button {}
.oxygen-icon-button {
/* Add Styles */
}
21 changes: 21 additions & 0 deletions packages/react/src/components/Link/link.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

.oxygen-link {
/* Add Styles */
}
4 changes: 3 additions & 1 deletion packages/react/src/components/List/list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@
* under the License.
*/

.oxygen-list {}
.oxygen-list {
/* Add Styles */
}
4 changes: 3 additions & 1 deletion packages/react/src/components/ListItem/list-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@
* under the License.
*/

.oxygen-list-item {}
.oxygen-list-item {
/* Add Styles */
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@
* under the License.
*/

.oxygen-list-item-button {}
.oxygen-list-item-button {
/* Add Styles */
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@
* under the License.
*/

.oxygen-list-item-icon {}
.oxygen-list-item-icon {
/* Add Styles */
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@
* under the License.
*/

.oxygen-list-item-text {}
.oxygen-list-item-text {
/* Add Styles */
}
3 changes: 1 addition & 2 deletions packages/react/src/components/SignIn/sign-in.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@

.oxygen-sign-in {
display: flex;
flex-direction: column;
flex-wrap: nowrap;
flex-flow: column nowrap;
align-content: center;
justify-content: center;
align-items: center;
Expand Down
21 changes: 21 additions & 0 deletions packages/react/src/components/TextField/text-field.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

.oxygen-text-field {
/* Add Styles */
}
21 changes: 21 additions & 0 deletions packages/react/src/components/Tooltip/tooltip.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

.oxygen-tooltip {
/* Add Styles */
}
4 changes: 3 additions & 1 deletion packages/react/src/components/Typography/typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@
* under the License.
*/

.oxygen-typography {}
.oxygen-typography {
/* Add Styles */
}
22 changes: 22 additions & 0 deletions packages/react/stylelint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

module.exports = {
extends: ['@wso2/stylelint-config'],
ignoreFiles: ['**/*.js', '**/*.cjs'],
};
Loading

0 comments on commit 2e320ee

Please sign in to comment.