Your JavaScript Code Fixer Extension.
Equilix extension provides the following features:
- Automatically converts
var
variable declarations toconst
where applicable, promoting the use of immutable variables and preventing unintentional reassignments.
- Automatically converts loose equality (
==
and!=
) to strict equality (===
and!==
) to avoid type coercion issues and ensure more predictable comparison behavior.
- Identifies various
for
loop formats and offers the option to convert them to more concise and expressiveforEach
ormap
methods, making your code cleaner and easier to read.
- Equilix analyzes your code and detects unused variables within a single file's scope. It can then highlight or remove those unused variables, helping you maintain a more organized and optimized codebase.
- Real-time feedback with an on-save popup notification indicating the successful conversion.
- With Equilix, there's no need to manually run ESLint with the --fix flag modify package.json scripts. Equilix seamlessly integrates into Visual Studio Code and automatically applies the necessary code transformations on save. This eliminates the extra steps of running ESLint separately and simplifies the development workflow. By using Equilix, you can avoid the hassle of configuring and running ESLint with --fix, setting up scripts in package.json, and ensuring consistent execution across different environments. Equilix provides a more straightforward and streamlined approach to code transformations, making the process quicker and more convenient.
βοΈ Note
While Equilix offers a simplified alternative for specific code transformations, it's important to recognize that ESLint remains a robust tool for code linting, offering extensive rule sets, customizability, and integration with various development environments. Depending on your project's complexity and specific requirements, ESLint might be the preferred choice to enforce a wider range of coding standards.
Equilix is built using the following technologies:
-
JavaScript and TypeScript: The core functionality and extension API are implemented using JavaScript and TypeScript, providing a robust and efficient codebase.
-
Visual Studio Code Extension API: Equilix leverages the powerful Visual Studio Code Extension API to integrate seamlessly into the editor, allowing automatic code transformations on save.
-
Regular Expressions: The conversion logic relies on regular expressions to identify and replace var, ==, and != occurrences, ensuring accurate and efficient transformations.
- Visual Studio Code version 1.56.0 or above.
- Launch Visual Studio Code.
- Go to the Extensions view (Ctrl+Shift+X).
- Search for "Equilix" and click Install.
- Reload Visual Studio Code to activate the extension.
- Open a JavaScript file (.js) in Visual Studio Code.
- As you save the file, Equilix will automatically convert and
==
to===
and!=
to!==
. - If any conversions are made, a success notification popup will be displayed will the line number where that conversion happened
- Open a JavaScript file (.js) in Visual Studio Code.
- If On save it does not automarically convert them open command pallete
(cntrl+shift+p)
and type equilix - Press
enter
and you will see a error stating thatwrong command
pressok
- Now again on save , your extension should be enable
Equilix does not require any additional configuration. It works out of the box with the default settings.
- If you encounter any issues or have suggestions, please open an issue.
- Contributions are welcome! Feel free to and submit a pull request.
This extension is licensed under the MIT License.
Thank you for using Equilix! If you find it helpful, don't forget to leave a βοΈ on the GitHub repository. If you have any questions or need further assistance, please don't hesitate to reach out.
Thank you for your interest in contributing to Equilix! We appreciate your help in making our project even better. Here's a step-by-step guide to get you started:
Start by forking the Equilix repository to your GitHub account. This will create a copy of the repository under your account.
Clone the forked repository to your local machine using Git. This will download a copy of the repository to your computer.
git clone https://github.com/your-username/Equilix.git
Navigate to the cloned repository directory and set up the development environment by running the following command:
npm install
This command will install all the necessary dependencies and tools required for development.
Now you're ready to start making changes! Use your favorite code editor to make the necessary modifications and enhancements to the project. Feel free to explore the codebase, add new features, fix bugs, or improve the documentation.
To debug your changes, use the F5
key in your code editor. This will compile and run the extension in a new Extension Development Host window. You can then test your changes and ensure they are working as expected.
Once you're satisfied with your changes, it's time to share them with us. Commit your changes locally, push them to your forked repository on GitHub, and then create a Pull Request (PR) from your forked repository to the main Equilix repository. Make sure to provide a clear and descriptive title for your PR and explain the changes you've made. We will review your contribution and provide feedback if necessary.
That's it! By following these steps, you'll be able to contribute to Equilix and make a positive impact on the project. We greatly appreciate your support and look forward to reviewing your contributions. Happy coding!
Happy coding! β¨π
Before:
function compareValues(a, b) {
return a == b;
}
After:
function compareValues(a, b) {
return a === b;
}
Before:
function calculateArea(radius) {
var pi = 3.14159;
var area = pi * radius * radius;
return area;
}
After:
function calculateArea(radius) {
const pi = 3.14159;
const area = pi * radius * radius;
return area;
}
Before:
const numbers = [1, 2, 3, 4, 5];
const doubledNumbers = [];
for (let i = 0; i < numbers.length; i++) {
doubledNumbers.push(numbers[i] * 2);
}
After:
const numbers = [1, 2, 3, 4, 5];
const doubledNumbers = [];
numbers.forEach((number) => {
doubledNumbers.push(number * 2);
})
Before:
function calculateSum(a, b) {
const result = a + b;
const temp = a * b; // Unused variable
return result;
}
After:
Detected 1 unused variable: temp.