AI Prompts for Ensuring Code Follows Linting Rules

20 of the best prompts for ensuring code follows linting rules, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.

AI Prompts for Ensuring Code Follows Linting Rules

20 of the best prompts for ensuring code follows linting rules, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.

Scroll to explore

Published June 28, 2026

Getting Ensuring Code Follows Linting Rules right takes more than a single prompt. This 4-stage guide covers Diagnose the Wall, Isolate and Fix, Verify the Resolution, and more, breaking the whole process into focused steps where each prompt builds on the last. Windsurf may generate code that violates existing ESLint, Prettier, or other linting rules, causing integration issues. This can lead to broken builds or unexpected behavior in production. These prompts help developers ensure Windsurf respects all configured linting rules, maintaining code quality and consistency. Every prompt is optimized and runs in ChatGPT, Claude, and Gemini.

Diagnose the Wall

Identify which linting rules are being ignored by Windsurf.

Identify Ignored Rules

Analyze my ESLint configuration provided below: [PASTE CONTENT]. Identify which rules were ignored during the last code generation process. For each ignored rule, provide a brief explanation of its purpose and why it may have been overlooked. Additionally, suggest any necessary adjustments to ensure these rules are enforced in future code generations.

Diagnose the Wall

Check Prettier Compliance

Analyze the following Prettier configuration: [PASTE CONTENT]. Review the last code output provided and identify any Prettier rules that were not adhered to. For each rule that was violated, explain the specific issue and suggest how to correct it to ensure compliance with the Prettier standards. Please format your response in a clear, structured manner, listing each rule and the corresponding code example that illustrates the violation.

Diagnose the Wall

Review Linting Violations

Please review the following linting report: [PASTE CONTENT]. Identify the specific parts of the code that are causing the linting violations and explain why each violation is occurring. Additionally, provide suggestions on how to resolve these issues while maintaining the intended functionality of the code. Format your response in a clear, organized manner, detailing each violation and its corresponding explanation.

Diagnose the Wall

Analyze Cascade Mode Impact

Please analyze the changes made in Cascade mode across multiple files and identify which specific edits do not comply with the existing linting rules. For each non-compliant edit, provide a brief explanation of why it violates the rules. Additionally, suggest potential corrections or improvements that could bring these edits into compliance. Format your response in a clear list, including the file names and line numbers where the violations occur.

Diagnose the Wall

Evaluate Rule Understanding

Please evaluate the contents of my CLAUDE.md file: [PASTE CONTENT]. Confirm your understanding of each rule outlined in the document and identify any rules that were not applied in my recent tasks. For each rule, provide a brief explanation of its purpose and relevance, and suggest ways to ensure compliance in future tasks. Additionally, highlight any areas where clarification or further detail may be needed to enhance understanding.

Diagnose the Wall

Isolate and Fix

Focus on correcting the specific areas where Windsurf's output violates linting rules.

Correct ESLint Violations

Please review the provided code and identify the ESLint violations that have been ignored. Regenerate the code to ensure compliance with the ESLint rules, making necessary corrections while maintaining the original functionality. Highlight the changes made and explain why each correction was necessary. Additionally, provide a summary of the key ESLint rules that were violated and how the updated code adheres to them.

Isolate and Fix

Fix Prettier Issues

Reformat the following code to align with the provided Prettier configuration: [INSERT CODE HERE]. Ensure that all formatting issues are addressed, including indentation, line breaks, and spacing. After reformatting, provide a summary of the changes made and any specific areas where the code was significantly altered to meet the Prettier standards.

Isolate and Fix

Resolve Specific Errors

Please help me resolve the following specific error in my code: [PASTE ERROR]. Analyze the code snippet where this error occurs and provide a corrected version that eliminates the error while maintaining the intended functionality. Additionally, explain the changes made and why they effectively resolve the issue. Ensure that the corrected code is well-structured and follows best practices.

Isolate and Fix

Adjust Cascade Edits

Please review the multi-file edits made in Cascade mode and identify any adjustments needed to ensure compliance with all relevant linting rules. Provide a detailed summary of the specific linting rules that were violated and suggest appropriate modifications for each file. Additionally, outline the rationale behind each adjustment to help understand the importance of adhering to these rules. Format your response in a clear, organized manner, specifying the file names and the corresponding changes required.

Isolate and Fix

Apply Missing Rules

Please review the CLAUDE.md document and identify any missing linting rules that are not currently applied in the existing codebase. For each missing rule, provide a detailed explanation of its purpose and how it can enhance code quality. Then, outline the steps needed to implement these rules in the codebase, including any necessary modifications or configurations. Finally, summarize the expected benefits of applying these missing rules to the overall project.

Isolate and Fix

Verify the Resolution

Ensure that the code now complies with all linting rules.

Run ESLint Check

