question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

automatically removes debugger statements

See original GitHub issue

Prettier automatically removes my debugger statements (not very nice 😛).

Here is a conversation with @kentcdodds https://twitter.com/jasonlaster11/status/890683399974920194

Atom version: 1.18.0
prettier-atom version: 0.37.0
prettier version: 1.5.3
prettier-eslint version: 6.4.2
prettier-atom configuration: {
  "formatOnSave": true,
  "formatOnSaveOptions": {
    "enabled": true,
    "excludedGlobs": [
      "**/mochitest/**",
      "**/assets/**"
    ],
    "respectEslintignore": true,
    "showInStatusBar": false,
    "javascriptScopes": [
      "source.js",
      "source.jsx",
      "source.js.jsx",
      "source.babel",
      "source.js-semantic",
      "text.html.basic",
      "text.html.vue"
    ],
    "typescriptScopes": [
      "source.ts",
      "source.tsx",
      "source.ts.tsx"
    ],
    "cssScopes": [
      "source.css",
      "source.less",
      "source.css.less",
      "source.scss",
      "source.css.scss"
    ],
    "jsonScopes": [
      "source.json"
    ],
    "whitelistedGlobs": [],
    "isDisabledIfNotInPackageJson": false
  },
  "prettierOptions": {
    "singleQuote": false,
    "bracketSpacing": true,
    "semi": true,
    "useTabs": false,
    "jsxBracketSameLine": false,
    "printWidth": 80,
    "tabWidth": "auto",
    "trailingComma": "none",
    "parser": "babylon"
  },
  "silenceErrors": true,
  "useEslint": true,
  "useEditorConfig": true,
  "prettierEslintOptions": {
    "prettierLast": false
  }
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
robwisecommented, Jul 28, 2017

That would be one way to solve it. The disadvantage is now you can’t use prettier-eslint to auto-fix this in the cases where you actually do want it to fix that. In other words, it seems when you’re using prettier-atom, you probably don’t want to remove the debugger, but if you’re using prettier-eslint in some sort of validate script, you probably do.

In order to get both, you could allow passing an option for prettier-eslint that lets you override eslint rules at the time of invocation? That way you could have debuggers disabled in your eslint config, but prettier-atom could call prettier-eslint and override that rule as we assume it’s okay for development? Then when you run prettier-eslint as part of a validate script or whatever, it still removes it for you.

2reactions
kentcdoddscommented, Aug 30, 2017

I’m going to move this over here: https://github.com/prettier/prettier-eslint/issues/118

Read more comments on GitHub >

github_iconTop Results From Across the Web

Automatically Remove System.debug statements from Apex ...
Using sublime text you can use the feature. Find > find in files (CTRL+Shift+F). Activate regular expression by clicking the button .*.
Read more >
Is there a way to remove debugger & console.log statements ...
In .Net MVC project I need to remove all the debugger and console.log statements from js files when I do a release build,...
Read more >
Remove console and debugger statements for production with ...
Let's make use of our preferred build tool and remove all debug statements before deploying code to production.
Read more >
All 'debugger' statements should be removed
In JSLint the warning given is "Unexpected 'debugger'". In JSHint prior to version 1.0.0 the message used is "All 'debugger' statements should be...
Read more >
Debugger statements should not be used - SonarSource Rules
The debugger statement can be placed anywhere in procedures to suspend execution. Using the debugger statement is similar to setting a breakpoint in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found