In this article, we will review the file, .cursorignore, in Refine codebase. Refine is an open-source React framework to build internal tools.
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/
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
Top comments (0)