Comments (4)
I'm going to give this a try -- super thanks! This will make maintenance much easier.
from putout.
I'll close it if all questions resolved, feel free to reopen if you have any questions :)
from putout.
Could you please provide code example: before and after?
from putout.
Traverser
One of the ways to transform regular expressions is using Traverser:
export const report = () => `Remove regular expression`;
export const fix = (path) => {
path.remove();
};
export const traverse = () => ({
RegExpLiteral(path) {
push(path);
}
});
Check out in 🐊Putout Editor
Replacer
You can also use Replacer:
export const report = () => `Drop regexp`;
export const replace = () => ({
'/__a/': ({__a}, path) => {
return '';
}
});
Check out in 🐊Putout Editor
You can find more examples in sources of @putout/plugin-regexp.
from putout.
Related Issues (20)
- Incorrect removing of an expression HOT 2
- ignore test files HOT 5
- path is missing for ruler toggler HOT 2
- babel config is not loaded. HOT 13
- how to run just specific rules HOT 1
- putout ignores camelCased paths HOT 1
- Using async functions in replacer HOT 6
- Mistaken removal of semi from unnamed prop types in FC HOT 12
- @putout/printer: Removed useful comma in TS HOT 6
- 🐊 name.startsWith is not a function HOT 13
- How to use indetifier name as a string? HOT 4
- It it possible to use Putout as Eslint backend? HOT 1
- remove-unused-expressions: "use client" false warning HOT 2
- ESLint integration fail HOT 4
- Option to configure printer overrides from HOT 10
- doesn't work with yarn 4 and pnp HOT 2
- does more than asked for HOT 3
- Closing arrow bracket (>) inside React components should not be transformed into `>` automatically HOT 1
- `npm install` broken due to eslint shenanigans HOT 1
- how to remove "yield" HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from putout.