115 Commits

Author SHA1 Message Date
Kai Cataldo
d8e6219ad9 @babel/eslint-plugin: Update rules/tests to use @babel/eslint-parser (#10977)
* Use @babel/eslint-parser for tests

* Update rules/tests

* Update docs

* add @babel/eslint-shared-fixtures to package.json

* remove bug fix

* convert RuleTester to ESM

* Update devDep versions
2020-01-11 20:42:21 +01:00
Kai Cataldo
9f832c2716
@babel/eslint-parser: Fix ClassPrivateMethods (#10913) 2020-01-02 18:36:58 -05:00
Kai Cataldo
25f7e6808e
@babel/eslint-parser: refactor configuration logic (#10860) 2019-12-11 18:06:37 -05:00
Huáng Jùnliàng
de1fa902f0 Tune eslint packages test configuration (#10848)
* Do not load root babel.config.js in esilnt tests

* add testcase: sourceType: script + globalReturn: true

* chore: remove globalReturn on default test config
2019-12-10 01:14:29 +01:00
Kai Cataldo
e81bbd69b3 Clean up @babel/eslint-parser (#10753)
* Ensure compilation works for @babel/eslint-parser

* Update with review suggestions

* Incorporate feedback :)
2019-11-25 22:17:45 +01:00
Kai Cataldo
2c40b8c706 Fix failing tests 2019-11-22 16:25:38 -05:00
Raja Sekar
f087cf842f Mocha to jest migration for eslint packages (#10716)
* migrated mocha to jest

* migrated mocha to jest - 2

* migrated mocha to jest - removed preversion hook from script

* migrated mocha to jest - 3

* migrated mocha to jest - 4

* cleanup

* review

* review
2019-11-16 12:32:19 +01:00
Kai Cataldo
47de99e1b8 Use @babel/core#parse (babel/babel-eslint#711) 2019-01-10 15:25:00 -05:00
Kai Cataldo
22a1681e11 Merge pull request babel/babel-eslint#706 from kaicataldo/es6
Update ESLint config
2018-10-30 14:48:37 -05:00
Henry Zhu
e56b342e59 Revert babel/babel-eslint#584 (babel/babel-eslint#697)
* Revert "Treat type alias declarationlike function declaration (babel/babel-eslint#584)"

This reverts commit 020d012c554913fea137f4129798ce31a4896dfe.
2018-09-27 10:29:29 -04:00
Henry Zhu
742aa412a7 test value should be switched 2018-09-25 15:29:14 -04:00
Joa Ebert
22fa8e6f20 Treat type alias declarationlike function declaration (babel/babel-eslint#584)
A type alias shouldn't trigger a no-use-before-define warning just
like a function declaration.

Cyclic type dependencies are common when using flow.
For instance: type Node<T> = { head: T; tail: Node<T> }

Fixes babel/babel-eslint#485
2018-09-25 20:39:43 +02:00
Rubén Norte
a17917810d Merge pull request babel/babel-eslint#645 from rubennorte/support-new-flow-syntax-in-scope-analysis
Support new flow syntax in scope analysis
2018-07-06 17:20:52 +01:00
Rubén Norte
dcf55cb730 Upgrade Babel to v7.0.0-beta.52 (babel/babel-eslint#650)
* Upgrade Babel to v7.0.0-beta.52

* Fixed failing test
2018-07-06 14:50:59 +01:00
Rubén Norte
4f9e2a5be6 Breaking: Upgraded Babel to 7.0.0-beta.51 (babel/babel-eslint#642)
* Upgraded Babel to 7.0.0-beta.51, with changes to decorators

* Removed support for Node 4 and added it for Node 10

* nit: fix typo [skip ci]
2018-06-29 14:26:43 +01:00
Brian Ng
077bea0a45 Fix converting template types to handle nested templates (babel/babel-eslint#610)
Fixes https://github.com/babel/babel-eslint/issues/603 (and the fixture from https://github.com/babel/babel-eslint/issues/609 works).

Reworks our code that converts the format of Babylon template tokens to be a bit more robust, especially with things like nested templates with arrows.

(Adapted the logic from https://github.com/eslint/espree/blob/master/lib/token-translator.js)
2018-06-18 16:46:31 -05:00
Rubén Norte
3477626973 Add support for the optional chaining operator (babel/babel-eslint#630) 2018-06-15 15:31:43 +01:00
jmurretxactly
735abb06b4 don't require unpad per test fixture, fixes babel/babel-eslint#572 (babel/babel-eslint#618) 2018-05-08 05:52:59 -06:00
Daniel Tschinder
c27c2b6e68 Update dependencies 2018-02-20 11:54:09 +01:00
Henry Zhu
23d12acd15 fix export change (babel/babel-eslint#571) 2018-01-08 19:15:22 -05:00
Kai Cataldo
97c9442511 Make 2018 the default ecmaVersion for rules relying on parserOptions (babel/babel-eslint#556) 2018-01-08 17:45:24 -05:00
jony89
660180b932 update babel packages (babel/babel-eslint#565)
* update babel packages

There is some critical bug fixes in version babylon#7.0.0-beta.33 regard `async` - `await` syntax which is needed pretty immediately :)

* remove test 42 (test for import type *)

`import type *` is invalid, since the namespace can't be a type
2018-01-09 00:40:11 +02:00
Toru Nagashima
3cb154df82 Fix: ignore eval (fixes babel/babel-eslint#560) (babel/babel-eslint#561) 2017-12-26 10:49:36 +09:00
Teddy Katz
e988a88af0 Fix: Prevent parseForESLint() behavior from changing after parse() is called (fixes babel/babel-eslint#558)(babel/babel-eslint#559)
* Prevent parseForESLint() behavior from changing after parse() is called

(fixes https://github.com/babel/babel-eslint/issues/558, fixes https://github.com/eslint/eslint/issues/9767)

* Avoid using the enhanced referencer after monkeypatching

* Chore: add test for babel/babel-eslint#558

* Pass correct scope analyzer options

* fix escope patch and improve tests

* remove process.exit(1)
2017-12-25 01:52:36 -05:00
Jordan Gensler
04cf4246b8 Adding optionalCatchBinding to plugins. (babel/babel-eslint#521) 2017-09-26 13:17:44 -07:00
Henry Zhu
522140b43f update (babel/babel-eslint#504) 2017-07-13 12:58:45 -04:00
Henry Zhu
6aec93c468 Merge pull request babel/babel-eslint#493 from danez/regression-test
Test for babylon regression
2017-06-18 18:30:59 -04:00
Brian Ng
94e69f399b Add Prettier (babel/babel-eslint#491) 2017-06-17 14:14:42 -05:00
Reyad Attiyat
4e4aa05639 Update to Babylon 7 (fixes babel/babel-eslint#481) (babel/babel-eslint#482)
* Update to Babylon 7 (fixes babel/babel-eslint#481)

* Pin dependencies to alpha version

* fix deprecation, add other plugins

* oops

* Update index.js

* Add tests for private class properties with rules no-undef no-unused-vars
2017-06-06 20:37:57 -05:00
Andres Suarez
6feaee84e0 Fix flow type spread handling (babel/babel-eslint#465) 2017-04-21 11:48:52 -04:00
Andres Suarez
d78b0debd7 Use dedent for unpadding (babel/babel-eslint#456) 2017-03-25 19:32:05 -04:00
Andres Suarez
2ca65d5451 Add type parameter scope tests (babel/babel-eslint#454) 2017-03-23 15:46:48 -04:00
Andres Suarez
1c5400a670 Fix type param and interface declaration scoping (babel/babel-eslint#449) 2017-03-23 12:49:19 -04:00
Andres Suarez
371488c102 Format non-regression errors for legibility (babel/babel-eslint#451) 2017-03-22 22:34:13 -04:00
Alex Rattray
65413344bd [flow] Process polymorphic type bounds on functions (babel/babel-eslint#444) 2017-03-20 14:46:07 -07:00
Henry Zhu
4f4d229e0a chore(package): update eslint-config-babel to version 6.0.0 (babel/babel-eslint#433)
* chore(package): update eslint-config-babel to version 6.0.0

Closes babel/babel-eslint#432

https://greenkeeper.io/

* Fix linting
2017-01-15 06:59:51 -05:00
Nazim Hajidin
d76cfe05b1 Update to use Node 4 features (babel/babel-eslint#425)
* Change for loops to forEach

* Change more for loops

* Arrow functions

* Use object shorthand

* Put this on one line

* Change back to using for loops
2017-01-14 17:15:54 -05:00
Henry Zhu
838bada36d append code frame on parse error (babel/babel-eslint#418) 2016-11-17 17:48:58 -05:00
Jordan Gensler
1d52247080 [import()] Adding support to lint dynamic imports (babel/babel-eslint#413)
* [import()] Adding support to lint dynamic imports

* [import()] Adding regression test to import
2016-10-17 14:40:06 -04:00
Steven Job
1f04cab99f Now using template strings (babel/babel-eslint#410)
* Use template strings in non-regression tests

* Refactor non-regression tests to fix test failures

Moved backtick to fix test 'getter/setter babel/babel-eslint#218' as indent matters
Fixed line numbers for some tests

* Use template strings in babel-eslint tests

* Fix tests for babel-eslint

Avoids error that shows when using template strings for tests:
	line 253 line comments
	line 260 block comments
	line 306 jsdoc

Error: At loc.start.column: are different (6 !== 0)

* Other small template literal changes

* Add unpad to correctly indent template literals
2016-10-17 19:27:20 +01:00
Daniel Tschinder
31f48f0651 Update test for eslint 3.8 (babel/babel-eslint#412)
* Update test for eslint 3.8

also ignore yarn lock

* Run lint only on latest version
2016-10-15 11:04:55 +02:00
Henry Zhu
3c414db312 remove eslint 2 logic (babel/babel-eslint#361)
* remove old code

* remove async/await logic before eslint supported it

* not needed
2016-09-27 12:32:10 -04:00
Henry Zhu
3d4e8cfea3 update test line number [skip ci] 2016-09-27 08:42:41 -04:00
Henry Zhu
2b812b087c Merge pull request babel/babel-eslint#354 from babel/eslint-config-babel
Use eslint-config-babel
2016-08-03 09:34:51 -04:00
Daniel Tschinder
0534eb7644 Fix tests for eslint 3.2 (babel/babel-eslint#352) 2016-07-30 19:44:42 +02:00
Daniel Tschinder
0cb35ab04e Fix tests for eslint 3.0
Seems that eslint got a lot smarter and reports vars that are used, but are useless as unused
These examples are also failing with espree
2016-07-10 23:47:44 +02:00
Toru Nagashima
1766a21145 Fix: improve handling of class properties (fixes babel/babel-eslint#337) (babel/babel-eslint#338)
I added ClassProperty method into Referencer of escope. This method will
address class properties and those type anotations.
2016-07-10 00:40:08 +09:00
Daniel Tschinder
19baee2242 Add testcase for space-comment and shebang babel/babel-eslint#163
This works as of babylon 6.8.2
2016-06-26 22:50:50 +02:00
Daniel Tschinder
ce54b07e2d Testcase for newline-before-return shouldn't fail with comments. (babel/babel-eslint#300) 2016-06-26 21:52:39 +02:00
rhettlivingston
ab9afd33d1 Add allowImportExportEverywhere parserOption (babel/babel-eslint#327) (babel/babel-eslint#329)
* Add allowImportExportEverywhere parserOption (babel/babel-eslint#327)

* Added "allowImportExportEverywhere option (babel/babel-eslint#327)" test.
2016-06-22 16:36:47 -04:00