https://github.com/shipsecure-labs/eslint-plugin-next
Secure your Next.js applications with @shipsecure/eslint-plugin-next, an ESLint plugin designed to detect and prevent common security vulnerabilities.
https://github.com/shipsecure-labs/eslint-plugin-next
eslint eslint-plugin eslint-rules security
Last synced: about 1 year ago
JSON representation
Secure your Next.js applications with @shipsecure/eslint-plugin-next, an ESLint plugin designed to detect and prevent common security vulnerabilities.
- Host: GitHub
- URL: https://github.com/shipsecure-labs/eslint-plugin-next
- Owner: ShipSecure-Labs
- License: mit
- Created: 2024-11-03T18:51:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-26T10:23:40.000Z (over 1 year ago)
- Last Synced: 2025-04-05T22:08:14.417Z (about 1 year ago)
- Topics: eslint, eslint-plugin, eslint-rules, security
- Language: TypeScript
- Homepage:
- Size: 76.2 KB
- Stars: 72
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @shipsecure/eslint-plugin-next
## Overview
`@shipsecure/eslint-plugin-next` is a custom ESLint plugin designed to enhance the security of Next.js applications by identifying potentially insecure patterns in code. This plugin offers a set of rules specifically tailored to prevent common security pitfalls in Next.js, encouraging best practices and securing your app's frontend and backend code.
## Features
- Rules for Secure Code: Detects usage of unsecure URLs, inline scripts, eval, and other potential security vulnerabilities.
- Recommended Configurations: Provides a recommended set of rules for immediate security improvements.
- Easy to Integrate: Seamlessly integrates with any Next.js project with simple installation and configuration.
## Installation
```bash
npm install @shipsecure/eslint-plugin-next --save-dev
```
## Usage
### Flat config (requires eslint >= v8.23.0)
Add the following to your `eslint.config.js` file:
```javascript
const shipsecureNext = require("@shipsecure/eslint-plugin-next");
module.exports = [shipsecureNext.configs.recommended];
```
### eslintrc config (deprecated)
Add the following to your `.eslintrc` file:
```javascript
module.exports = {
extends: ["plugin:@shipsecure/next/recommended-legacy"],
};
```
## Contributing
Contributions are welcome! If you'd like to add new rules, suggest enhancements, or report issues, please open a pull request or issue on our [GitHub repository](https://github.com/shipsecure-labs/eslint-plugin-next).
### Steps to Contribute
- Fork the repository.
- Create a new branch for your feature (git checkout -b feature-name).
- Make your changes and add tests.
- Run tests to ensure everything works (npm test).
- Push your branch and submit a pull request.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.