eslint-to-esformatter icon indicating copy to clipboard operation
eslint-to-esformatter copied to clipboard

v1.0.0-alpha.2 - Features

Open Nate-Wilkins opened this issue 10 years ago • 15 comments

v1.0.0-alpha.2

Working off of eslint 0.19.0

Framework

  • [x] #3 logging
  • [x] #4 deprecated rules
  • [x] rule documentation (things not supported in eslint/esformatter)

Core Rules

  • [x] brace-style
    • [x] stroustrup
  • [x] indent
    • [x] indentSwitchCase
  • [x] comma-spacing
  • [x] eol-last
  • [x] newline-after-var
  • [x] key-spacing
  • [ ] generator-star-spacing
  • [ ] no-multi-spaces
  • [ ] no-multiple-empty-lines
  • [ ] no-spaced-func
  • [ ] no-trailing-spaces
  • [ ] padded-blocks
  • [ ] semi-spacing
  • [ ] space-after-keywords @Nate-Wilkins
  • [ ] space-before-blocks @Nate-Wilkins
  • [ ] space-before-function-paren
  • [ ] space-in-brackets
  • [ ] space-in-parens
  • [ ] space-infix-ops @Nate-Wilkins
  • [ ] space-return-throw-case
  • [ ] space-unary-ops
  • [ ] spaced-line-comment

Other

  • [x] All deprecated rules
  • [x] All informative rules
  • [x] All unsupported rules (requires esformatter plugin(s))

Nate-Wilkins avatar Apr 15 '15 16:04 Nate-Wilkins

I have code for the rules listed (block-scoped-var, brace-style, indent, coma-spacing, eol-last, newline-after-var)

@Flet Add anything you want here!

Nate-Wilkins avatar Apr 15 '15 16:04 Nate-Wilkins

key-spacing and indent are done and tested... added key-spacing to the list.

Flet avatar Apr 15 '15 20:04 Flet

Pushed up indentSwitchCase and a few other things with comments in commits.

Nate-Wilkins avatar Apr 20 '15 20:04 Nate-Wilkins

You have been busy! :+1:

Flet avatar Apr 20 '15 20:04 Flet

Yup :+1: as a side note I can't get faucet to work... I'm using windows 8 which looks to be the culprit or my node version I'll open an issue on faucet's repo if I'm still having issues

Adding the debug module now along with the rest of the rules I have.

Nate-Wilkins avatar Apr 20 '15 21:04 Nate-Wilkins

Ah, faucet will only execute tests that are at the root of the test directory. I just rearranged things in this commit https://github.com/Flet/eslint-to-esformatter/commit/abea90a9e05dbdcffe12233148aad9fcb05d1bef to make it work.

  • put rules at the root
  • moved test-rule.js into new dir lib

Also I just added a little skip option to get around blocked-scope-var having no tests.

So now running faucet does this for me:

⨯ brace-style
  not ok 3 format using: rule on, stroustrup
    ---
      operator: equal
      expected:
        'function foo() {\n  return true;\n}\n\nif (foo) {\n  bar();\n}\n\ntry {\n  somethingRisky();\n}\ncatch (e) {\n  handleError();\n}\n\nif (foo) {\n  bar();\n}\nelse {\n  baz();\n}'
      actual:
        'function foo() {\n  return true;\n}\n\nif (foo) {\n  bar();\n}\n\ntry {\n  somethingRisky();\n} catch (e) {\n  handleError();\n}\n\nif (foo) {\n  bar();\n} else {\n  baz();\n}'
      at: Test.<anonymous> (/home/icmpdev/code/eslint-to-esformatter/test/lib/test-rule.js:11:16)
    ...
✓ indent
✓ key-spacing
# tests 14
# pass  13
⨯ fail  1

Is it working for you with these updates?

Flet avatar Apr 20 '15 23:04 Flet

That's expected behavior atm https://github.com/Flet/eslint-to-esformatter/commit/9fa6f7c46de2b1c3d03f952d4c077e93cea00679 where the CatchKeyword doesn't get the correct line break

Nate-Wilkins avatar Apr 21 '15 16:04 Nate-Wilkins

Cool, does fauct work on windows for you?

Flet avatar Apr 21 '15 16:04 Flet

No same thing unfortunately. capture

Nate-Wilkins avatar Apr 21 '15 16:04 Nate-Wilkins

Added leasot to parse out TODO comments. Currently not in 'gulp test' or if we want it at all. Just need a way to keep track of the things I can't fix atm.

Nate-Wilkins avatar Apr 21 '15 19:04 Nate-Wilkins

Will this work? https://github.com/Flet/eslint-to-esformatter/commit/addbd71bd004b76b5163dda01a58474aa6177f65

basically just run npm run todo and it will scan the whole codebase and write TODO.md at root.

Flet avatar Apr 21 '15 20:04 Flet

RE: faucet, dumping it for now.

Instead just running plain tape and piping to tap-difflet which will highlight diffs in output. Tested and working on Windows :+1: https://github.com/Flet/eslint-to-esformatter/commit/761259d7f6714099f97f28e60b57bd87116809df

Flet avatar Apr 21 '15 20:04 Flet

:+1:

Nate-Wilkins avatar Apr 22 '15 01:04 Nate-Wilkins

Updated again. Adding all the informative, deprecated, and unsupported rules now.

Nate-Wilkins avatar Apr 22 '15 15:04 Nate-Wilkins

Heh, leasot kinda goes overboard with the TODO headings in its output!

Flet avatar Apr 22 '15 17:04 Flet