Last active
April 14, 2025 10:15
-
-
Save bantic/da604b51a8d412cf76a9e32064872fb9 to your computer and use it in GitHub Desktop.
Revisions
-
bantic revised this gist
Apr 14, 2025 . No changes.There are no files selected for viewing
-
bantic created this gist
Apr 14, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ // eslint-disable-next-line no-undef module.exports = { // If the line below is commented out, the eslint default parser is used, // and the parserOptions.ecmaVersion becomes meaningful; it must be incremented // to a value greater than 2024 to parse the entire test.js file. // When the babel eslint-parser is used, the ecmaVersion option is ignored. parser: "@babel/eslint-parser", parserOptions: { ecmaVersion: 2017, requireConfigFile: false, babelOptions: { plugins: [["@babel/plugin-proposal-decorators", { version: "2023-11" }]], }, }, extends: ["eslint:recommended"], }; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ { "name": "test-eslint", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "@babel/eslint-parser": "^7.27.0", "@babel/plugin-proposal-decorators": "^7.25.9", "eslint": "^8.0.0" } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ let tests = {}; tests.objspread = { ...{} }; // es2018 tests.bign_syntaxt = 10n; // es2020 let undef; tests.nullish = undef ?? "foo"; // es2020 tests.logical_assign ??= true; // es2021 tests.regexp_indices = /foo/dg; // es2022 tests.regexp_unicode = /foo/v; // es2024 // class annotation below requires: // parser: @babel/eslint-parser // with babelOptions: // plugins: [["@babel/plugin-proposal-decorators", { version: "2023-11" }]], // @annotation // // eslint-disable-next-line no-unused-vars // class MyClass {} // function annotation(target) { // target.annotated = true; // }