Please perform an ESLint check on the current codebase to identify any potential violations. Provide a detailed report that includes the number of violations found, the specific files and lines where these violations occur, and a brief explanation of each violation. Additionally, confirm whether the codebase adheres to the defined linting rules and suggest any improvements if necessary. Format the report in a clear and organized manner for easy reference.

Verify the Resolution

Execute Prettier Format

Please apply Prettier to the following code: [INSERT CODE HERE]. After formatting, confirm that the code is free of errors and adheres to the expected style guidelines. Additionally, provide a brief summary of any changes made during the formatting process and highlight any areas that may still require attention for optimal readability and maintainability.

Verify the Resolution

Validate Linting Compliance

Conduct a comprehensive linting check on the provided codebase. Identify any remaining linting rules that are being violated and provide a detailed report on each violation. Include the specific rule that is not being followed, the line number where the violation occurs, and a brief explanation of why it is considered a violation. Additionally, suggest possible solutions or corrections for each issue identified to ensure compliance with the linting standards.

Verify the Resolution

Confirm Cascade Adjustments

Please review the recent edits made in Cascade mode and confirm that they adhere to the project's linting rules. Provide a detailed analysis of any discrepancies or areas where the edits may not comply. Additionally, summarize the key adjustments made during this process and suggest any necessary corrections to ensure full compliance with the established linting standards. Format your response in a clear and structured manner, highlighting both compliant and non-compliant aspects.

Verify the Resolution

Check Rule Application

Please review the code and verify that all rules outlined in the CLAUDE.md document have been correctly applied. Provide a detailed analysis of each rule, indicating whether it has been implemented successfully or if there are any discrepancies. For any rules that are not applied correctly, explain the specific issues and suggest potential solutions to address them. Format your findings in a clear report, including examples from the code where applicable.

Verify the Resolution

Prevent Recurrence

Create artefacts to ensure future code generation respects all linting rules.

Create ESLint Rule

Please create a new ESLint rule to address recent issues identified in CLAUDE.md. The rule should specifically target [DESCRIBE THE VIOLATIONS] and provide clear guidance on how to avoid these violations in the future. Include examples of code that would trigger the rule and explanations of why these practices are important for maintaining code quality. Additionally, outline any configurations or options that can be adjusted to customize the rule's behavior based on project needs.

Prevent Recurrence

Draft Prettier Rule

Please suggest a new Prettier rule that should be added to the CLAUDE.md file to ensure consistent formatting and compliance in future projects. Include a detailed explanation of what the rule will enforce, why it is necessary, and how it will improve code quality. Additionally, provide an example of how the rule would affect existing code and any potential challenges in implementing it. Format your response as a structured proposal that can be easily reviewed and understood.

Prevent Recurrence

Generate Code Comment

Create a code comment template that serves as a reminder for developers to verify and adhere to linting rules before finalizing their code. The comment should include a brief explanation of the importance of linting, a checklist of common linting issues to look out for, and a prompt to ensure that all linting errors are resolved. Format the comment clearly so it can be easily understood and followed, and include placeholders for specific project details such as [PROJECT NAME] and [CODE FILE NAME]. Aim for a length of 3 to 5 sentences to ensure clarity and completeness.

Prevent Recurrence

Develop Session Checklist

Please create a detailed checklist for opening a coding session that ensures all necessary steps are followed for a smooth start. The checklist should include items such as verifying linting rule compliance, checking for any pending code reviews, ensuring all dependencies are up to date, and confirming that the development environment is properly configured. Additionally, include steps for setting up version control, reviewing project documentation, and preparing any necessary tools or resources. Format the checklist in a clear, easy-to-follow manner, with each item listed in a sequential order.

Prevent Recurrence

Establish Naming Convention

Please propose a detailed naming convention that can be added to the CLAUDE.md document to enhance adherence to linting rules. The convention should cover guidelines for naming variables, functions, classes, and files, ensuring clarity and consistency across the codebase. Include examples of acceptable names and explain the rationale behind the chosen conventions. Additionally, outline any specific patterns or prefixes that should be used to avoid conflicts and improve readability. Aim for a comprehensive section that can be easily referenced by developers.

Prevent Recurrence

Frequently asked questions

Why does Windsurf ignore my ESLint configuration?+

Windsurf may not automatically apply project-specific configurations unless explicitly instructed. Ensure your CLAUDE.md file is updated and referenced correctly in your project setup.

How can I make Windsurf respect Prettier settings?+

Ensure that your Prettier configuration is included in the CLAUDE.md file and that Windsurf is directed to follow it during code generation.

What is Cascade mode in Windsurf?+

Cascade mode allows Windsurf to make autonomous multi-file edits, which can sometimes lead to unexpected rule violations if not properly configured.

How do I update CLAUDE.md for better compliance?+

Use Windsurf to generate new rules or guidelines based on past issues and add them to CLAUDE.md to guide future code generation.

Can I automate linting checks with Windsurf?+

While Windsurf can assist in identifying and fixing linting issues, integrating automated linting checks in your CI/CD pipeline is recommended for ongoing compliance.