coderaiser
coderaiser
The thing is I need `scope` to get information about declared variables. When I change code according to https://github.com/babel/babel/issues/11350#issuecomment-644118606 ```js const {File} = require('@babel/core'); const {parse} = require("@babel/parser"); const traverse...
@nicolo-ribaudo could you please tell me where can I get `babel.File` from: ```js const file = new babel.File({ filename: "__putout.js" }, { code, ast }); ```
Here is how it can look like with 🐊**Putout**: https://putout.cloudcmd.io/#/gist/12b7eb96e17213067d22849890dbda3a/44d2c775f1d8872b62162ac76a5b3c762dbe92d2 ```js export const report = () => `Add argument to ‘atom'`; export const match = ({__a}) => ({ 'const __a...
Here is example: ```js let line = ''; for (let i = 0; i < 100000000; i++) line += 'a'; console.time('vulnerable'); console.log(/{.*}/.test(line)); console.timeEnd('vulnerable'); console.time('still vulnerable'); console.log(/\{.*?\}/.test(line)); console.timeEnd('still vulnerable'); console.time('fixed'); console.log(line.startsWith('{')...
> You know that the regex checks for braces anywhere in the string, not just the start and end? Is it really needed in this case? I haven’t seen tests...
Here is documentation, you better fix it so it corresponded to what you want to say:  Do we actually need any kind of braces check, if `nobraces` passed? It...
We can use `includes` in this case: ```diff micromatch.braces = (pattern, options) => { if (typeof pattern !== 'string') throw new TypeError('Expected a string'); - if ((options && options.nobrace ===...
> What if it does include a single one? Would it be correct glob that worth parsing?
Sure https://github.com/coderaiser/putout/commit/4a83bb83f611802a78c3ff51cd6b19dea8c0fbd8
Good question! There is default ignore rules in `putout.json` which says to ignore `coverage` directory. And user can create it's own `.putout.json` file, and would be great if he can...