Skip to content

Commit

Permalink
feat: add support for es2020 syntax in eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstankiewicz committed Jun 20, 2024
1 parent 89d0227 commit 5856451
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = {
es6: true,
browser: true,
jest: true,
es2020: true,
},
extends: [
// The airbnb config includes configuraton for import, react, and jsx-a11y.
Expand Down
10 changes: 10 additions & 0 deletions test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,13 @@ class MethodDoesNotUseThis {
// disable no-plusplus
let i = 0;
i++;

const testFn = () => {
const myVar = true;
const obj = { a: myVar };
const anotherObj = { ...obj, b: true };
return anotherObj;
};

// globalThis is allowed
const value = globalThis.localStorage.getItem('foo');

0 comments on commit 5856451

Please sign in to comment.