Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guanbinrui/eslint-plugin-no-scrollbar
https://github.com/guanbinrui/eslint-plugin-no-scrollbar
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/guanbinrui/eslint-plugin-no-scrollbar
- Owner: guanbinrui
- License: mit
- Created: 2023-08-21T07:30:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-21T16:05:50.000Z (over 1 year ago)
- Last Synced: 2024-10-08T03:40:14.019Z (3 months ago)
- Language: JavaScript
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-plugin-no-scrollbar
An ESLint plugin that detects the use of '::webkit-scrollbar' and suggests using '[data-no-scrollbar]' instead.
## Installation
To use this ESLint plugin, you need to have ESLint already installed. If not, you can install it using:
```bash
npm install eslint --save-dev
```Next, you can install the `eslint-plugin-no-scrollbar` plugin:
```bash
npm install eslint-plugin-no-scrollbar --save-dev
```## Configuration
In your ESLint configuration (`.eslintrc.js`), add the plugin and enable the rule:
```js
module.exports = {
plugins: ["eslint-plugin-no-scrollbar"],
rules: {
"no-scrollbar": "error",
},
};
```## Rules
`no-scrollbar`
This rule detects the use of `'::webkit-scrollbar'` and suggests using `'[data-no-scrollbar]'` instead.
### Examples of valid code:
```javascript
const useStyles = () => ({
content: {},
});
```Examples of invalid code:
```javascript
const useStyles = () => ({
"::-webkit-scrollbar": {},
});
```## Testing
To run the tests for this plugin, make sure you have Node.js and npm installed, then run:
```bash
npm test
```The tests use Jest to validate the correctness of the ESLint rule implementation.
## Contributing
Contributions are welcome! Feel free to open issues or pull requests.
## License
This project is licensed under the MIT License - see the LICENSE file