Globs, Types, and Ignore Rules/Add a custom type and search it immediately

Define and use the type in the same command.

Section: Type filters

Add a custom type and search it immediately

bash
bash
rg --type-add 'web:*.{html,css,js,ts,tsx}' -t web 'aria-' .
Explanation

The custom definition only applies to this invocation unless you put it in config.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Type filters
Define a custom file type on the command line
Create a reusable ad hoc type mapping.
OpenIn sheetbashsame section
Search only Rust files
Use a built-in type definition.
OpenIn sheetbashsame section
Exclude one file type
Search everything except Markdown.
OpenIn sheetbashsame section
Inspect all known types
View the file globs behind built-in types.
OpenIn sheetbashsame section
Search only JavaScript files
Restrict matches to paths matching a glob.
OpenIn sheetbash1 tag match
Include hidden files
Search dotfiles and hidden directories too.
OpenIn sheetbash1 tag match