From 5856451499f050287906e307323c949ec0c5e3f9 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Thu, 20 Jun 2024 08:15:07 -0400 Subject: [PATCH] feat: add support for es2020 syntax in eslint --- .eslintrc.js | 1 + test.jsx | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 3a11915c..14967891 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -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. diff --git a/test.jsx b/test.jsx index 44d48fa3..6dd068a9 100644 --- a/test.jsx +++ b/test.jsx @@ -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');