mirror of
https://github.com/joelwmale/webhook-action.git
synced 2026-08-31 00:19:45 +08:00
feat: updates & github event support
This commit is contained in:
+5
-5
@@ -140,8 +140,8 @@ const options = {
|
||||
// create a top-level tokens array containing all tokens
|
||||
tokens: false,
|
||||
|
||||
// Set to 3, 5 (the default), 6, 7, 8, 9, 10, 11, 12, 13 or 14 to specify the version of ECMAScript syntax you want to use.
|
||||
// You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), 2021 (same as 12), 2022 (same as 13) or 2023 (same as 14) to use the year-based naming.
|
||||
// Set to 3, 5 (the default), 6, 7, 8, 9, 10, 11, 12, 13, 14 or 15 to specify the version of ECMAScript syntax you want to use.
|
||||
// You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), 2021 (same as 12), 2022 (same as 13), 2023 (same as 14) or 2024 (same as 15) to use the year-based naming.
|
||||
// You can also set "latest" to use the most recently supported version.
|
||||
ecmaVersion: 3,
|
||||
|
||||
@@ -231,11 +231,11 @@ We are building on top of Acorn, however, so that we can contribute back and hel
|
||||
|
||||
### What ECMAScript features do you support?
|
||||
|
||||
Espree supports all ECMAScript 2022 features and partially supports ECMAScript 2023 features.
|
||||
Espree supports all ECMAScript 2023 features and partially supports ECMAScript 2024 features.
|
||||
|
||||
Because ECMAScript 2023 is still under development, we are implementing features as they are finalized. Currently, Espree supports:
|
||||
Because ECMAScript 2024 is still under development, we are implementing features as they are finalized. Currently, Espree supports:
|
||||
|
||||
* [Hashbang grammar](https://github.com/tc39/proposal-hashbang)
|
||||
* [RegExp v flag with set notation + properties of strings](https://github.com/tc39/proposal-regexp-v-flag)
|
||||
|
||||
See [finished-proposals.md](https://github.com/tc39/proposals/blob/master/finished-proposals.md) to know what features are finalized.
|
||||
|
||||
|
||||
+10
-6
@@ -1,3 +1,5 @@
|
||||
/* eslint-disable jsdoc/no-multi-asterisks -- needed to preserve original formatting of licences */
|
||||
|
||||
/**
|
||||
* @fileoverview Main Espree file that converts Acorn into Esprima output.
|
||||
*
|
||||
@@ -54,7 +56,8 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/* eslint no-undefined:0, no-use-before-define: 0 */
|
||||
|
||||
/* eslint-enable jsdoc/no-multi-asterisks -- needed to preserve original formatting of licences */
|
||||
|
||||
import * as acorn from "acorn";
|
||||
import jsx from "acorn-jsx";
|
||||
@@ -111,7 +114,7 @@ export function tokenize(code, options) {
|
||||
|
||||
// Ensure to collect tokens.
|
||||
if (!options || options.tokens !== true) {
|
||||
options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign
|
||||
options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign -- stylistic choice
|
||||
}
|
||||
|
||||
return new Parser(options, code).tokenize();
|
||||
@@ -139,6 +142,7 @@ export function parse(code, options) {
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
export const version = espreeVersion;
|
||||
export const name = "espree";
|
||||
|
||||
/* istanbul ignore next */
|
||||
export const VisitorKeys = (function() {
|
||||
@@ -148,16 +152,16 @@ export const VisitorKeys = (function() {
|
||||
// Derive node types from VisitorKeys
|
||||
/* istanbul ignore next */
|
||||
export const Syntax = (function() {
|
||||
let name,
|
||||
let key,
|
||||
types = {};
|
||||
|
||||
if (typeof Object.create === "function") {
|
||||
types = Object.create(null);
|
||||
}
|
||||
|
||||
for (name in VisitorKeys) {
|
||||
if (Object.hasOwnProperty.call(VisitorKeys, name)) {
|
||||
types[name] = name;
|
||||
for (key in VisitorKeys) {
|
||||
if (Object.hasOwnProperty.call(VisitorKeys, key)) {
|
||||
types[key] = key;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-4
@@ -1,4 +1,5 @@
|
||||
/* eslint-disable no-param-reassign*/
|
||||
/* eslint no-param-reassign: 0 -- stylistic choice */
|
||||
|
||||
import TokenTranslator from "./token-translator.js";
|
||||
import { normalizeOptions } from "./options.js";
|
||||
|
||||
@@ -109,7 +110,7 @@ export default () => Parser => {
|
||||
allowReturnOutsideFunction: options.allowReturnOutsideFunction,
|
||||
|
||||
// Collect tokens
|
||||
onToken: token => {
|
||||
onToken(token) {
|
||||
if (tokenTranslator) {
|
||||
|
||||
// Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state.
|
||||
@@ -121,7 +122,7 @@ export default () => Parser => {
|
||||
},
|
||||
|
||||
// Collect comments
|
||||
onComment: (block, text, start, end, startLoc, endLoc) => {
|
||||
onComment(block, text, start, end, startLoc, endLoc) {
|
||||
if (state.comments) {
|
||||
const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code);
|
||||
|
||||
@@ -314,7 +315,7 @@ export default () => Parser => {
|
||||
* on extra so that when tokens are converted, the next token will be switched
|
||||
* to JSXText via onToken.
|
||||
*/
|
||||
jsx_readString(quote) { // eslint-disable-line camelcase
|
||||
jsx_readString(quote) { // eslint-disable-line camelcase -- required by API
|
||||
const result = super.jsx_readString(quote);
|
||||
|
||||
if (this.type === tokTypes.string) {
|
||||
|
||||
+2
-1
@@ -18,7 +18,8 @@ const SUPPORTED_VERSIONS = [
|
||||
11, // 2020
|
||||
12, // 2021
|
||||
13, // 2022
|
||||
14 // 2023
|
||||
14, // 2023
|
||||
15 // 2024
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
+5
-7
@@ -2,7 +2,6 @@
|
||||
* @fileoverview Translates tokens between Acorn format and Esprima format.
|
||||
* @author Nicholas C. Zakas
|
||||
*/
|
||||
/* eslint no-underscore-dangle: 0 */
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Requirements
|
||||
@@ -180,8 +179,7 @@ TokenTranslator.prototype = {
|
||||
*/
|
||||
onToken(token, extra) {
|
||||
|
||||
const that = this,
|
||||
tt = this._acornTokTypes,
|
||||
const tt = this._acornTokTypes,
|
||||
tokens = extra.tokens,
|
||||
templateTokens = this._tokens;
|
||||
|
||||
@@ -191,10 +189,10 @@ TokenTranslator.prototype = {
|
||||
* @returns {void}
|
||||
* @private
|
||||
*/
|
||||
function translateTemplateTokens() {
|
||||
tokens.push(convertTemplatePart(that._tokens, that._code));
|
||||
that._tokens = [];
|
||||
}
|
||||
const translateTemplateTokens = () => {
|
||||
tokens.push(convertTemplatePart(this._tokens, this._code));
|
||||
this._tokens = [];
|
||||
};
|
||||
|
||||
if (token.type === tt.eof) {
|
||||
|
||||
|
||||
-1
@@ -1 +0,0 @@
|
||||
../../../acorn/bin/acorn
|
||||
+15
-9
@@ -16,7 +16,7 @@
|
||||
],
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"version": "9.4.1",
|
||||
"version": "9.6.1",
|
||||
"files": [
|
||||
"lib",
|
||||
"dist/espree.cjs",
|
||||
@@ -32,9 +32,9 @@
|
||||
"funding": "https://opencollective.com/eslint",
|
||||
"license": "BSD-2-Clause",
|
||||
"dependencies": {
|
||||
"acorn": "^8.8.0",
|
||||
"acorn": "^8.9.0",
|
||||
"acorn-jsx": "^5.3.2",
|
||||
"eslint-visitor-keys": "^3.3.0"
|
||||
"eslint-visitor-keys": "^3.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-commonjs": "^17.1.0",
|
||||
@@ -42,16 +42,18 @@
|
||||
"@rollup/plugin-node-resolve": "^11.2.0",
|
||||
"c8": "^7.11.0",
|
||||
"chai": "^4.3.6",
|
||||
"eslint": "^8.13.0",
|
||||
"eslint-config-eslint": "^7.0.0",
|
||||
"eslint-plugin-jsdoc": "^39.2.4",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint": "^8.44.0",
|
||||
"eslint-config-eslint": "^8.0.0",
|
||||
"eslint-plugin-n": "^16.0.0",
|
||||
"eslint-release": "^3.2.0",
|
||||
"esprima-fb": "^8001.2001.0-dev-harmony-fb",
|
||||
"globals": "^13.20.0",
|
||||
"lint-staged": "^13.2.0",
|
||||
"mocha": "^9.2.2",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"rollup": "^2.41.2",
|
||||
"shelljs": "^0.3.0"
|
||||
"shelljs": "^0.3.0",
|
||||
"yorkie": "^2.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"ast",
|
||||
@@ -61,14 +63,18 @@
|
||||
"syntax",
|
||||
"acorn"
|
||||
],
|
||||
"gitHooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
},
|
||||
"scripts": {
|
||||
"unit": "npm-run-all -s unit:*",
|
||||
"unit:esm": "c8 mocha --color --reporter progress --timeout 30000 'tests/lib/**/*.js'",
|
||||
"unit:cjs": "mocha --color --reporter progress --timeout 30000 tests/lib/commonjs.cjs",
|
||||
"test": "npm-run-all -p unit lint",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint . --report-unused-disable-directives",
|
||||
"fixlint": "npm run lint -- --fix",
|
||||
"build": "rollup -c rollup.config.js",
|
||||
"build:debug": "npm run build -- -m",
|
||||
"update-version": "node tools/update-version.js",
|
||||
"pretest": "npm run build",
|
||||
"prepublishOnly": "npm run update-version && npm run build",
|
||||
|
||||
Reference in New Issue
Block a user