DEV Community

Ramu Narasinga
Ramu Narasinga

Posted on

.cursorignore file in Refine codebase, an OSS React framework

In this article, we will review the file, .cursorignore, in Refine codebase. Refine is an open-source React framework to build internal tools.  

Image description

We are familiar with .gitignore but let’s learn what .cursorignore file is about.

Cursor

Cursor is the AI code editor built to make you extraordinarily productive, Cursor is the best way to code with AI.

Okay, so how’s having a .cursorignore file helping? Let’s look at the documentation.

Cursor provides two different ignore files to control how files are handled:

  • .cursorignore: Makes a best-effort attempt to exclude files from both AI features and indexing

  • .cursorindexingignore: Controls only which files are indexed for search and context (same as the old .cursorignore)

Below is a note I found in the documentation.

The .cursorignore is best-effort, meaning we do not guarantee that files in it are blocked from being sent up. We may have bugs that allow ignored files to be sent up in certain cases. Please let us know if you find bugs like that and we will do our best to fix!

The idea behind this file is to not let AI access the senstive secrets and the proprietary code. Read more about .cursorignore in the documentation.

Now that we understand the basics, let’s see what sort of files and folders are mentioned in the Refine’s .cursorignore.

.biome/
.codesandbox/
.husky/
.vscode/
cypress/
documentation/.docusaurus/
documentation/build/
documentation/node_modules/
documentation/plugins/
documentation/src/
documentation/static/
documentation/test/
documentation/versioned_docs/
documentation/versioned_sidebars/
examples/
hackathon/
patches/
pnpm-lock.yaml
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md
SECURITY.md
packages/**/tsconfig.json
packages/**/tsconfig.test.json
packages/**/tsconfig.declarations.json
packages/**/jest.config.js
packages/**/refine.config.js
packages/**/tsup.config.ts
dist/
Enter fullscreen mode Exit fullscreen mode

One thing I do want to mention is the fact that there is a specificity in declaring the documentation folder. They could have just done something like documentation/*, may be this has to do with the note that was mentioned above about how some files, even mentioned in .gitignore, might be accessed by AI and this is just a way to ensure these files in documentation folder are not accessed by AI. Interesting.

I also wonder why packages/**/tsconfig.json and other config file are left out from AI indexing. I mean, these could have some base path or some other configuration that can be leveraged with the code generation. I am not sure really. Makes me want to search for more .cursorignore files in the wild to get an understanding what sort of files are normally ignored. I might just do this in the future when I come across .cursorignore again.

About me:

Hey, my name is Ramu Narasinga. I study large open-source projects and create content about their codebase architecture and best practices, sharing it through articles, videos.

I am open to work on interesting projects. Send me an email at ramu.narasinga@gmail.com

My Github —  https://github.com/ramu-narasinga

My website —  https://ramunarasinga.com

My Youtube channel —  https://www.youtube.com/@thinkthroo

Learning platform —  https://thinkthroo.com

Codebase Architecture —  https://app.thinkthroo.com/architecture

Best practices —  https://app.thinkthroo.com/best-practices

Production-grade projects —  https://app.thinkthroo.com/production-grade-projects

References:

  1. https://docs.cursor.com/context/ignore-files

  2. https://github.com/getcursor/cursor/issues/965

  3. https://github.com/refinedev/refine/blob/main/.cursorignore

  4. https://www.cursor.com/

AWS Q Developer image

Your AI Code Assistant

Generate and update README files, create data-flow diagrams, and keep your project fully documented. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

Playwright CLI Flags Tutorial

5 Playwright CLI Flags That Will Transform Your Testing Workflow

  • 0:56 --last-failed: Zero in on just the tests that failed in your previous run
  • 2:34 --only-changed: Test only the spec files you've modified in git
  • 4:27 --repeat-each: Run tests multiple times to catch flaky behavior before it reaches production
  • 5:15 --forbid-only: Prevent accidental test.only commits from breaking your CI pipeline
  • 5:51 --ui --headed --workers 1: Debug visually with browser windows and sequential test execution

Learn how these powerful command-line options can save you time, strengthen your test suite, and streamline your Playwright testing experience. Click on any timestamp above to jump directly to that section in the tutorial!

Watch Full Video 📹️

👋 Kindness is contagious

DEV is better (more customized, reading settings like dark mode etc) when you're signed in!

Okay