Skip to content
Permalink
Branch: master
Commits on May 11, 2019
  1. Chore: make fuzzer produce minimal reproducible examples of bugs (#11700

    not-an-aardvark committed May 11, 2019
    )
    
    When the fuzzer for rules discovers a bug, it outputs source code that reproduces the bug. However, since the source code is autogenerated, it is often extremely complex and contains lots of parts that are irrelevant to the cause of the bug, making it tedious to figure out what the bug actually is.
    
    This commit adds a "code sample minimizer" to the fuzzer that tries to remove irrelevant parts of the AST so that the resulting code sample is as small as possible while still reproducing the issue found by the fuzzer.
    
    As a demonstration, the minimizer would have reduced the very large code sample from the fuzzing error in [this CI build](https://travis-ci.org/eslint/eslint/jobs/519526960) down to the following simplified code:
    
    ```js
    ($2 = $3) ?
    $4 : ($5)
    ```
  2. New: add --resolve-plugins-relative-to flag (#11696)

    not-an-aardvark committed May 11, 2019
    With the [2018-simplified-package-loading RFC](https://github.com/eslint/rfcs/blob/8bc0b80e0b3e54d10991a4774c41f7375dfcbbfe/designs/2018-simplified-package-loading/README.md) implemented, ESLint always resolves plugins relative to the current working directory. The CWD works well for the most common use case, but is inconvenient for certain integrations. This commit proposes adding a CLI flag to specify an alternative place where plugins should be resolved from.
    
    (Implements eslint/rfcs#18)
Commits on May 10, 2019
  1. Chore: fix CLIEngine tests when os.tmpdir is a symlink (#11697)

    not-an-aardvark committed May 10, 2019
    Previously, this was causing test failures on macOS because some parts of the CLIEngine tests call realpath() and others didn't.
Commits on Apr 26, 2019
  1. Docs: update status of breaking changes in migration guide (#11652)

    not-an-aardvark committed Apr 26, 2019
    This updates the migration guide to remove the "unimplemented" notice for features that have now been implemented, and it brings the `eslint:recommended` section up to date with the latest decision.
  2. Docs: add missing items to migration guide (#11628)

    not-an-aardvark committed Apr 26, 2019
Commits on Apr 13, 2019
  1. Docs: add v6.0.0 migration guide (#11515)

    not-an-aardvark committed Apr 13, 2019
Commits on Apr 9, 2019
  1. Breaking: disallow invalid rule defaults in RuleTester (fixes #11473) (

    not-an-aardvark committed Apr 9, 2019
    …#11599)
    
    * Breaking: disallow invalid rule defaults in RuleTester (fixes #11473)
    
    * Update: Remove remaining invalid defaults from core rules
Commits on Apr 4, 2019
  1. Breaking: simplify config/plugin/parser resolution (fixes #10125) (#1…

    not-an-aardvark committed Apr 4, 2019
    …1388)
    
    This change updates ESLint to load plugins relative to the user's project root, and other packages relative to where they're specified in a config. This simplifies ESLint's package-loading, resulting in fewer confusing errors about missing packages. It also fixes an existing design bug where ESLint would sometimes fail to load plugins in valid setups.
    
    Implements eslint/rfcs#7.
Commits on Apr 2, 2019
Commits on Apr 1, 2019
  1. Breaking: interpret rule options as unicode regexes (fixes #11423) (#…

    not-an-aardvark committed Apr 1, 2019
    …11516)
    
    This updates the core rules that interpret user-provided options as regular expressions. Those rules now interpret the options as unicode regexes, which avoids some cases of unexpected behavior with astral symbols.
Commits on Mar 19, 2019
  1. Docs: fix duplicate punctuation in CLI docs (#11528)

    not-an-aardvark committed Mar 19, 2019
Commits on Mar 18, 2019
  1. Fix: avoid moving comments in implicit-arrow-linebreak (fixes #11521) (

    not-an-aardvark committed Mar 18, 2019
    …#11522)
    
    Currently, the implicit-arrow-linebreak rule contains a lot of logic to determine how comments should be adjusted in code when an autofix is needed. The goal is to be able to autofix cases where there is a comment between an arrow token and the start of an arrow function body. Most other core rules simply decide not to fix cases when there is a comment interfering with the fix.
    
    This logic accounts for a large fraction of the code in the rule, and seems to require a lot of different code for many individual cases. Unfortunately, bugs keep being reported identifying problems in the rule (e.g. #11268, #11521) and it's not clear that the fixes are moving us closer to making the rule correct in general, given that there are always more cases than we can explicitly account for.
    
    To address those problems, this commit updates the implicit-arrow-linebreak rule to just skip autofixing when comments interfere, rather than trying to do an autofix anyway and find an alternate location for the comments. I'm reluctant to make this change given that a lot of time has been invested in the autofixing logic, but I think this is ultimately a better solution than trying to guess where the user wants their comments to go, and crashing/producing incorrect code if we get it wrong.
Commits on Mar 15, 2019
  1. Upgrade: eslint-scope@4.0.3 (#11513)

    not-an-aardvark committed Mar 15, 2019
  2. Build: compile deps to ES5 when generating browser file (fixes #11504) (

    not-an-aardvark authored and aladdin-add committed Mar 15, 2019
    #11505)
    
    * Build: compile deps to ES5 when generating browser file (fixes #11504)
    
    * Don't compile lodash
Commits on Mar 6, 2019
  1. Chore: use "file:" dependencies for internal rules/config (#11465)

    not-an-aardvark committed Mar 6, 2019
    This updates the setup of our internal linting rules to use "file:" dependencies within the project, rather than the `eslint-plugin-rulesdir` package. If this works well, it could be a good alternative for packages like `eslint-plugin-rulesdir` and `eslint-plugin-self`.
Commits on Mar 5, 2019
  1. Fix: avoid creating invalid regex in no-warning-comments (fixes #11471)…

    not-an-aardvark committed Mar 5, 2019
    … (#11472)
    
    5018378 changed the codebase to use unicode regexes almost everywhere, with the exception of places where regexes are constructed from user input. However, two issues occurred to cause a bug:
    
    * Due to an oversight, the regular expressions constructed in the `no-warning-comments` rule were changed to be unicode regexes even though those regexes were constructed from user input.
    * The `no-warning-comments` rule dynamically creates regexes with unnecessary escape characters, and unnecessary escape characters are invalid in unicode regexes.
    
    This commit fixes the first issue. The second issue isn't a problem on its own, but it will need to be fixed in order to implement #11423.
Commits on Mar 2, 2019
  1. Upgrade: eslint-scope@4.0.2 (#11461)

    not-an-aardvark authored and platinumazure committed Mar 2, 2019
Commits on Mar 1, 2019
  1. Revert "Chore: remove devDependency common-tags (#11455)" (#11460)

    not-an-aardvark committed Mar 1, 2019
    This reverts commit aaba636.
Commits on Feb 28, 2019
  1. Fix: no-extra-parens crash when code is "((let))" (#11444)

    not-an-aardvark committed Feb 28, 2019
    This issue was detected by the fuzzer in https://travis-ci.org/eslint/eslint/jobs/498031437.
Commits on Feb 25, 2019
  1. Update: remove invalid defaults from core rules (fixes #11415) (#11427)

    not-an-aardvark committed Feb 25, 2019
    Ajv ignores the `default` property in JSON schemas when it appears inside `oneOf`, `anyOf`, or `not`. This commit removes ignored `default` properties and fixes a few bugs in rules that were incorrectly assuming the `default` properties would get processed.
Commits on Feb 22, 2019
  1. Build: fix linting errors on master (#11428)

    not-an-aardvark committed Feb 22, 2019
    5018378 broke the build on master because it wasn't rebased onto f6ba633 when the tests were run.
Commits on Feb 21, 2019
  1. Chore: lint all files in the repo at the same time (#11425)

    not-an-aardvark committed Feb 21, 2019
    Previously, `npm run lint` would invoke ESLint three separate times for different sets of files. There doesn't seem to have been a clear reason for this (it was added in 9b8c639 about 5 years ago), and some files in the repo were inadvertently being missed. This commit updates the lint task to simply invoke ESLint once on the entire repository. It also fixes some linting errors in files that were previously being skipped.
Commits on Feb 19, 2019
  1. Chore: run fuzzer along with unit tests (#11404)

    not-an-aardvark committed Feb 19, 2019
    This commit turns on our existing fuzzer tool to run a small number of iterations when the user runs `npm test`. This is intended to prevent bugs like #11402 where a rule completely breaks when it encounters a particular syntax, but the author doesn't think to test for that kind of syntax.
    
    When there are no fuzzing errors, this adds about 5 seconds to the `npm test` time. (When there are fuzzing errors, it takes more time because the fuzzer does extra work to try to find the minimal config that reproduces the bug.)
    
    The fuzzer actually has two modes: "crash" (where it only tries to detect rule crashes), and "autofix" (where it additionally tries to detect cases where a rule's autofixer creates a syntax error). For now, this PR just enables "crash" mode, because I remember "autofix" mode had some false positives (although they might have been fixed due to parser upgrades).
Commits on Feb 7, 2019
  1. Docs: clarify motivation for no-prototype-builtins (#11356)

    not-an-aardvark committed Feb 7, 2019
    The first section in the no-prototype-builtins docs mentions objects created with Object.create(null), but does not mention builtin shadowing (which is arguably a much more compelling reason to use the rule). This commit updates the description to clarify the risks of using prototype builtins on user input.
Commits on Feb 6, 2019
  1. Update: no-shadow-restricted-names lets unassigned vars shadow undefi…

    not-an-aardvark committed Feb 6, 2019
    …ned (#11341)
    
    This updates the `no-shadow-restricted-names` to allow a variable to shadow `undefined` if that variable is never assigned a value (i.e. if the variable always actually has a value of `undefined`. The declaration `var undefined;` is occasionally used in pre-ES5 environments where the `undefined` global is mutable, to ensure that the identifier `undefined` can reliably be used even if someone else tampered with the global. In general, a `var undefined;` declaration doesn't really violate the spirit of the rule, because it doesn't change the value of the identifier `undefined`.
    
    The goal of this change is to eliminate a false positive for codebases that support pre-ES5 environments, so that the rule can be added to `eslint:recommended` in the future.
Commits on Feb 1, 2019
  1. New: Allow globals to be disabled/configured with strings (fixes #9940)…

    not-an-aardvark authored and btmills committed Feb 1, 2019
    … (#11338)
    
    * New: Allow globals to be disabled/configured with strings (fixes #9940)
    
    As described in #9940, this allows globals in a config file to be specified with the strings `readable` and `writeable` rather than `false` and `true`, respectively. It also adds a new value, `off`, which turns off a previously-enabled global.
    
    * Update lib/linter.js
    
    Co-Authored-By: not-an-aardvark <teddy.katz@gmail.com>
    
    * Update docs/user-guide/configuring.md
    
    Co-Authored-By: not-an-aardvark <teddy.katz@gmail.com>
    
    * Add test for "writable"
    
    * Remove unnecessary map/destructuring
    
    * Adjust confusing variable name
    
    * Move note about legacy booleans down
Commits on Jan 30, 2019
  1. Chore: avoid hard-coding the list of core rules in eslint:recommended (

    not-an-aardvark committed Jan 30, 2019
    …#11336)
    
    This updates the `eslint:recommended` config to be generated dynamically rather than being hard-coded, to reduce the number of places that need to be kept up to date when core rules are added.
  2. Chore: remove undocumented `Linter#rules` property (refs #9161) (#11335)

    not-an-aardvark committed Jan 30, 2019
    This removes the undocumented `rules` property from `Linter` instances, as part of the effort to remove undocumented API surface from `Linter` (also see #9161). Config processing now exclusively uses `Linter`'s public API when defining rules. As a side-effect, the rule map utility in `lib/rules.js` no longer needs to access the filesystem, so we can remove the odd code generation logic from the browserify build.
  3. Chore: remove dead code for loading rules (#11334)

    not-an-aardvark committed Jan 30, 2019
    The `lib/rules.js` file contains a code path that was previously needed to load core rules, but is no longer used as of aa56247.
Commits on Dec 12, 2018
Commits on Dec 8, 2018
  1. Docs: add missing deprecation notices for jsdoc rules (#11171)

    not-an-aardvark committed Dec 8, 2018
    The rules were deprecated in the last release, but the deprecation notices in the documentation are not autogenerated.
Older
You can’t perform that action at this time.