From cd21e0131810c3f7761747bd5f09b39641f2e4d4 Mon Sep 17 00:00:00 2001 From: AndrewJGaut Date: Mon, 3 Oct 2022 10:19:16 -0700 Subject: [PATCH 01/20] Remove unused column (is_superuser) from the User table. --- ...ve_is_superuser_from_user__22b6c41cd29c.py | 26 +++++++++++++++++++ codalab/model/bundle_model.py | 1 - codalab/model/tables.py | 1 - codalab/objects/user.py | 2 -- tests/unit/objects/user_test.py | 1 - 5 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 alembic/versions/2022100403_remove_is_superuser_from_user__22b6c41cd29c.py diff --git a/alembic/versions/2022100403_remove_is_superuser_from_user__22b6c41cd29c.py b/alembic/versions/2022100403_remove_is_superuser_from_user__22b6c41cd29c.py new file mode 100644 index 000000000..88f06e205 --- /dev/null +++ b/alembic/versions/2022100403_remove_is_superuser_from_user__22b6c41cd29c.py @@ -0,0 +1,26 @@ +"""Remove is_superuser from User table + +Revision ID: 22b6c41cd29c +Revises: f720aaefd0b2 +Create Date: 2022-10-04 03:42:55.838245 + +""" + +# revision identifiers, used by Alembic. +revision = '22b6c41cd29c' +down_revision = 'f720aaefd0b2' + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import mysql + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('user', 'is_superuser') + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('user', sa.Column('is_superuser', mysql.TINYINT(display_width=1), autoincrement=False, nullable=False)) + # ### end Alembic commands ### diff --git a/codalab/model/bundle_model.py b/codalab/model/bundle_model.py index 49d15b788..b50023339 100644 --- a/codalab/model/bundle_model.py +++ b/codalab/model/bundle_model.py @@ -2443,7 +2443,6 @@ def add_user( "date_joined": now, "has_access": has_access, "is_verified": is_verified, - "is_superuser": False, "password": User.encode_password(password, crypt_util.get_random_string()), "time_quota": self.default_user_info['time_quota'], "parallel_run_quota": self.default_user_info['parallel_run_quota'], diff --git a/codalab/model/tables.py b/codalab/model/tables.py index a4ce5f40a..fa328fa76 100644 --- a/codalab/model/tables.py +++ b/codalab/model/tables.py @@ -350,7 +350,6 @@ Column('date_joined', DateTime, nullable=False), Column('has_access', Boolean, default=False, nullable=True), Column('is_verified', Boolean, nullable=False, default=False), - Column('is_superuser', Boolean, nullable=False, default=False), Column('password', String(128), nullable=False), # Additional information Column('affiliation', String(255, convert_unicode=True), nullable=True), diff --git a/codalab/objects/user.py b/codalab/objects/user.py index d1fc109ce..1be09181d 100644 --- a/codalab/objects/user.py +++ b/codalab/objects/user.py @@ -23,7 +23,6 @@ class User(ORMObject): 'date_joined', 'has_access', 'is_verified', - 'is_superuser', 'password', 'time_quota', 'parallel_run_quota', @@ -140,7 +139,6 @@ def __str__(self): "date_joined": None, "has_access": False, "is_verified": True, - "is_superuser": False, "password": None, "time_quota": 0, "parallel_run_quota": 0, diff --git a/tests/unit/objects/user_test.py b/tests/unit/objects/user_test.py index 274c95e04..e6668f9d3 100644 --- a/tests/unit/objects/user_test.py +++ b/tests/unit/objects/user_test.py @@ -17,7 +17,6 @@ "date_joined": datetime.datetime.now(), "has_access": False, "is_verified": True, - "is_superuser": False, "password": "", "time_quota": 0, "parallel_run_quota": 0, From a1e098095f201a7640cd5a609d2a4d63c25f3c3f Mon Sep 17 00:00:00 2001 From: AndrewJGaut Date: Tue, 4 Oct 2022 22:19:39 -0700 Subject: [PATCH 02/20] Speed up cl search by converting subqueries to inner joins --- codalab/model/bundle_model.py | 171 ++++++++++++++++------------------ 1 file changed, 81 insertions(+), 90 deletions(-) diff --git a/codalab/model/bundle_model.py b/codalab/model/bundle_model.py index 49d15b788..70397005b 100644 --- a/codalab/model/bundle_model.py +++ b/codalab/model/bundle_model.py @@ -422,6 +422,10 @@ def make_condition(key, field, value): shortcuts = {'type': 'bundle_type', 'size': 'data_size', 'worksheet': 'host_worksheet'} + join_tables = [] + join_conditions = [] + where_clauses = [] + for keyword in keywords: keyword = keyword.replace('.*', '%') # Sugar @@ -437,13 +441,17 @@ def make_condition(key, field, value): continue elif keyword == '.floating': # Get bundles that have host worksheets, and then take the complement. + """ + NOTE: for now, I'll leave this since it's a negative. + Will have to think about how to update this. + """ with_hosts = alias( select([cl_bundle.c.uuid]).where( cl_bundle.c.uuid == cl_worksheet_item.c.bundle_uuid ) ) clause = not_(cl_bundle.c.uuid.in_(with_hosts)) - clauses.append(clause) + where_clauses.append(clause) continue m = SEARCH_KEYWORD_REGEX.match(keyword) # key=value @@ -455,7 +463,7 @@ def make_condition(key, field, value): else: key, value = 'uuid_name', keyword - clause = None + where_clause = None # Special functions if key == '.offset': offset = int(value) @@ -467,69 +475,58 @@ def make_condition(key, field, value): elif key in ('bundle_type', 'id', 'uuid', 'data_hash', 'state', 'command', 'owner_id'): clause = make_condition(key, getattr(cl_bundle.c, key), value) elif key == '.shared': # shared with any group I am in with read permission - clause = cl_bundle.c.uuid.in_( - select([cl_group_bundle_permission.c.object_uuid]).where( - and_( - cl_group_bundle_permission.c.group_uuid.in_( - alias( - select([cl_user_group.c.group_uuid]).where( - cl_user_group.c.user_id == user_id - ) - ) - ), - cl_group_bundle_permission.c.permission >= GROUP_OBJECT_PERMISSION_READ, - ) - ) + join_tables.append(cl_group_bundle_permission) + join_conditions.append(cl_bundle.c.uuid == cl_group_bundle_permission.c.object_uuid) + join_tables.append(cl_user_group) + join_conditions.append(cl_group_bundle_permission.c.group_uuid == cl_user_group.c.group_uuid) + + where_clause = and_( + cl_user_group.c.user_id == user_id, + cl_group_bundle_permission.c.permission >= GROUP_OBJECT_PERMISSION_READ ) elif key == 'group': # shared with group with read permission + join_tables.append(cl_group_bundle_permission) + join_conditions.append(cl_bundle.c.uuid == cl_group_bundle_permission.c.object_uuid) group_uuid = get_group_info(value, False)['uuid'] - clause = cl_bundle.c.uuid.in_( - select([cl_group_bundle_permission.c.object_uuid]).where( - and_( + where_clause = and_( cl_group_bundle_permission.c.group_uuid == group_uuid, cl_group_bundle_permission.c.permission >= GROUP_OBJECT_PERMISSION_READ, - ) - ) ) # Special fields elif key == 'dependency': # Match uuid of dependency condition = make_condition(key, cl_bundle_dependency.c.parent_uuid, value) if condition is None: # top-level - clause = cl_bundle_dependency.c.child_uuid == cl_bundle.c.uuid + where_clause = cl_bundle_dependency.c.child_uuid == cl_bundle.c.uuid else: # embedded - clause = cl_bundle.c.uuid.in_( - alias(select([cl_bundle_dependency.c.child_uuid]).where(condition)) - ) + join_tables.append(cl_bundle_dependency) + join_conditions.append(cl_bundle.c.uuid == cl_bundle_dependency.c.child_uuid) + where_clause = condition elif key.startswith('dependency/'): _, name = key.split('/', 1) condition = make_condition(key, cl_bundle_dependency.c.parent_uuid, value) if condition is None: # top-level - clause = and_( + where_clause = and_( cl_bundle_dependency.c.child_uuid == cl_bundle.c.uuid, # Join constraint cl_bundle_dependency.c.child_path == name, # Match the 'type' of dependent (child_path) ) else: # embedded - clause = cl_bundle.c.uuid.in_( - alias( - select([cl_bundle_dependency.c.child_uuid]).where( - and_( - cl_bundle_dependency.c.child_path - == name, # Match the 'type' of dependent (child_path) - condition, - ) - ) - ) + join_tables.append(cl_bundle_dependency) + join_conditions.append(cl_bundle.c.uuid == cl_bundle_dependency.c.child_uuid) + where_clause = and_( + cl_bundle_dependency.c.child_path + == name, # Match the 'type' of dependent (child_path) + condition, ) elif key == 'host_worksheet': condition = make_condition(key, cl_worksheet_item.c.worksheet_uuid, value) if condition is None: # top-level clause = cl_worksheet_item.c.bundle_uuid == cl_bundle.c.uuid # Join constraint else: - clause = cl_bundle.c.uuid.in_( - alias(select([cl_worksheet_item.c.bundle_uuid]).where(condition)) - ) + join_tables.append(cl_worksheet_item) + join_conditions.append(cl_bundle.c.uuid == cl_worksheet_item.c.bundle_uuid) + where_clause = condition elif key in ('.before', '.after'): try: target_datetime = parser.isoparse(value) @@ -548,69 +545,61 @@ def make_condition(key, field, value): target_datetime.timestamp() ) - clause = cl_bundle.c.uuid.in_( - alias( - select([cl_bundle_metadata.c.bundle_uuid]).where( - and_(cl_bundle_metadata.c.metadata_key == 'created', subclause) - ) - ) + join_tables.append(cl_bundle_metadata) + join_conditions.append(cl_bundle.c.uuid == cl_bundle_metadata.c.bundle_uuid) + where_clause = and_( + cl_bundle_metadata.c.metadata_key == 'created', subclause ) elif key == 'uuid_name': # Search uuid and name by default - clause = [] - clause.append(cl_bundle.c.uuid.like('%' + value + '%')) - clause.append( - cl_bundle.c.uuid.in_( - alias( - select([cl_bundle_metadata.c.bundle_uuid]).where( - and_( + join_tables.append(cl_bundle_metadata) + join_conditions.append(cl_bundle.c.uuid == cl_bundle_metadata.c.bundle_uuid) + + where_clause = [] + where_clause.append(cl_bundle.c.uuid.like('%' + value + '%')) + where_clause.append(and_( cl_bundle_metadata.c.metadata_key == 'name', cl_bundle_metadata.c.metadata_value.like('%' + value + '%'), - ) - ) - ) - ) - ) - clause = or_(*clause) + )) + where_clause = or_(*where_clause) elif key == '': # Match any field - clause = [] - clause.append(cl_bundle.c.uuid.like('%' + value + '%')) - clause.append(cl_bundle.c.command.like('%' + value + '%')) - clause.append( - cl_bundle.c.uuid.in_( - alias( - select([cl_bundle_metadata.c.bundle_uuid]).where( + join_tables.append(cl_bundle_metadata) + join_conditions.append(cl_bundle.c.uuid == cl_bundle_metadata.c.bundle_uuid) + + where_clause = [] + where_clause.append(cl_bundle.c.uuid.like('%' + value + '%')) + where_clause.append(cl_bundle.c.command.like('%' + value + '%')) + where_clause.append( cl_bundle_metadata.c.metadata_value.like('%' + value + '%') - ) - ) - ) ) - clause = or_(*clause) + where_clause = or_(*where_clause) # Otherwise, assume metadata. else: condition = make_condition(key, cl_bundle_metadata.c.metadata_value, value) if condition is None: # top-level - clause = and_( + where_clause = and_( cl_bundle.c.uuid == cl_bundle_metadata.c.bundle_uuid, cl_bundle_metadata.c.metadata_key == key, ) else: # embedded - clause = cl_bundle.c.uuid.in_( - select([cl_bundle_metadata.c.bundle_uuid]).where( - and_(cl_bundle_metadata.c.metadata_key == key, condition) - ) + join_tables.append(cl_bundle_metadata) + join_conditions.append(cl_bundle.c.uuid == cl_bundle_metadata.c.bundle_uuid) + + where_clause = and_( + cl_bundle_metadata.c.metadata_key == key, + condition ) - if clause is not None: - clauses.append(clause) + if where_clause is not None: + where_clauses.append(where_clause) - clause = and_(*clauses) + where_clause = and_(*where_clauses) if user_id != self.root_user_id: # Restrict to the bundles that we have access to. + join_tables.append(cl_group_bundle_permission) + join_conditions.append(cl_bundle.c.uuid == cl_group_bundle_permission.c.object_uuid) access_via_owner = cl_bundle.c.owner_id == user_id - access_via_group = cl_bundle.c.uuid.in_( - select([cl_group_bundle_permission.c.object_uuid]).where( - and_( + access_via_group = and_( or_( # Join constraint (group) cl_group_bundle_permission.c.group_uuid == self.public_group_uuid, # Public group @@ -624,13 +613,15 @@ def make_condition(key, field, value): ), cl_group_bundle_permission.c.permission >= GROUP_OBJECT_PERMISSION_READ, # Match the uuid of the parent - ) - ) ) - clause = and_(clause, or_(access_via_owner, access_via_group)) + + where_clause = and_(where_clause, or_(access_via_owner, access_via_group)) # Aggregate (sum) if sum_key[0] is not None: + """ + Ignore this for now! + """ # Construct a table with only the uuid and the num (and make sure it's distinct!) query = alias( select([cl_bundle.c.uuid, sum_key[0].label('num')]).distinct().where(clause) @@ -638,13 +629,10 @@ def make_condition(key, field, value): # Sum the numbers query = select([func.sum(query.c.num)]) else: - query = ( - select([cl_bundle.c.uuid] + aux_fields) - .distinct() - .where(clause) - .offset(offset) - .limit(limit) - ) + query = select([cl_bundle.c.uuid] + aux_fields).select_from(cl_bundle) + for join_table, join_condition in zip(join_tables, join_conditions): + query = query.join(join_table, join_condition) + query = query.distinct().where(where_clause).offset(offset).limit(limit) # Sort if sort_key[0] is not None: @@ -654,6 +642,10 @@ def make_condition(key, field, value): if count: query = alias(query).count() + """ + TEMPORARY! + """ + print(str(query)) result = self._execute_query(query) if count or sum_key[0] is not None: # Just returning a single number result = worksheet_util.apply_func(format_func, result[0]) @@ -2443,7 +2435,6 @@ def add_user( "date_joined": now, "has_access": has_access, "is_verified": is_verified, - "is_superuser": False, "password": User.encode_password(password, crypt_util.get_random_string()), "time_quota": self.default_user_info['time_quota'], "parallel_run_quota": self.default_user_info['parallel_run_quota'], From 7b3202a6053ae535fea8bfc292693b8948d3faea Mon Sep 17 00:00:00 2001 From: AndrewJGaut Date: Thu, 6 Oct 2022 21:23:11 -0700 Subject: [PATCH 03/20] Fix bug with certain keywords --- codalab/model/bundle_model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/codalab/model/bundle_model.py b/codalab/model/bundle_model.py index 38a0ea92a..d7908f067 100644 --- a/codalab/model/bundle_model.py +++ b/codalab/model/bundle_model.py @@ -470,7 +470,7 @@ def make_condition(key, field, value): format_func = value # Bundle fields elif key in ('bundle_type', 'id', 'uuid', 'data_hash', 'state', 'command', 'owner_id'): - clause = make_condition(key, getattr(cl_bundle.c, key), value) + where_clause = make_condition(key, getattr(cl_bundle.c, key), value) elif key == '.shared': # shared with any group I am in with read permission if cl_group_bundle_permission not in join_tables: join_tables.append(cl_group_bundle_permission) @@ -647,6 +647,7 @@ def make_condition(key, field, value): if count: query = alias(query).count() + logging.info(str(query)) result = self._execute_query(query) if count or sum_key[0] is not None: # Just returning a single number result = worksheet_util.apply_func(format_func, result[0]) From 08e80b35b6a90be50130ca29b2b71e7b62fd2e69 Mon Sep 17 00:00:00 2001 From: AndrewJGaut Date: Thu, 6 Oct 2022 22:05:19 -0700 Subject: [PATCH 04/20] added in aliasing --- codalab/model/bundle_model.py | 413 ++++++++++++++++++++++++++++++---- 1 file changed, 370 insertions(+), 43 deletions(-) diff --git a/codalab/model/bundle_model.py b/codalab/model/bundle_model.py index d7908f067..1d14494e7 100644 --- a/codalab/model/bundle_model.py +++ b/codalab/model/bundle_model.py @@ -16,6 +16,7 @@ import sqlalchemy from sqlalchemy import and_, or_, not_, select, union, desc, func from sqlalchemy.sql.expression import literal, true +from sqlalchemy.orm import aliased from codalab.bundles import get_bundle_subclass from codalab.bundles.run_bundle import RunBundle @@ -379,6 +380,7 @@ def search_bundles(self, user_id, keywords): Bare keywords: sugar for uuid_name=.*.* Search only bundles which are readable by user_id. """ + """ clauses = [] offset = 0 limit = SEARCH_RESULTS_LIMIT @@ -423,6 +425,298 @@ def make_condition(key, field, value): shortcuts = {'type': 'bundle_type', 'size': 'data_size', 'worksheet': 'host_worksheet'} + for keyword in keywords: + keyword = keyword.replace('.*', '%') + # Sugar + if keyword == '.mine': + keyword = 'owner_id=' + (user_id or '') + elif keyword == '.shared': + keyword = '.shared=True' + elif keyword == '.last': + keyword = 'id=.sort-' + elif keyword == '.count': + count = True + limit = None + continue + elif keyword == '.floating': + # Get bundles that have host worksheets, and then take the complement. + with_hosts = alias( + select([cl_bundle.c.uuid]).where( + cl_bundle.c.uuid == cl_worksheet_item.c.bundle_uuid + ) + ) + clause = not_(cl_bundle.c.uuid.in_(with_hosts)) + clauses.append(clause) + continue + + m = SEARCH_KEYWORD_REGEX.match(keyword) # key=value + if m: + key, value = m.group(1), m.group(2) + key = shortcuts.get(key, key) + if ',' in value: # value is value1,value2 + value = value.split(',') + else: + key, value = 'uuid_name', keyword + + clause = None + # Special functions + if key == '.offset': + offset = int(value) + elif key == '.limit': + limit = int(value) + elif key == '.format': + format_func = value + # Bundle fields + elif key in ('bundle_type', 'id', 'uuid', 'data_hash', 'state', 'command', 'owner_id'): + clause = make_condition(key, getattr(cl_bundle.c, key), value) + elif key == '.shared': # shared with any group I am in with read permission + clause = cl_bundle.c.uuid.in_( + select([cl_group_bundle_permission.c.object_uuid]).where( + and_( + cl_group_bundle_permission.c.group_uuid.in_( + alias( + select([cl_user_group.c.group_uuid]).where( + cl_user_group.c.user_id == user_id + ) + ) + ), + cl_group_bundle_permission.c.permission >= GROUP_OBJECT_PERMISSION_READ, + ) + ) + ) + elif key == 'group': # shared with group with read permission + group_uuid = get_group_info(value, False)['uuid'] + clause = cl_bundle.c.uuid.in_( + select([cl_group_bundle_permission.c.object_uuid]).where( + and_( + cl_group_bundle_permission.c.group_uuid == group_uuid, + cl_group_bundle_permission.c.permission >= GROUP_OBJECT_PERMISSION_READ, + ) + ) + ) + # Special fields + elif key == 'dependency': + # Match uuid of dependency + condition = make_condition(key, cl_bundle_dependency.c.parent_uuid, value) + if condition is None: # top-level + clause = cl_bundle_dependency.c.child_uuid == cl_bundle.c.uuid + else: # embedded + clause = cl_bundle.c.uuid.in_( + alias(select([cl_bundle_dependency.c.child_uuid]).where(condition)) + ) + elif key.startswith('dependency/'): + _, name = key.split('/', 1) + condition = make_condition(key, cl_bundle_dependency.c.parent_uuid, value) + if condition is None: # top-level + clause = and_( + cl_bundle_dependency.c.child_uuid == cl_bundle.c.uuid, # Join constraint + cl_bundle_dependency.c.child_path + == name, # Match the 'type' of dependent (child_path) + ) + else: # embedded + clause = cl_bundle.c.uuid.in_( + alias( + select([cl_bundle_dependency.c.child_uuid]).where( + and_( + cl_bundle_dependency.c.child_path + == name, # Match the 'type' of dependent (child_path) + condition, + ) + ) + ) + ) + elif key == 'host_worksheet': + condition = make_condition(key, cl_worksheet_item.c.worksheet_uuid, value) + if condition is None: # top-level + clause = cl_worksheet_item.c.bundle_uuid == cl_bundle.c.uuid # Join constraint + else: + clause = cl_bundle.c.uuid.in_( + alias(select([cl_worksheet_item.c.bundle_uuid]).where(condition)) + ) + elif key in ('.before', '.after'): + try: + target_datetime = parser.isoparse(value) + except ValueError: + raise UsageError( + "Unable to parse datetime. Datetime must be specified as an ISO-8601 datetime string such as YYYY-MM-DD." + ) + + subclause = None + if key == '.before': + subclause = cl_bundle_metadata.c.metadata_value <= int( + target_datetime.timestamp() + ) + if key == '.after': + subclause = cl_bundle_metadata.c.metadata_value >= int( + target_datetime.timestamp() + ) + + clause = cl_bundle.c.uuid.in_( + alias( + select([cl_bundle_metadata.c.bundle_uuid]).where( + and_(cl_bundle_metadata.c.metadata_key == 'created', subclause) + ) + ) + ) + elif key == 'uuid_name': # Search uuid and name by default + clause = [] + clause.append(cl_bundle.c.uuid.like('%' + value + '%')) + clause.append( + cl_bundle.c.uuid.in_( + alias( + select([cl_bundle_metadata.c.bundle_uuid]).where( + and_( + cl_bundle_metadata.c.metadata_key == 'name', + cl_bundle_metadata.c.metadata_value.like('%' + value + '%'), + ) + ) + ) + ) + ) + clause = or_(*clause) + elif key == '': # Match any field + clause = [] + clause.append(cl_bundle.c.uuid.like('%' + value + '%')) + clause.append(cl_bundle.c.command.like('%' + value + '%')) + clause.append( + cl_bundle.c.uuid.in_( + alias( + select([cl_bundle_metadata.c.bundle_uuid]).where( + cl_bundle_metadata.c.metadata_value.like('%' + value + '%') + ) + ) + ) + ) + clause = or_(*clause) + # Otherwise, assume metadata. + else: + condition = make_condition(key, cl_bundle_metadata.c.metadata_value, value) + if condition is None: # top-level + clause = and_( + cl_bundle.c.uuid == cl_bundle_metadata.c.bundle_uuid, + cl_bundle_metadata.c.metadata_key == key, + ) + else: # embedded + clause = cl_bundle.c.uuid.in_( + select([cl_bundle_metadata.c.bundle_uuid]).where( + and_(cl_bundle_metadata.c.metadata_key == key, condition) + ) + ) + + if clause is not None: + clauses.append(clause) + + clause = and_(*clauses) + + if user_id != self.root_user_id: + # Restrict to the bundles that we have access to. + access_via_owner = cl_bundle.c.owner_id == user_id + access_via_group = cl_bundle.c.uuid.in_( + select([cl_group_bundle_permission.c.object_uuid]).where( + and_( + or_( # Join constraint (group) + cl_group_bundle_permission.c.group_uuid + == self.public_group_uuid, # Public group + cl_group_bundle_permission.c.group_uuid.in_( + alias( + select([cl_user_group.c.group_uuid]).where( + cl_user_group.c.user_id == user_id + ) + ) + ), # Private group + ), + cl_group_bundle_permission.c.permission + >= GROUP_OBJECT_PERMISSION_READ, # Match the uuid of the parent + ) + ) + ) + clause = and_(clause, or_(access_via_owner, access_via_group)) + + # Aggregate (sum) + if sum_key[0] is not None: + # Construct a table with only the uuid and the num (and make sure it's distinct!) + query = alias( + select([cl_bundle.c.uuid, sum_key[0].label('num')]).distinct().where(clause) + ) + # Sum the numbers + query = select([func.sum(query.c.num)]) + else: + query = ( + select([cl_bundle.c.uuid] + aux_fields) + .distinct() + .where(clause) + .offset(offset) + .limit(limit) + ) + + # Sort + if sort_key[0] is not None: + query = query.order_by(sort_key[0]) + + # Count + if count: + query = alias(query).count() + + logging.info(str(query)) + result = self._execute_query(query) + if count or sum_key[0] is not None: # Just returning a single number + result = worksheet_util.apply_func(format_func, result[0]) + return {'result': result, 'is_aggregate': True} + return {'result': result, 'is_aggregate': False} + """ + clauses = [] + offset = 0 + limit = SEARCH_RESULTS_LIMIT + format_func = None + count = False + sort_key = [None] + sum_key = [None] + aux_fields = [] # Fields (e.g., sorting) that we need to include in the query + + # Number nested subqueries + subquery_index = [0] + + def alias(clause): + subquery_index[0] += 1 + return clause.alias('q' + str(subquery_index[0])) + + def is_numeric(key): + return key != 'name' + + def make_condition(key, field, value): + # Special + if value == '.sort': + aux_fields.append(field) + if is_numeric(key): + field = field * 1 + sort_key[0] = field + elif value == '.sort-': + aux_fields.append(field) + if is_numeric(key): + field = field * 1 + sort_key[0] = desc(field) + elif value == '.sum': + sum_key[0] = field * 1 + else: + # Ordinary value + if isinstance(value, list): + return field.in_(value) + if '%' in value: + return field.like(value) + return field == value + return None + + def add_join(join_table, join_condition): + """ + if join_table not in join_tables: + join_tables.append(join_table) + join_conditions.append(join_condition) + """ + join_tables.append(join_table) + join_conditions.append(join_condition) + + shortcuts = {'type': 'bundle_type', 'size': 'data_size', 'worksheet': 'host_worksheet'} + join_tables = [] join_conditions = [] where_clauses = [] @@ -472,21 +766,15 @@ def make_condition(key, field, value): elif key in ('bundle_type', 'id', 'uuid', 'data_hash', 'state', 'command', 'owner_id'): where_clause = make_condition(key, getattr(cl_bundle.c, key), value) elif key == '.shared': # shared with any group I am in with read permission - if cl_group_bundle_permission not in join_tables: - join_tables.append(cl_group_bundle_permission) - join_conditions.append(cl_bundle.c.uuid == cl_group_bundle_permission.c.object_uuid) - if cl_user_group not in join_tables: - join_tables.append(cl_user_group) - join_conditions.append(cl_group_bundle_permission.c.group_uuid == cl_user_group.c.group_uuid) + add_join(cl_group_bundle_permission, cl_bundle.c.uuid == cl_group_bundle_permission.c.object_uuid) + add_join(cl_user_group, cl_group_bundle_permission.c.group_uuid == cl_user_group.c.group_uuid) where_clause = and_( cl_user_group.c.user_id == user_id, cl_group_bundle_permission.c.permission >= GROUP_OBJECT_PERMISSION_READ ) elif key == 'group': # shared with group with read permission - if cl_group_bundle_permission not in join_tables: - join_tables.append(cl_group_bundle_permission) - join_conditions.append(cl_bundle.c.uuid == cl_group_bundle_permission.c.object_uuid) + add_join(cl_group_bundle_permission, cl_bundle.c.uuid == cl_group_bundle_permission.c.object_uuid) group_uuid = get_group_info(value, False)['uuid'] where_clause = and_( cl_group_bundle_permission.c.group_uuid == group_uuid, @@ -499,9 +787,7 @@ def make_condition(key, field, value): if condition is None: # top-level where_clause = cl_bundle_dependency.c.child_uuid == cl_bundle.c.uuid else: # embedded - if cl_bundle_dependency not in join_tables: - join_tables.append(cl_bundle_dependency) - join_conditions.append(cl_bundle.c.uuid == cl_bundle_dependency.c.child_uuid) + add_join(cl_bundle_dependency, cl_bundle.c.uuid == cl_bundle_dependency.c.child_uuid) where_clause = condition elif key.startswith('dependency/'): _, name = key.split('/', 1) @@ -513,9 +799,7 @@ def make_condition(key, field, value): == name, # Match the 'type' of dependent (child_path) ) else: # embedded - if cl_bundle_dependency not in join_tables: - join_tables.append(cl_bundle_dependency) - join_conditions.append(cl_bundle.c.uuid == cl_bundle_dependency.c.child_uuid) + add_join(cl_bundle_dependency, cl_bundle.c.uuid == cl_bundle_dependency.c.child_uuid) where_clause = and_( cl_bundle_dependency.c.child_path == name, # Match the 'type' of dependent (child_path) @@ -526,9 +810,7 @@ def make_condition(key, field, value): if condition is None: # top-level clause = cl_worksheet_item.c.bundle_uuid == cl_bundle.c.uuid # Join constraint else: - if cl_worksheet_item not in join_tables: - join_tables.append(cl_worksheet_item) - join_conditions.append(cl_bundle.c.uuid == cl_worksheet_item.c.bundle_uuid) + add_join(cl_worksheet_item, cl_bundle.c.uuid == cl_worksheet_item.c.bundle_uuid) where_clause = condition elif key in ('.before', '.after'): try: @@ -539,59 +821,55 @@ def make_condition(key, field, value): ) subclause = None + aliased_bundle_metadata = aliased(cl_bundle_metadata) if key == '.before': - subclause = cl_bundle_metadata.c.metadata_value <= int( + subclause = aliased_bundle_metadata.c.metadata_value <= int( target_datetime.timestamp() ) if key == '.after': - subclause = cl_bundle_metadata.c.metadata_value >= int( + subclause = aliased_bundle_metadata.c.metadata_value >= int( target_datetime.timestamp() ) - if cl_bundle_metadata not in join_tables: - join_tables.append(cl_bundle_metadata) - join_conditions.append(cl_bundle.c.uuid == cl_bundle_metadata.c.bundle_uuid) + add_join(aliased_bundle_metadata, cl_bundle.c.uuid == aliased_bundle_metadata.c.bundle_uuid) where_clause = and_( - cl_bundle_metadata.c.metadata_key == 'created', subclause + aliased_bundle_metadata.c.metadata_key == 'created', subclause ) elif key == 'uuid_name': # Search uuid and name by default - if cl_bundle_metadata not in join_tables: - join_tables.append(cl_bundle_metadata) - join_conditions.append(cl_bundle.c.uuid == cl_bundle_metadata.c.bundle_uuid) + aliased_bundle_metadata = aliased(cl_bundle_metadata) + add_join(aliased_bundle_metadata, cl_bundle.c.uuid == aliased_bundle_metadata.c.bundle_uuid) where_clause = [] where_clause.append(cl_bundle.c.uuid.like('%' + value + '%')) where_clause.append(and_( - cl_bundle_metadata.c.metadata_key == 'name', - cl_bundle_metadata.c.metadata_value.like('%' + value + '%'), + aliased_bundle_metadata.c.metadata_key == 'name', + aliased_bundle_metadata.c.metadata_value.like('%' + value + '%'), )) where_clause = or_(*where_clause) elif key == '': # Match any field - if cl_bundle_metadata not in join_tables: - join_tables.append(cl_bundle_metadata) - join_conditions.append(cl_bundle.c.uuid == cl_bundle_metadata.c.bundle_uuid) + aliased_bundle_metadata = aliased(cl_bundle_metadata) + add_join(aliased_bundle_metadata, cl_bundle.c.uuid == aliased_bundle_metadata.c.bundle_uuid) where_clause = [] where_clause.append(cl_bundle.c.uuid.like('%' + value + '%')) where_clause.append(cl_bundle.c.command.like('%' + value + '%')) where_clause.append( - cl_bundle_metadata.c.metadata_value.like('%' + value + '%') + aliased_bundle_metadata.c.metadata_value.like('%' + value + '%') ) where_clause = or_(*where_clause) # Otherwise, assume metadata. else: - condition = make_condition(key, cl_bundle_metadata.c.metadata_value, value) + aliased_bundle_metadata = aliased(cl_bundle_metadata) + condition = make_condition(key, aliased_bundle_metadata.c.metadata_value, value) if condition is None: # top-level where_clause = and_( - cl_bundle.c.uuid == cl_bundle_metadata.c.bundle_uuid, - cl_bundle_metadata.c.metadata_key == key, + cl_bundle.c.uuid == aliased_bundle_metadata.c.bundle_uuid, + aliased_bundle_metadata.c.metadata_key == key, ) else: # embedded - if cl_bundle_metadata not in join_tables: - join_tables.append(cl_bundle_metadata) - join_conditions.append(cl_bundle.c.uuid == cl_bundle_metadata.c.bundle_uuid) + add_join(aliased_bundle_metadata, cl_bundle.c.uuid == aliased_bundle_metadata.c.bundle_uuid) where_clause = and_( - cl_bundle_metadata.c.metadata_key == key, + aliased_bundle_metadata.c.metadata_key == key, condition ) @@ -602,9 +880,7 @@ def make_condition(key, field, value): if user_id != self.root_user_id: # Restrict to the bundles that we have access to. - if cl_group_bundle_permission not in join_tables: - join_tables.append(cl_group_bundle_permission) - join_conditions.append(cl_bundle.c.uuid == cl_group_bundle_permission.c.object_uuid) + add_join(cl_group_bundle_permission, cl_bundle.c.uuid == cl_group_bundle_permission.c.object_uuid) access_via_owner = cl_bundle.c.owner_id == user_id access_via_group = and_( or_( # Join constraint (group) @@ -654,6 +930,57 @@ def make_condition(key, field, value): return {'result': result, 'is_aggregate': True} return {'result': result, 'is_aggregate': False} + def get_bundle_uuids(self, conditions, max_results): + """ + Returns a list of bundle_uuids that have match the conditions. + Possible conditions on bundles: uuid, name, worksheet_uuid + """ + if 'uuid' in conditions: + # Match the uuid only + clause = self.make_clause(cl_bundle.c.uuid, conditions['uuid']) + query = select([cl_bundle.c.uuid]).where(clause) + elif 'name' in conditions: + # Select name + if conditions['name']: + clause = and_( + cl_bundle_metadata.c.metadata_key == 'name', + self.make_clause(cl_bundle_metadata.c.metadata_value, conditions['name']), + ) + else: + clause = true() + + if conditions['worksheet_uuid']: + # Select things on the given worksheet + # WARNING: Will also include invalid bundle ids that are listed on the worksheet + clause = and_( + clause, + self.make_clause( + cl_worksheet_item.c.worksheet_uuid, conditions['worksheet_uuid'] + ), + ) + clause = and_(clause, cl_worksheet_item.c.bundle_uuid.isnot(None)) + join = cl_worksheet_item.outerjoin( + cl_bundle_metadata, + cl_worksheet_item.c.bundle_uuid == cl_bundle_metadata.c.bundle_uuid, + ) + query = ( + select([cl_worksheet_item.c.bundle_uuid, cl_worksheet_item.c.id]) + .select_from(join) + .distinct() + .where(clause) + ) + query = query.order_by(cl_worksheet_item.c.id.desc()).limit(max_results) + else: + if not conditions['name']: + raise UsageError('Nothing is specified') + # Select from all bundles + clause = and_(clause, cl_bundle.c.uuid == cl_bundle_metadata.c.bundle_uuid) # Join + query = select([cl_bundle.c.uuid]).where(clause) + query = query.order_by(cl_bundle.c.id.desc()).limit(max_results) + + return self._execute_query(query) + + def get_bundle_uuids(self, conditions, max_results): """ Returns a list of bundle_uuids that have match the conditions. From 20073eb2e9e77d603e5b70cbb6709610058edc01 Mon Sep 17 00:00:00 2001 From: AndrewJGaut Date: Fri, 7 Oct 2022 13:45:26 -0700 Subject: [PATCH 05/20] Run pre-commit --- codalab/model/bundle_model.py | 51 ------------------- .../compose_files/.docker/canary.json | 9 ++++ .../compose_files/.docker/features.json | 3 ++ 3 files changed, 12 insertions(+), 51 deletions(-) create mode 100755 docker_config/compose_files/.docker/canary.json create mode 100644 docker_config/compose_files/.docker/features.json diff --git a/codalab/model/bundle_model.py b/codalab/model/bundle_model.py index 1d14494e7..aec1afe11 100644 --- a/codalab/model/bundle_model.py +++ b/codalab/model/bundle_model.py @@ -930,57 +930,6 @@ def add_join(join_table, join_condition): return {'result': result, 'is_aggregate': True} return {'result': result, 'is_aggregate': False} - def get_bundle_uuids(self, conditions, max_results): - """ - Returns a list of bundle_uuids that have match the conditions. - Possible conditions on bundles: uuid, name, worksheet_uuid - """ - if 'uuid' in conditions: - # Match the uuid only - clause = self.make_clause(cl_bundle.c.uuid, conditions['uuid']) - query = select([cl_bundle.c.uuid]).where(clause) - elif 'name' in conditions: - # Select name - if conditions['name']: - clause = and_( - cl_bundle_metadata.c.metadata_key == 'name', - self.make_clause(cl_bundle_metadata.c.metadata_value, conditions['name']), - ) - else: - clause = true() - - if conditions['worksheet_uuid']: - # Select things on the given worksheet - # WARNING: Will also include invalid bundle ids that are listed on the worksheet - clause = and_( - clause, - self.make_clause( - cl_worksheet_item.c.worksheet_uuid, conditions['worksheet_uuid'] - ), - ) - clause = and_(clause, cl_worksheet_item.c.bundle_uuid.isnot(None)) - join = cl_worksheet_item.outerjoin( - cl_bundle_metadata, - cl_worksheet_item.c.bundle_uuid == cl_bundle_metadata.c.bundle_uuid, - ) - query = ( - select([cl_worksheet_item.c.bundle_uuid, cl_worksheet_item.c.id]) - .select_from(join) - .distinct() - .where(clause) - ) - query = query.order_by(cl_worksheet_item.c.id.desc()).limit(max_results) - else: - if not conditions['name']: - raise UsageError('Nothing is specified') - # Select from all bundles - clause = and_(clause, cl_bundle.c.uuid == cl_bundle_metadata.c.bundle_uuid) # Join - query = select([cl_bundle.c.uuid]).where(clause) - query = query.order_by(cl_bundle.c.id.desc()).limit(max_results) - - return self._execute_query(query) - - def get_bundle_uuids(self, conditions, max_results): """ Returns a list of bundle_uuids that have match the conditions. diff --git a/docker_config/compose_files/.docker/canary.json b/docker_config/compose_files/.docker/canary.json new file mode 100755 index 000000000..b52065b5b --- /dev/null +++ b/docker_config/compose_files/.docker/canary.json @@ -0,0 +1,9 @@ +{ + "compose-versions": { + "2.6.1": { + "active-percentage": 1, + "include-pro-users": true, + "default": 0.00 + } + } +} diff --git a/docker_config/compose_files/.docker/features.json b/docker_config/compose_files/.docker/features.json new file mode 100644 index 000000000..736bebfbd --- /dev/null +++ b/docker_config/compose_files/.docker/features.json @@ -0,0 +1,3 @@ +{ + "composeV2": "" +} \ No newline at end of file From 801c1bef26dee88de6b80fc7c048d8813e04a6fc Mon Sep 17 00:00:00 2001 From: AndrewJGaut Date: Fri, 7 Oct 2022 14:36:44 -0700 Subject: [PATCH 06/20] Remove code used for testing speedups --- codalab/model/bundle_model.py | 290 ---------------------------------- 1 file changed, 290 deletions(-) diff --git a/codalab/model/bundle_model.py b/codalab/model/bundle_model.py index aec1afe11..4e2b94da3 100644 --- a/codalab/model/bundle_model.py +++ b/codalab/model/bundle_model.py @@ -380,290 +380,6 @@ def search_bundles(self, user_id, keywords): Bare keywords: sugar for uuid_name=.*.* Search only bundles which are readable by user_id. """ - """ - clauses = [] - offset = 0 - limit = SEARCH_RESULTS_LIMIT - format_func = None - count = False - sort_key = [None] - sum_key = [None] - aux_fields = [] # Fields (e.g., sorting) that we need to include in the query - - # Number nested subqueries - subquery_index = [0] - - def alias(clause): - subquery_index[0] += 1 - return clause.alias('q' + str(subquery_index[0])) - - def is_numeric(key): - return key != 'name' - - def make_condition(key, field, value): - # Special - if value == '.sort': - aux_fields.append(field) - if is_numeric(key): - field = field * 1 - sort_key[0] = field - elif value == '.sort-': - aux_fields.append(field) - if is_numeric(key): - field = field * 1 - sort_key[0] = desc(field) - elif value == '.sum': - sum_key[0] = field * 1 - else: - # Ordinary value - if isinstance(value, list): - return field.in_(value) - if '%' in value: - return field.like(value) - return field == value - return None - - shortcuts = {'type': 'bundle_type', 'size': 'data_size', 'worksheet': 'host_worksheet'} - - for keyword in keywords: - keyword = keyword.replace('.*', '%') - # Sugar - if keyword == '.mine': - keyword = 'owner_id=' + (user_id or '') - elif keyword == '.shared': - keyword = '.shared=True' - elif keyword == '.last': - keyword = 'id=.sort-' - elif keyword == '.count': - count = True - limit = None - continue - elif keyword == '.floating': - # Get bundles that have host worksheets, and then take the complement. - with_hosts = alias( - select([cl_bundle.c.uuid]).where( - cl_bundle.c.uuid == cl_worksheet_item.c.bundle_uuid - ) - ) - clause = not_(cl_bundle.c.uuid.in_(with_hosts)) - clauses.append(clause) - continue - - m = SEARCH_KEYWORD_REGEX.match(keyword) # key=value - if m: - key, value = m.group(1), m.group(2) - key = shortcuts.get(key, key) - if ',' in value: # value is value1,value2 - value = value.split(',') - else: - key, value = 'uuid_name', keyword - - clause = None - # Special functions - if key == '.offset': - offset = int(value) - elif key == '.limit': - limit = int(value) - elif key == '.format': - format_func = value - # Bundle fields - elif key in ('bundle_type', 'id', 'uuid', 'data_hash', 'state', 'command', 'owner_id'): - clause = make_condition(key, getattr(cl_bundle.c, key), value) - elif key == '.shared': # shared with any group I am in with read permission - clause = cl_bundle.c.uuid.in_( - select([cl_group_bundle_permission.c.object_uuid]).where( - and_( - cl_group_bundle_permission.c.group_uuid.in_( - alias( - select([cl_user_group.c.group_uuid]).where( - cl_user_group.c.user_id == user_id - ) - ) - ), - cl_group_bundle_permission.c.permission >= GROUP_OBJECT_PERMISSION_READ, - ) - ) - ) - elif key == 'group': # shared with group with read permission - group_uuid = get_group_info(value, False)['uuid'] - clause = cl_bundle.c.uuid.in_( - select([cl_group_bundle_permission.c.object_uuid]).where( - and_( - cl_group_bundle_permission.c.group_uuid == group_uuid, - cl_group_bundle_permission.c.permission >= GROUP_OBJECT_PERMISSION_READ, - ) - ) - ) - # Special fields - elif key == 'dependency': - # Match uuid of dependency - condition = make_condition(key, cl_bundle_dependency.c.parent_uuid, value) - if condition is None: # top-level - clause = cl_bundle_dependency.c.child_uuid == cl_bundle.c.uuid - else: # embedded - clause = cl_bundle.c.uuid.in_( - alias(select([cl_bundle_dependency.c.child_uuid]).where(condition)) - ) - elif key.startswith('dependency/'): - _, name = key.split('/', 1) - condition = make_condition(key, cl_bundle_dependency.c.parent_uuid, value) - if condition is None: # top-level - clause = and_( - cl_bundle_dependency.c.child_uuid == cl_bundle.c.uuid, # Join constraint - cl_bundle_dependency.c.child_path - == name, # Match the 'type' of dependent (child_path) - ) - else: # embedded - clause = cl_bundle.c.uuid.in_( - alias( - select([cl_bundle_dependency.c.child_uuid]).where( - and_( - cl_bundle_dependency.c.child_path - == name, # Match the 'type' of dependent (child_path) - condition, - ) - ) - ) - ) - elif key == 'host_worksheet': - condition = make_condition(key, cl_worksheet_item.c.worksheet_uuid, value) - if condition is None: # top-level - clause = cl_worksheet_item.c.bundle_uuid == cl_bundle.c.uuid # Join constraint - else: - clause = cl_bundle.c.uuid.in_( - alias(select([cl_worksheet_item.c.bundle_uuid]).where(condition)) - ) - elif key in ('.before', '.after'): - try: - target_datetime = parser.isoparse(value) - except ValueError: - raise UsageError( - "Unable to parse datetime. Datetime must be specified as an ISO-8601 datetime string such as YYYY-MM-DD." - ) - - subclause = None - if key == '.before': - subclause = cl_bundle_metadata.c.metadata_value <= int( - target_datetime.timestamp() - ) - if key == '.after': - subclause = cl_bundle_metadata.c.metadata_value >= int( - target_datetime.timestamp() - ) - - clause = cl_bundle.c.uuid.in_( - alias( - select([cl_bundle_metadata.c.bundle_uuid]).where( - and_(cl_bundle_metadata.c.metadata_key == 'created', subclause) - ) - ) - ) - elif key == 'uuid_name': # Search uuid and name by default - clause = [] - clause.append(cl_bundle.c.uuid.like('%' + value + '%')) - clause.append( - cl_bundle.c.uuid.in_( - alias( - select([cl_bundle_metadata.c.bundle_uuid]).where( - and_( - cl_bundle_metadata.c.metadata_key == 'name', - cl_bundle_metadata.c.metadata_value.like('%' + value + '%'), - ) - ) - ) - ) - ) - clause = or_(*clause) - elif key == '': # Match any field - clause = [] - clause.append(cl_bundle.c.uuid.like('%' + value + '%')) - clause.append(cl_bundle.c.command.like('%' + value + '%')) - clause.append( - cl_bundle.c.uuid.in_( - alias( - select([cl_bundle_metadata.c.bundle_uuid]).where( - cl_bundle_metadata.c.metadata_value.like('%' + value + '%') - ) - ) - ) - ) - clause = or_(*clause) - # Otherwise, assume metadata. - else: - condition = make_condition(key, cl_bundle_metadata.c.metadata_value, value) - if condition is None: # top-level - clause = and_( - cl_bundle.c.uuid == cl_bundle_metadata.c.bundle_uuid, - cl_bundle_metadata.c.metadata_key == key, - ) - else: # embedded - clause = cl_bundle.c.uuid.in_( - select([cl_bundle_metadata.c.bundle_uuid]).where( - and_(cl_bundle_metadata.c.metadata_key == key, condition) - ) - ) - - if clause is not None: - clauses.append(clause) - - clause = and_(*clauses) - - if user_id != self.root_user_id: - # Restrict to the bundles that we have access to. - access_via_owner = cl_bundle.c.owner_id == user_id - access_via_group = cl_bundle.c.uuid.in_( - select([cl_group_bundle_permission.c.object_uuid]).where( - and_( - or_( # Join constraint (group) - cl_group_bundle_permission.c.group_uuid - == self.public_group_uuid, # Public group - cl_group_bundle_permission.c.group_uuid.in_( - alias( - select([cl_user_group.c.group_uuid]).where( - cl_user_group.c.user_id == user_id - ) - ) - ), # Private group - ), - cl_group_bundle_permission.c.permission - >= GROUP_OBJECT_PERMISSION_READ, # Match the uuid of the parent - ) - ) - ) - clause = and_(clause, or_(access_via_owner, access_via_group)) - - # Aggregate (sum) - if sum_key[0] is not None: - # Construct a table with only the uuid and the num (and make sure it's distinct!) - query = alias( - select([cl_bundle.c.uuid, sum_key[0].label('num')]).distinct().where(clause) - ) - # Sum the numbers - query = select([func.sum(query.c.num)]) - else: - query = ( - select([cl_bundle.c.uuid] + aux_fields) - .distinct() - .where(clause) - .offset(offset) - .limit(limit) - ) - - # Sort - if sort_key[0] is not None: - query = query.order_by(sort_key[0]) - - # Count - if count: - query = alias(query).count() - - logging.info(str(query)) - result = self._execute_query(query) - if count or sum_key[0] is not None: # Just returning a single number - result = worksheet_util.apply_func(format_func, result[0]) - return {'result': result, 'is_aggregate': True} - return {'result': result, 'is_aggregate': False} - """ clauses = [] offset = 0 limit = SEARCH_RESULTS_LIMIT @@ -707,11 +423,6 @@ def make_condition(key, field, value): return None def add_join(join_table, join_condition): - """ - if join_table not in join_tables: - join_tables.append(join_table) - join_conditions.append(join_condition) - """ join_tables.append(join_table) join_conditions.append(join_condition) @@ -923,7 +634,6 @@ def add_join(join_table, join_condition): if count: query = alias(query).count() - logging.info(str(query)) result = self._execute_query(query) if count or sum_key[0] is not None: # Just returning a single number result = worksheet_util.apply_func(format_func, result[0]) From d1a649f8227032a7cf86fb8eb71cf69a9427684a Mon Sep 17 00:00:00 2001 From: AndrewJGaut Date: Fri, 7 Oct 2022 14:56:46 -0700 Subject: [PATCH 07/20] fix issue with mypy typing --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index af7b41cb7..6cb4669a0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,7 +19,7 @@ ignore_missing_imports = True [mypy-setuptools,setuptools.command.install] ignore_missing_imports = True -[mypy-sqlalchemy,sqlalchemy.types,sqlalchemy.sql.schema,sqlalchemy.sql.expression,sqlalchemy.pool,sqlalchemy.engine.reflection] +[mypy-sqlalchemy,sqlalchemy.types,sqlalchemy.sql.schema,sqlalchemy.sql.expression,sqlalchemy.pool,sqlalchemy.engine.reflection, sqlalchemy.orm] ignore_missing_imports = True [mypy-watchdog.observers,watchdog.events] From af43e96978bdca2332ec333a311a34e238e5244e Mon Sep 17 00:00:00 2001 From: AndrewJGaut Date: Fri, 7 Oct 2022 16:00:37 -0700 Subject: [PATCH 08/20] Remove docker_config files --- docker_config/compose_files/.docker/canary.json | 9 --------- docker_config/compose_files/.docker/features.json | 3 --- setup.cfg | 2 +- 3 files changed, 1 insertion(+), 13 deletions(-) delete mode 100755 docker_config/compose_files/.docker/canary.json delete mode 100644 docker_config/compose_files/.docker/features.json diff --git a/docker_config/compose_files/.docker/canary.json b/docker_config/compose_files/.docker/canary.json deleted file mode 100755 index b52065b5b..000000000 --- a/docker_config/compose_files/.docker/canary.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compose-versions": { - "2.6.1": { - "active-percentage": 1, - "include-pro-users": true, - "default": 0.00 - } - } -} diff --git a/docker_config/compose_files/.docker/features.json b/docker_config/compose_files/.docker/features.json deleted file mode 100644 index 736bebfbd..000000000 --- a/docker_config/compose_files/.docker/features.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "composeV2": "" -} \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 6cb4669a0..955d4fdd0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,7 +19,7 @@ ignore_missing_imports = True [mypy-setuptools,setuptools.command.install] ignore_missing_imports = True -[mypy-sqlalchemy,sqlalchemy.types,sqlalchemy.sql.schema,sqlalchemy.sql.expression,sqlalchemy.pool,sqlalchemy.engine.reflection, sqlalchemy.orm] +[mypy-sqlalchemy,sqlalchemy.types,sqlalchemy.sql.schema,sqlalchemy.sql.expression,sqlalchemy.pool,sqlalchemy.engine.reflection,sqlalchemy.orm] ignore_missing_imports = True [mypy-watchdog.observers,watchdog.events] From c5e888b559e17ceee8d8a68c98f356e2835c7066 Mon Sep 17 00:00:00 2001 From: AndrewJGaut Date: Fri, 7 Oct 2022 16:09:40 -0700 Subject: [PATCH 09/20] fix minor flake8 formatting issues --- codalab/model/bundle_model.py | 47 ++++++++++++++++------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/codalab/model/bundle_model.py b/codalab/model/bundle_model.py index 4e2b94da3..e4979def7 100644 --- a/codalab/model/bundle_model.py +++ b/codalab/model/bundle_model.py @@ -13,7 +13,6 @@ from dateutil import parser from uuid import uuid4 -import sqlalchemy from sqlalchemy import and_, or_, not_, select, union, desc, func from sqlalchemy.sql.expression import literal, true from sqlalchemy.orm import aliased @@ -380,7 +379,6 @@ def search_bundles(self, user_id, keywords): Bare keywords: sugar for uuid_name=.*.* Search only bundles which are readable by user_id. """ - clauses = [] offset = 0 limit = SEARCH_RESULTS_LIMIT format_func = None @@ -481,15 +479,15 @@ def add_join(join_table, join_condition): add_join(cl_user_group, cl_group_bundle_permission.c.group_uuid == cl_user_group.c.group_uuid) where_clause = and_( - cl_user_group.c.user_id == user_id, - cl_group_bundle_permission.c.permission >= GROUP_OBJECT_PERMISSION_READ + cl_user_group.c.user_id == user_id, + cl_group_bundle_permission.c.permission >= GROUP_OBJECT_PERMISSION_READ ) elif key == 'group': # shared with group with read permission add_join(cl_group_bundle_permission, cl_bundle.c.uuid == cl_group_bundle_permission.c.object_uuid) group_uuid = get_group_info(value, False)['uuid'] where_clause = and_( - cl_group_bundle_permission.c.group_uuid == group_uuid, - cl_group_bundle_permission.c.permission >= GROUP_OBJECT_PERMISSION_READ, + cl_group_bundle_permission.c.group_uuid == group_uuid, + cl_group_bundle_permission.c.permission >= GROUP_OBJECT_PERMISSION_READ, ) # Special fields elif key == 'dependency': @@ -553,8 +551,8 @@ def add_join(join_table, join_condition): where_clause.append(cl_bundle.c.uuid.like('%' + value + '%')) where_clause.append(and_( aliased_bundle_metadata.c.metadata_key == 'name', - aliased_bundle_metadata.c.metadata_value.like('%' + value + '%'), - )) + aliased_bundle_metadata.c.metadata_value.like('%' + value + '%'),) + ) where_clause = or_(*where_clause) elif key == '': # Match any field aliased_bundle_metadata = aliased(cl_bundle_metadata) @@ -564,7 +562,7 @@ def add_join(join_table, join_condition): where_clause.append(cl_bundle.c.uuid.like('%' + value + '%')) where_clause.append(cl_bundle.c.command.like('%' + value + '%')) where_clause.append( - aliased_bundle_metadata.c.metadata_value.like('%' + value + '%') + aliased_bundle_metadata.c.metadata_value.like('%' + value + '%') ) where_clause = or_(*where_clause) # Otherwise, assume metadata. @@ -580,7 +578,7 @@ def add_join(join_table, join_condition): add_join(aliased_bundle_metadata, cl_bundle.c.uuid == aliased_bundle_metadata.c.bundle_uuid) where_clause = and_( - aliased_bundle_metadata.c.metadata_key == key, + aliased_bundle_metadata.c.metadata_key == key, condition ) @@ -594,24 +592,23 @@ def add_join(join_table, join_condition): add_join(cl_group_bundle_permission, cl_bundle.c.uuid == cl_group_bundle_permission.c.object_uuid) access_via_owner = cl_bundle.c.owner_id == user_id access_via_group = and_( - or_( # Join constraint (group) - cl_group_bundle_permission.c.group_uuid - == self.public_group_uuid, # Public group - cl_group_bundle_permission.c.group_uuid.in_( - alias( - select([cl_user_group.c.group_uuid]).where( - cl_user_group.c.user_id == user_id - ) - ) - ), # Private group - ), - cl_group_bundle_permission.c.permission - >= GROUP_OBJECT_PERMISSION_READ, # Match the uuid of the parent + or_( # Join constraint (group) + cl_group_bundle_permission.c.group_uuid + == self.public_group_uuid, # Public group + cl_group_bundle_permission.c.group_uuid.in_( + alias( + select([cl_user_group.c.group_uuid]).where( + cl_user_group.c.user_id == user_id + ) + ) + ), # Private group + ), + cl_group_bundle_permission.c.permission + >= GROUP_OBJECT_PERMISSION_READ, # Match the uuid of the parent ) - + where_clause = and_(where_clause, or_(access_via_owner, access_via_group)) - table = cl_bundle for join_table, join_condition in zip(join_tables, join_conditions): table = table.join(join_table, join_condition) From fa702d36505563cab69e14ab5ba8cf5aec092331 Mon Sep 17 00:00:00 2001 From: AndrewJGaut Date: Fri, 7 Oct 2022 16:30:32 -0700 Subject: [PATCH 10/20] Fix another formatting issue --- codalab/model/bundle_model.py | 72 ++++++++++++++++++++++++----------- pre-commit.sh | 2 +- 2 files changed, 51 insertions(+), 23 deletions(-) diff --git a/codalab/model/bundle_model.py b/codalab/model/bundle_model.py index e4979def7..e7ac5e44e 100644 --- a/codalab/model/bundle_model.py +++ b/codalab/model/bundle_model.py @@ -475,15 +475,24 @@ def add_join(join_table, join_condition): elif key in ('bundle_type', 'id', 'uuid', 'data_hash', 'state', 'command', 'owner_id'): where_clause = make_condition(key, getattr(cl_bundle.c, key), value) elif key == '.shared': # shared with any group I am in with read permission - add_join(cl_group_bundle_permission, cl_bundle.c.uuid == cl_group_bundle_permission.c.object_uuid) - add_join(cl_user_group, cl_group_bundle_permission.c.group_uuid == cl_user_group.c.group_uuid) + add_join( + cl_group_bundle_permission, + cl_bundle.c.uuid == cl_group_bundle_permission.c.object_uuid, + ) + add_join( + cl_user_group, + cl_group_bundle_permission.c.group_uuid == cl_user_group.c.group_uuid, + ) where_clause = and_( cl_user_group.c.user_id == user_id, - cl_group_bundle_permission.c.permission >= GROUP_OBJECT_PERMISSION_READ + cl_group_bundle_permission.c.permission >= GROUP_OBJECT_PERMISSION_READ, ) elif key == 'group': # shared with group with read permission - add_join(cl_group_bundle_permission, cl_bundle.c.uuid == cl_group_bundle_permission.c.object_uuid) + add_join( + cl_group_bundle_permission, + cl_bundle.c.uuid == cl_group_bundle_permission.c.object_uuid, + ) group_uuid = get_group_info(value, False)['uuid'] where_clause = and_( cl_group_bundle_permission.c.group_uuid == group_uuid, @@ -496,7 +505,9 @@ def add_join(join_table, join_condition): if condition is None: # top-level where_clause = cl_bundle_dependency.c.child_uuid == cl_bundle.c.uuid else: # embedded - add_join(cl_bundle_dependency, cl_bundle.c.uuid == cl_bundle_dependency.c.child_uuid) + add_join( + cl_bundle_dependency, cl_bundle.c.uuid == cl_bundle_dependency.c.child_uuid + ) where_clause = condition elif key.startswith('dependency/'): _, name = key.split('/', 1) @@ -508,7 +519,9 @@ def add_join(join_table, join_condition): == name, # Match the 'type' of dependent (child_path) ) else: # embedded - add_join(cl_bundle_dependency, cl_bundle.c.uuid == cl_bundle_dependency.c.child_uuid) + add_join( + cl_bundle_dependency, cl_bundle.c.uuid == cl_bundle_dependency.c.child_uuid + ) where_clause = and_( cl_bundle_dependency.c.child_path == name, # Match the 'type' of dependent (child_path) @@ -539,24 +552,33 @@ def add_join(join_table, join_condition): subclause = aliased_bundle_metadata.c.metadata_value >= int( target_datetime.timestamp() ) - add_join(aliased_bundle_metadata, cl_bundle.c.uuid == aliased_bundle_metadata.c.bundle_uuid) - where_clause = and_( - aliased_bundle_metadata.c.metadata_key == 'created', subclause + add_join( + aliased_bundle_metadata, + cl_bundle.c.uuid == aliased_bundle_metadata.c.bundle_uuid, ) + where_clause = and_(aliased_bundle_metadata.c.metadata_key == 'created', subclause) elif key == 'uuid_name': # Search uuid and name by default aliased_bundle_metadata = aliased(cl_bundle_metadata) - add_join(aliased_bundle_metadata, cl_bundle.c.uuid == aliased_bundle_metadata.c.bundle_uuid) + add_join( + aliased_bundle_metadata, + cl_bundle.c.uuid == aliased_bundle_metadata.c.bundle_uuid, + ) where_clause = [] where_clause.append(cl_bundle.c.uuid.like('%' + value + '%')) - where_clause.append(and_( - aliased_bundle_metadata.c.metadata_key == 'name', - aliased_bundle_metadata.c.metadata_value.like('%' + value + '%'),) - ) + where_clause.append( + and_( + aliased_bundle_metadata.c.metadata_key == 'name', + aliased_bundle_metadata.c.metadata_value.like('%' + value + '%'), + ) + ) where_clause = or_(*where_clause) elif key == '': # Match any field aliased_bundle_metadata = aliased(cl_bundle_metadata) - add_join(aliased_bundle_metadata, cl_bundle.c.uuid == aliased_bundle_metadata.c.bundle_uuid) + add_join( + aliased_bundle_metadata, + cl_bundle.c.uuid == aliased_bundle_metadata.c.bundle_uuid, + ) where_clause = [] where_clause.append(cl_bundle.c.uuid.like('%' + value + '%')) @@ -575,13 +597,13 @@ def add_join(join_table, join_condition): aliased_bundle_metadata.c.metadata_key == key, ) else: # embedded - add_join(aliased_bundle_metadata, cl_bundle.c.uuid == aliased_bundle_metadata.c.bundle_uuid) - - where_clause = and_( - aliased_bundle_metadata.c.metadata_key == key, - condition + add_join( + aliased_bundle_metadata, + cl_bundle.c.uuid == aliased_bundle_metadata.c.bundle_uuid, ) + where_clause = and_(aliased_bundle_metadata.c.metadata_key == key, condition) + if where_clause is not None: where_clauses.append(where_clause) @@ -589,7 +611,10 @@ def add_join(join_table, join_condition): if user_id != self.root_user_id: # Restrict to the bundles that we have access to. - add_join(cl_group_bundle_permission, cl_bundle.c.uuid == cl_group_bundle_permission.c.object_uuid) + add_join( + cl_group_bundle_permission, + cl_bundle.c.uuid == cl_group_bundle_permission.c.object_uuid, + ) access_via_owner = cl_bundle.c.owner_id == user_id access_via_group = and_( or_( # Join constraint (group) @@ -616,7 +641,10 @@ def add_join(join_table, join_condition): if sum_key[0] is not None: # Construct a table with only the uuid and the num (and make sure it's distinct!) query = alias( - select([cl_bundle.c.uuid, sum_key[0].label('num')]).select_from(table).distinct().where(where_clause) + select([cl_bundle.c.uuid, sum_key[0].label('num')]) + .select_from(table) + .distinct() + .where(where_clause) ) # Sum the numbers query = select([func.sum(query.c.num)]) diff --git a/pre-commit.sh b/pre-commit.sh index c07eecceb..121ba72bf 100755 --- a/pre-commit.sh +++ b/pre-commit.sh @@ -7,7 +7,7 @@ set -e if ! [ -e venv ]; then python3 -m pip install virtualenv - python3 -m virtualenv -p python3 venv + python3 -m virtualenv -p python3 venv fi venv/bin/pip install -r requirements-server.txt venv/bin/pip install -r requirements.docs.txt From a9510c1038b46222e3ba8fc54c3369b2e4c211c8 Mon Sep 17 00:00:00 2001 From: AndrewJGaut Date: Sat, 8 Oct 2022 14:01:53 -0700 Subject: [PATCH 11/20] Use just one list of tuples for inner joins, add type annotations, and clean up variable names --- codalab/model/bundle_model.py | 86 +- node_modules/.bin/acorn | 1 + node_modules/.bin/eslint | 1 + node_modules/.bin/js-yaml | 1 + node_modules/.bin/loose-envify | 1 + node_modules/.bin/node-which | 1 + node_modules/.bin/resolve | 1 + node_modules/.bin/rimraf | 1 + node_modules/.bin/semver | 1 + node_modules/.package-lock.json | 2163 ++ node_modules/@eslint/eslintrc/LICENSE | 19 + node_modules/@eslint/eslintrc/README.md | 68 + .../@eslint/eslintrc/conf/config-schema.js | 79 + .../@eslint/eslintrc/conf/environments.js | 203 + .../eslintrc/dist/eslintrc-universal.cjs | 1092 + .../eslintrc/dist/eslintrc-universal.cjs.map | 1 + .../@eslint/eslintrc/dist/eslintrc.cjs | 4310 ++++ .../@eslint/eslintrc/dist/eslintrc.cjs.map | 1 + .../lib/cascading-config-array-factory.js | 532 + .../eslintrc/lib/config-array-factory.js | 1149 + .../eslintrc/lib/config-array/config-array.js | 523 + .../lib/config-array/config-dependency.js | 115 + .../lib/config-array/extracted-config.js | 145 + .../lib/config-array/ignore-pattern.js | 238 + .../eslintrc/lib/config-array/index.js | 19 + .../lib/config-array/override-tester.js | 225 + .../@eslint/eslintrc/lib/flat-compat.js | 307 + .../@eslint/eslintrc/lib/index-universal.js | 29 + node_modules/@eslint/eslintrc/lib/index.js | 56 + .../@eslint/eslintrc/lib/shared/ajv.js | 191 + .../@eslint/eslintrc/lib/shared/config-ops.js | 135 + .../eslintrc/lib/shared/config-validator.js | 325 + .../lib/shared/deprecation-warnings.js | 63 + .../@eslint/eslintrc/lib/shared/naming.js | 96 + .../lib/shared/relative-module-resolver.js | 42 + .../@eslint/eslintrc/lib/shared/types.js | 149 + node_modules/@eslint/eslintrc/package.json | 82 + node_modules/@eslint/eslintrc/universal.js | 9 + .../@humanwhocodes/config-array/CHANGELOG.md | 128 + .../@humanwhocodes/config-array/LICENSE | 201 + .../@humanwhocodes/config-array/README.md | 310 + .../@humanwhocodes/config-array/api.js | 808 + .../@humanwhocodes/config-array/package.json | 60 + .../module-importer/CHANGELOG.md | 15 + .../@humanwhocodes/module-importer/LICENSE | 201 + .../@humanwhocodes/module-importer/README.md | 80 + .../module-importer/dist/module-importer.cjs | 22 + .../dist/module-importer.d.cts | 27 + .../module-importer/dist/module-importer.d.ts | 2 + .../module-importer/dist/module-importer.js | 18 + .../module-importer/package.json | 65 + .../module-importer/src/module-importer.cjs | 81 + .../module-importer/src/module-importer.js | 22 + .../@humanwhocodes/object-schema/.eslintrc.js | 29 + .../.github/workflows/nodejs-test.yml | 27 + .../.github/workflows/release-please.yml | 39 + .../@humanwhocodes/object-schema/CHANGELOG.md | 8 + .../@humanwhocodes/object-schema/LICENSE | 29 + .../@humanwhocodes/object-schema/README.md | 234 + .../@humanwhocodes/object-schema/package.json | 33 + .../@humanwhocodes/object-schema/src/index.js | 7 + .../object-schema/src/merge-strategy.js | 53 + .../object-schema/src/object-schema.js | 235 + .../object-schema/src/validation-strategy.js | 102 + .../object-schema/tests/merge-strategy.js | 66 + .../object-schema/tests/object-schema.js | 611 + .../tests/validation-strategy.js | 186 + node_modules/@nodelib/fs.scandir/LICENSE | 21 + node_modules/@nodelib/fs.scandir/README.md | 171 + .../@nodelib/fs.scandir/out/adapters/fs.d.ts | 20 + .../@nodelib/fs.scandir/out/adapters/fs.js | 19 + .../@nodelib/fs.scandir/out/constants.d.ts | 4 + .../@nodelib/fs.scandir/out/constants.js | 17 + .../@nodelib/fs.scandir/out/index.d.ts | 12 + node_modules/@nodelib/fs.scandir/out/index.js | 26 + .../fs.scandir/out/providers/async.d.ts | 7 + .../fs.scandir/out/providers/async.js | 104 + .../fs.scandir/out/providers/common.d.ts | 1 + .../fs.scandir/out/providers/common.js | 13 + .../fs.scandir/out/providers/sync.d.ts | 5 + .../@nodelib/fs.scandir/out/providers/sync.js | 54 + .../@nodelib/fs.scandir/out/settings.d.ts | 20 + .../@nodelib/fs.scandir/out/settings.js | 24 + .../@nodelib/fs.scandir/out/types/index.d.ts | 20 + .../@nodelib/fs.scandir/out/types/index.js | 2 + .../@nodelib/fs.scandir/out/utils/fs.d.ts | 2 + .../@nodelib/fs.scandir/out/utils/fs.js | 19 + .../@nodelib/fs.scandir/out/utils/index.d.ts | 2 + .../@nodelib/fs.scandir/out/utils/index.js | 5 + node_modules/@nodelib/fs.scandir/package.json | 44 + node_modules/@nodelib/fs.stat/LICENSE | 21 + node_modules/@nodelib/fs.stat/README.md | 126 + .../@nodelib/fs.stat/out/adapters/fs.d.ts | 13 + .../@nodelib/fs.stat/out/adapters/fs.js | 17 + node_modules/@nodelib/fs.stat/out/index.d.ts | 12 + node_modules/@nodelib/fs.stat/out/index.js | 26 + .../@nodelib/fs.stat/out/providers/async.d.ts | 4 + .../@nodelib/fs.stat/out/providers/async.js | 36 + .../@nodelib/fs.stat/out/providers/sync.d.ts | 3 + .../@nodelib/fs.stat/out/providers/sync.js | 23 + .../@nodelib/fs.stat/out/settings.d.ts | 16 + node_modules/@nodelib/fs.stat/out/settings.js | 16 + .../@nodelib/fs.stat/out/types/index.d.ts | 4 + .../@nodelib/fs.stat/out/types/index.js | 2 + node_modules/@nodelib/fs.stat/package.json | 37 + node_modules/@nodelib/fs.walk/LICENSE | 21 + node_modules/@nodelib/fs.walk/README.md | 215 + node_modules/@nodelib/fs.walk/out/index.d.ts | 14 + node_modules/@nodelib/fs.walk/out/index.js | 34 + .../@nodelib/fs.walk/out/providers/async.d.ts | 12 + .../@nodelib/fs.walk/out/providers/async.js | 30 + .../@nodelib/fs.walk/out/providers/index.d.ts | 4 + .../@nodelib/fs.walk/out/providers/index.js | 9 + .../fs.walk/out/providers/stream.d.ts | 12 + .../@nodelib/fs.walk/out/providers/stream.js | 34 + .../@nodelib/fs.walk/out/providers/sync.d.ts | 10 + .../@nodelib/fs.walk/out/providers/sync.js | 14 + .../@nodelib/fs.walk/out/readers/async.d.ts | 30 + .../@nodelib/fs.walk/out/readers/async.js | 97 + .../@nodelib/fs.walk/out/readers/common.d.ts | 7 + .../@nodelib/fs.walk/out/readers/common.js | 31 + .../@nodelib/fs.walk/out/readers/reader.d.ts | 6 + .../@nodelib/fs.walk/out/readers/reader.js | 11 + .../@nodelib/fs.walk/out/readers/sync.d.ts | 15 + .../@nodelib/fs.walk/out/readers/sync.js | 59 + .../@nodelib/fs.walk/out/settings.d.ts | 30 + node_modules/@nodelib/fs.walk/out/settings.js | 26 + .../@nodelib/fs.walk/out/types/index.d.ts | 8 + .../@nodelib/fs.walk/out/types/index.js | 2 + node_modules/@nodelib/fs.walk/package.json | 44 + node_modules/acorn-jsx/LICENSE | 19 + node_modules/acorn-jsx/README.md | 40 + node_modules/acorn-jsx/index.d.ts | 12 + node_modules/acorn-jsx/index.js | 488 + node_modules/acorn-jsx/package.json | 27 + node_modules/acorn-jsx/xhtml.js | 255 + node_modules/acorn/CHANGELOG.md | 810 + node_modules/acorn/LICENSE | 21 + node_modules/acorn/README.md | 273 + node_modules/acorn/bin/acorn | 4 + node_modules/acorn/dist/acorn.d.ts | 252 + node_modules/acorn/dist/acorn.js | 5605 +++++ node_modules/acorn/dist/acorn.mjs | 5574 +++++ node_modules/acorn/dist/acorn.mjs.d.ts | 2 + node_modules/acorn/dist/bin.js | 91 + node_modules/acorn/package.json | 50 + node_modules/ajv/.tonic_example.js | 20 + node_modules/ajv/LICENSE | 22 + node_modules/ajv/README.md | 1497 ++ node_modules/ajv/dist/ajv.bundle.js | 7189 ++++++ node_modules/ajv/dist/ajv.min.js | 3 + node_modules/ajv/dist/ajv.min.js.map | 1 + node_modules/ajv/lib/ajv.d.ts | 397 + node_modules/ajv/lib/ajv.js | 506 + node_modules/ajv/lib/cache.js | 26 + node_modules/ajv/lib/compile/async.js | 90 + node_modules/ajv/lib/compile/equal.js | 5 + node_modules/ajv/lib/compile/error_classes.js | 34 + node_modules/ajv/lib/compile/formats.js | 142 + node_modules/ajv/lib/compile/index.js | 387 + node_modules/ajv/lib/compile/resolve.js | 270 + node_modules/ajv/lib/compile/rules.js | 66 + node_modules/ajv/lib/compile/schema_obj.js | 9 + node_modules/ajv/lib/compile/ucs2length.js | 20 + node_modules/ajv/lib/compile/util.js | 239 + node_modules/ajv/lib/data.js | 49 + node_modules/ajv/lib/definition_schema.js | 37 + node_modules/ajv/lib/dot/_limit.jst | 113 + node_modules/ajv/lib/dot/_limitItems.jst | 12 + node_modules/ajv/lib/dot/_limitLength.jst | 12 + node_modules/ajv/lib/dot/_limitProperties.jst | 12 + node_modules/ajv/lib/dot/allOf.jst | 32 + node_modules/ajv/lib/dot/anyOf.jst | 46 + node_modules/ajv/lib/dot/coerce.def | 51 + node_modules/ajv/lib/dot/comment.jst | 9 + node_modules/ajv/lib/dot/const.jst | 11 + node_modules/ajv/lib/dot/contains.jst | 55 + node_modules/ajv/lib/dot/custom.jst | 191 + node_modules/ajv/lib/dot/defaults.def | 47 + node_modules/ajv/lib/dot/definitions.def | 203 + node_modules/ajv/lib/dot/dependencies.jst | 79 + node_modules/ajv/lib/dot/enum.jst | 30 + node_modules/ajv/lib/dot/errors.def | 194 + node_modules/ajv/lib/dot/format.jst | 106 + node_modules/ajv/lib/dot/if.jst | 73 + node_modules/ajv/lib/dot/items.jst | 98 + node_modules/ajv/lib/dot/missing.def | 39 + node_modules/ajv/lib/dot/multipleOf.jst | 22 + node_modules/ajv/lib/dot/not.jst | 43 + node_modules/ajv/lib/dot/oneOf.jst | 54 + node_modules/ajv/lib/dot/pattern.jst | 14 + node_modules/ajv/lib/dot/properties.jst | 245 + node_modules/ajv/lib/dot/propertyNames.jst | 52 + node_modules/ajv/lib/dot/ref.jst | 85 + node_modules/ajv/lib/dot/required.jst | 108 + node_modules/ajv/lib/dot/uniqueItems.jst | 62 + node_modules/ajv/lib/dot/validate.jst | 276 + node_modules/ajv/lib/dotjs/README.md | 3 + node_modules/ajv/lib/dotjs/_limit.js | 163 + node_modules/ajv/lib/dotjs/_limitItems.js | 80 + node_modules/ajv/lib/dotjs/_limitLength.js | 85 + .../ajv/lib/dotjs/_limitProperties.js | 80 + node_modules/ajv/lib/dotjs/allOf.js | 42 + node_modules/ajv/lib/dotjs/anyOf.js | 73 + node_modules/ajv/lib/dotjs/comment.js | 14 + node_modules/ajv/lib/dotjs/const.js | 56 + node_modules/ajv/lib/dotjs/contains.js | 81 + node_modules/ajv/lib/dotjs/custom.js | 228 + node_modules/ajv/lib/dotjs/dependencies.js | 168 + node_modules/ajv/lib/dotjs/enum.js | 66 + node_modules/ajv/lib/dotjs/format.js | 150 + node_modules/ajv/lib/dotjs/if.js | 103 + node_modules/ajv/lib/dotjs/index.js | 33 + node_modules/ajv/lib/dotjs/items.js | 140 + node_modules/ajv/lib/dotjs/multipleOf.js | 80 + node_modules/ajv/lib/dotjs/not.js | 84 + node_modules/ajv/lib/dotjs/oneOf.js | 73 + node_modules/ajv/lib/dotjs/pattern.js | 75 + node_modules/ajv/lib/dotjs/properties.js | 335 + node_modules/ajv/lib/dotjs/propertyNames.js | 81 + node_modules/ajv/lib/dotjs/ref.js | 124 + node_modules/ajv/lib/dotjs/required.js | 270 + node_modules/ajv/lib/dotjs/uniqueItems.js | 86 + node_modules/ajv/lib/dotjs/validate.js | 482 + node_modules/ajv/lib/keyword.js | 146 + node_modules/ajv/lib/refs/data.json | 17 + .../ajv/lib/refs/json-schema-draft-04.json | 149 + .../ajv/lib/refs/json-schema-draft-06.json | 154 + .../ajv/lib/refs/json-schema-draft-07.json | 168 + .../ajv/lib/refs/json-schema-secure.json | 94 + node_modules/ajv/package.json | 106 + node_modules/ajv/scripts/.eslintrc.yml | 3 + node_modules/ajv/scripts/bundle.js | 61 + node_modules/ajv/scripts/compile-dots.js | 73 + node_modules/ajv/scripts/info | 10 + node_modules/ajv/scripts/prepare-tests | 12 + .../ajv/scripts/publish-built-version | 32 + node_modules/ajv/scripts/travis-gh-pages | 23 + node_modules/ansi-regex/index.d.ts | 37 + node_modules/ansi-regex/index.js | 10 + node_modules/ansi-regex/license | 9 + node_modules/ansi-regex/package.json | 55 + node_modules/ansi-regex/readme.md | 78 + node_modules/ansi-styles/index.d.ts | 345 + node_modules/ansi-styles/index.js | 163 + node_modules/ansi-styles/license | 9 + node_modules/ansi-styles/package.json | 56 + node_modules/ansi-styles/readme.md | 152 + node_modules/argparse/CHANGELOG.md | 216 + node_modules/argparse/LICENSE | 254 + node_modules/argparse/README.md | 84 + node_modules/argparse/argparse.js | 3707 ++++ node_modules/argparse/lib/sub.js | 67 + node_modules/argparse/lib/textwrap.js | 440 + node_modules/argparse/package.json | 31 + node_modules/array-includes/.editorconfig | 13 + node_modules/array-includes/.eslintrc | 29 + .../array-includes/.github/FUNDING.yml | 12 + node_modules/array-includes/.nycrc | 9 + node_modules/array-includes/CHANGELOG.md | 140 + node_modules/array-includes/LICENSE | 21 + node_modules/array-includes/README.md | 105 + node_modules/array-includes/auto.js | 3 + node_modules/array-includes/implementation.js | 36 + node_modules/array-includes/index.js | 27 + node_modules/array-includes/package.json | 95 + node_modules/array-includes/polyfill.js | 13 + node_modules/array-includes/shim.js | 14 + .../array-includes/test/implementation.js | 20 + node_modules/array-includes/test/index.js | 17 + node_modules/array-includes/test/shimmed.js | 36 + node_modules/array-includes/test/tests.js | 94 + node_modules/array-union/index.d.ts | 25 + node_modules/array-union/index.js | 5 + node_modules/array-union/license | 9 + node_modules/array-union/package.json | 38 + node_modules/array-union/readme.md | 34 + .../array.prototype.flatmap/.editorconfig | 20 + .../array.prototype.flatmap/.eslintrc | 34 + .../.github/FUNDING.yml | 12 + node_modules/array.prototype.flatmap/.nycrc | 9 + .../array.prototype.flatmap/CHANGELOG.md | 82 + node_modules/array.prototype.flatmap/LICENSE | 21 + .../array.prototype.flatmap/README.md | 82 + node_modules/array.prototype.flatmap/auto.js | 3 + .../array.prototype.flatmap/implementation.js | 26 + node_modules/array.prototype.flatmap/index.js | 19 + .../array.prototype.flatmap/package.json | 98 + .../array.prototype.flatmap/polyfill.js | 7 + node_modules/array.prototype.flatmap/shim.js | 20 + .../test/implementation.js | 20 + .../array.prototype.flatmap/test/index.js | 17 + .../array.prototype.flatmap/test/shimmed.js | 36 + .../array.prototype.flatmap/test/tests.js | 43 + .../balanced-match/.github/FUNDING.yml | 2 + node_modules/balanced-match/LICENSE.md | 21 + node_modules/balanced-match/README.md | 97 + node_modules/balanced-match/index.js | 62 + node_modules/balanced-match/package.json | 48 + node_modules/brace-expansion/LICENSE | 21 + node_modules/brace-expansion/README.md | 129 + node_modules/brace-expansion/index.js | 201 + node_modules/brace-expansion/package.json | 47 + node_modules/braces/CHANGELOG.md | 184 + node_modules/braces/LICENSE | 21 + node_modules/braces/README.md | 593 + node_modules/braces/index.js | 170 + node_modules/braces/lib/compile.js | 57 + node_modules/braces/lib/constants.js | 57 + node_modules/braces/lib/expand.js | 113 + node_modules/braces/lib/parse.js | 333 + node_modules/braces/lib/stringify.js | 32 + node_modules/braces/lib/utils.js | 112 + node_modules/braces/package.json | 77 + node_modules/call-bind/.eslintignore | 1 + node_modules/call-bind/.eslintrc | 17 + node_modules/call-bind/.github/FUNDING.yml | 12 + node_modules/call-bind/.nycrc | 13 + node_modules/call-bind/CHANGELOG.md | 42 + node_modules/call-bind/LICENSE | 21 + node_modules/call-bind/README.md | 2 + node_modules/call-bind/callBound.js | 15 + node_modules/call-bind/index.js | 47 + node_modules/call-bind/package.json | 80 + node_modules/call-bind/test/callBound.js | 55 + node_modules/call-bind/test/index.js | 66 + node_modules/callsites/index.d.ts | 96 + node_modules/callsites/index.js | 13 + node_modules/callsites/license | 9 + node_modules/callsites/package.json | 39 + node_modules/callsites/readme.md | 48 + node_modules/chalk/index.d.ts | 415 + node_modules/chalk/license | 9 + node_modules/chalk/package.json | 68 + node_modules/chalk/readme.md | 341 + node_modules/chalk/source/index.js | 229 + node_modules/chalk/source/templates.js | 134 + node_modules/chalk/source/util.js | 39 + node_modules/color-convert/CHANGELOG.md | 54 + node_modules/color-convert/LICENSE | 21 + node_modules/color-convert/README.md | 68 + node_modules/color-convert/conversions.js | 839 + node_modules/color-convert/index.js | 81 + node_modules/color-convert/package.json | 48 + node_modules/color-convert/route.js | 97 + node_modules/color-name/LICENSE | 8 + node_modules/color-name/README.md | 11 + node_modules/color-name/index.js | 152 + node_modules/color-name/package.json | 28 + node_modules/concat-map/.travis.yml | 4 + node_modules/concat-map/LICENSE | 18 + node_modules/concat-map/README.markdown | 62 + node_modules/concat-map/example/map.js | 6 + node_modules/concat-map/index.js | 13 + node_modules/concat-map/package.json | 43 + node_modules/concat-map/test/map.js | 39 + node_modules/cross-spawn/CHANGELOG.md | 130 + node_modules/cross-spawn/LICENSE | 21 + node_modules/cross-spawn/README.md | 96 + node_modules/cross-spawn/index.js | 39 + node_modules/cross-spawn/lib/enoent.js | 59 + node_modules/cross-spawn/lib/parse.js | 91 + node_modules/cross-spawn/lib/util/escape.js | 45 + .../cross-spawn/lib/util/readShebang.js | 23 + .../cross-spawn/lib/util/resolveCommand.js | 52 + node_modules/cross-spawn/package.json | 73 + node_modules/debug/LICENSE | 20 + node_modules/debug/README.md | 481 + node_modules/debug/package.json | 59 + node_modules/debug/src/browser.js | 269 + node_modules/debug/src/common.js | 274 + node_modules/debug/src/index.js | 10 + node_modules/debug/src/node.js | 263 + node_modules/deep-is/.travis.yml | 5 + node_modules/deep-is/LICENSE | 22 + node_modules/deep-is/README.markdown | 70 + node_modules/deep-is/example/cmp.js | 11 + node_modules/deep-is/index.js | 102 + node_modules/deep-is/package.json | 58 + node_modules/deep-is/test/NaN.js | 16 + node_modules/deep-is/test/cmp.js | 23 + node_modules/deep-is/test/neg-vs-pos-0.js | 15 + node_modules/define-properties/.editorconfig | 13 + node_modules/define-properties/.eslintrc | 19 + .../define-properties/.github/FUNDING.yml | 12 + node_modules/define-properties/.nycrc | 9 + node_modules/define-properties/CHANGELOG.md | 63 + node_modules/define-properties/LICENSE | 21 + node_modules/define-properties/README.md | 84 + node_modules/define-properties/index.js | 47 + node_modules/define-properties/package.json | 66 + node_modules/dir-glob/index.js | 75 + node_modules/dir-glob/license | 9 + node_modules/dir-glob/package.json | 38 + node_modules/dir-glob/readme.md | 76 + node_modules/doctrine/CHANGELOG.md | 101 + node_modules/doctrine/LICENSE | 177 + .../doctrine/LICENSE.closure-compiler | 202 + node_modules/doctrine/LICENSE.esprima | 19 + node_modules/doctrine/README.md | 165 + node_modules/doctrine/lib/doctrine.js | 898 + node_modules/doctrine/lib/typed.js | 1305 ++ node_modules/doctrine/lib/utility.js | 35 + node_modules/doctrine/package.json | 58 + node_modules/es-abstract/.editorconfig | 15 + node_modules/es-abstract/.eslintrc | 67 + node_modules/es-abstract/.nycrc | 10 + .../2015/AbstractEqualityComparison.js | 37 + .../2015/AbstractRelationalComparison.js | 63 + .../es-abstract/2015/AdvanceStringIndex.js | 47 + node_modules/es-abstract/2015/ArrayCreate.js | 53 + .../es-abstract/2015/ArraySetLength.js | 85 + .../es-abstract/2015/ArraySpeciesCreate.js | 46 + node_modules/es-abstract/2015/Call.js | 20 + .../2015/CanonicalNumericIndexString.js | 22 + .../es-abstract/2015/CharacterRange.js | 31 + .../2015/CompletePropertyDescriptor.js | 39 + .../es-abstract/2015/CreateDataProperty.js | 45 + .../2015/CreateDataPropertyOrThrow.js | 25 + node_modules/es-abstract/2015/CreateHTML.js | 30 + .../2015/CreateIterResultObject.js | 19 + .../2015/CreateListFromArrayLike.js | 43 + .../es-abstract/2015/CreateMethodProperty.js | 40 + node_modules/es-abstract/2015/DateFromTime.js | 54 + node_modules/es-abstract/2015/Day.js | 11 + node_modules/es-abstract/2015/DayFromYear.js | 10 + .../es-abstract/2015/DayWithinYear.js | 11 + node_modules/es-abstract/2015/DaysInYear.js | 18 + .../es-abstract/2015/DefinePropertyOrThrow.js | 50 + .../es-abstract/2015/DeletePropertyOrThrow.js | 27 + .../es-abstract/2015/EnumerableOwnNames.js | 19 + .../2015/FromPropertyDescriptor.js | 16 + node_modules/es-abstract/2015/Get.js | 25 + node_modules/es-abstract/2015/GetIterator.js | 34 + node_modules/es-abstract/2015/GetMethod.js | 34 + .../es-abstract/2015/GetOwnPropertyKeys.js | 31 + .../2015/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2015/GetSubstitution.js | 104 + node_modules/es-abstract/2015/GetV.js | 23 + .../es-abstract/2015/HasOwnProperty.js | 22 + node_modules/es-abstract/2015/HasProperty.js | 20 + node_modules/es-abstract/2015/HourFromTime.js | 14 + node_modules/es-abstract/2015/InLeapYear.js | 21 + .../es-abstract/2015/InstanceofOperator.js | 30 + node_modules/es-abstract/2015/Invoke.js | 24 + .../es-abstract/2015/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/2015/IsArray.js | 4 + node_modules/es-abstract/2015/IsCallable.js | 5 + .../2015/IsCompatiblePropertyDescriptor.js | 9 + .../es-abstract/2015/IsConcatSpreadable.js | 25 + .../es-abstract/2015/IsConstructor.js | 40 + .../es-abstract/2015/IsDataDescriptor.js | 23 + node_modules/es-abstract/2015/IsExtensible.js | 18 + .../es-abstract/2015/IsGenericDescriptor.js | 23 + node_modules/es-abstract/2015/IsInteger.js | 17 + node_modules/es-abstract/2015/IsPromise.js | 24 + .../es-abstract/2015/IsPropertyDescriptor.js | 19 + .../es-abstract/2015/IsPropertyKey.js | 7 + node_modules/es-abstract/2015/IsRegExp.js | 24 + .../es-abstract/2015/IteratorClose.js | 50 + .../es-abstract/2015/IteratorComplete.js | 18 + node_modules/es-abstract/2015/IteratorNext.js | 18 + node_modules/es-abstract/2015/IteratorStep.js | 13 + .../es-abstract/2015/IteratorValue.js | 18 + node_modules/es-abstract/2015/MakeDate.js | 13 + node_modules/es-abstract/2015/MakeDay.js | 33 + node_modules/es-abstract/2015/MakeTime.js | 23 + node_modules/es-abstract/2015/MinFromTime.js | 14 + .../es-abstract/2015/MonthFromTime.js | 47 + node_modules/es-abstract/2015/ObjectCreate.js | 37 + .../2015/ObjectDefineProperties.js | 40 + .../2015/OrdinaryCreateFromConstructor.js | 20 + .../2015/OrdinaryDefineOwnProperty.js | 61 + .../2015/OrdinaryGetOwnProperty.js | 44 + .../es-abstract/2015/OrdinaryHasInstance.js | 25 + .../es-abstract/2015/OrdinaryHasProperty.js | 20 + .../es-abstract/2015/QuoteJSONString.js | 52 + node_modules/es-abstract/2015/RegExpCreate.js | 21 + node_modules/es-abstract/2015/RegExpExec.js | 32 + .../2015/RequireObjectCoercible.js | 3 + node_modules/es-abstract/2015/SameValue.js | 13 + .../es-abstract/2015/SameValueZero.js | 9 + node_modules/es-abstract/2015/SecFromTime.js | 14 + node_modules/es-abstract/2015/Set.js | 47 + .../es-abstract/2015/SetFunctionName.js | 44 + .../es-abstract/2015/SetIntegrityLevel.js | 57 + .../es-abstract/2015/SpeciesConstructor.js | 32 + node_modules/es-abstract/2015/SplitMatch.js | 38 + .../2015/StrictEqualityComparison.js | 17 + node_modules/es-abstract/2015/StringCreate.js | 40 + .../2015/StringGetIndexProperty.js | 52 + .../2015/SymbolDescriptiveString.js | 20 + .../es-abstract/2015/TestIntegrityLevel.js | 42 + node_modules/es-abstract/2015/TimeClip.js | 21 + node_modules/es-abstract/2015/TimeFromYear.js | 11 + .../es-abstract/2015/TimeWithinDay.js | 12 + node_modules/es-abstract/2015/ToBoolean.js | 5 + node_modules/es-abstract/2015/ToDateString.js | 22 + node_modules/es-abstract/2015/ToInt16.js | 10 + node_modules/es-abstract/2015/ToInt32.js | 9 + node_modules/es-abstract/2015/ToInt8.js | 10 + node_modules/es-abstract/2015/ToInteger.js | 12 + node_modules/es-abstract/2015/ToLength.js | 12 + node_modules/es-abstract/2015/ToNumber.js | 59 + node_modules/es-abstract/2015/ToObject.js | 14 + node_modules/es-abstract/2015/ToPrimitive.js | 12 + .../es-abstract/2015/ToPropertyDescriptor.js | 52 + .../es-abstract/2015/ToPropertyKey.js | 15 + node_modules/es-abstract/2015/ToString.js | 15 + node_modules/es-abstract/2015/ToUint16.js | 19 + node_modules/es-abstract/2015/ToUint32.js | 9 + node_modules/es-abstract/2015/ToUint8.js | 20 + node_modules/es-abstract/2015/ToUint8Clamp.js | 19 + node_modules/es-abstract/2015/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + node_modules/es-abstract/2015/WeekDay.js | 10 + node_modules/es-abstract/2015/YearFromTime.js | 16 + node_modules/es-abstract/2015/abs.js | 11 + node_modules/es-abstract/2015/floor.js | 11 + node_modules/es-abstract/2015/modulo.js | 9 + node_modules/es-abstract/2015/msFromTime.js | 11 + .../es-abstract/2015/thisBooleanValue.js | 15 + .../es-abstract/2015/thisNumberValue.js | 18 + .../es-abstract/2015/thisStringValue.js | 15 + .../es-abstract/2015/thisTimeValue.js | 9 + .../2016/AbstractEqualityComparison.js | 37 + .../2016/AbstractRelationalComparison.js | 63 + .../es-abstract/2016/AdvanceStringIndex.js | 47 + node_modules/es-abstract/2016/ArrayCreate.js | 53 + .../es-abstract/2016/ArraySetLength.js | 85 + .../es-abstract/2016/ArraySpeciesCreate.js | 46 + node_modules/es-abstract/2016/Call.js | 20 + .../2016/CanonicalNumericIndexString.js | 22 + .../es-abstract/2016/CharacterRange.js | 31 + .../2016/CompletePropertyDescriptor.js | 39 + .../es-abstract/2016/CreateDataProperty.js | 45 + .../2016/CreateDataPropertyOrThrow.js | 25 + node_modules/es-abstract/2016/CreateHTML.js | 30 + .../2016/CreateIterResultObject.js | 19 + .../2016/CreateListFromArrayLike.js | 43 + .../es-abstract/2016/CreateMethodProperty.js | 40 + node_modules/es-abstract/2016/DateFromTime.js | 54 + node_modules/es-abstract/2016/Day.js | 11 + node_modules/es-abstract/2016/DayFromYear.js | 10 + .../es-abstract/2016/DayWithinYear.js | 11 + node_modules/es-abstract/2016/DaysInYear.js | 18 + .../es-abstract/2016/DefinePropertyOrThrow.js | 50 + .../es-abstract/2016/DeletePropertyOrThrow.js | 27 + .../es-abstract/2016/EnumerableOwnNames.js | 19 + .../2016/FromPropertyDescriptor.js | 16 + node_modules/es-abstract/2016/Get.js | 25 + node_modules/es-abstract/2016/GetIterator.js | 34 + node_modules/es-abstract/2016/GetMethod.js | 34 + .../es-abstract/2016/GetOwnPropertyKeys.js | 31 + .../2016/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2016/GetSubstitution.js | 104 + node_modules/es-abstract/2016/GetV.js | 23 + .../es-abstract/2016/HasOwnProperty.js | 22 + node_modules/es-abstract/2016/HasProperty.js | 20 + node_modules/es-abstract/2016/HourFromTime.js | 14 + node_modules/es-abstract/2016/InLeapYear.js | 21 + .../es-abstract/2016/InstanceofOperator.js | 30 + node_modules/es-abstract/2016/Invoke.js | 24 + .../es-abstract/2016/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/2016/IsArray.js | 4 + node_modules/es-abstract/2016/IsCallable.js | 5 + .../2016/IsCompatiblePropertyDescriptor.js | 9 + .../es-abstract/2016/IsConcatSpreadable.js | 25 + .../es-abstract/2016/IsConstructor.js | 40 + .../es-abstract/2016/IsDataDescriptor.js | 23 + node_modules/es-abstract/2016/IsExtensible.js | 18 + .../es-abstract/2016/IsGenericDescriptor.js | 23 + node_modules/es-abstract/2016/IsInteger.js | 17 + node_modules/es-abstract/2016/IsPromise.js | 24 + .../es-abstract/2016/IsPropertyDescriptor.js | 19 + .../es-abstract/2016/IsPropertyKey.js | 7 + node_modules/es-abstract/2016/IsRegExp.js | 24 + .../es-abstract/2016/IterableToArrayLike.js | 39 + .../es-abstract/2016/IteratorClose.js | 50 + .../es-abstract/2016/IteratorComplete.js | 18 + node_modules/es-abstract/2016/IteratorNext.js | 18 + node_modules/es-abstract/2016/IteratorStep.js | 13 + .../es-abstract/2016/IteratorValue.js | 18 + node_modules/es-abstract/2016/MakeDate.js | 13 + node_modules/es-abstract/2016/MakeDay.js | 33 + node_modules/es-abstract/2016/MakeTime.js | 23 + node_modules/es-abstract/2016/MinFromTime.js | 14 + .../es-abstract/2016/MonthFromTime.js | 47 + node_modules/es-abstract/2016/ObjectCreate.js | 37 + .../2016/ObjectDefineProperties.js | 40 + .../2016/OrdinaryCreateFromConstructor.js | 20 + .../2016/OrdinaryDefineOwnProperty.js | 61 + .../2016/OrdinaryGetOwnProperty.js | 44 + .../2016/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2016/OrdinaryHasInstance.js | 25 + .../es-abstract/2016/OrdinaryHasProperty.js | 20 + .../2016/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2016/QuoteJSONString.js | 52 + node_modules/es-abstract/2016/RegExpCreate.js | 21 + node_modules/es-abstract/2016/RegExpExec.js | 32 + .../2016/RequireObjectCoercible.js | 3 + node_modules/es-abstract/2016/SameValue.js | 13 + .../es-abstract/2016/SameValueNonNumber.js | 16 + .../es-abstract/2016/SameValueZero.js | 9 + node_modules/es-abstract/2016/SecFromTime.js | 14 + node_modules/es-abstract/2016/Set.js | 47 + .../es-abstract/2016/SetFunctionName.js | 44 + .../es-abstract/2016/SetIntegrityLevel.js | 57 + .../es-abstract/2016/SpeciesConstructor.js | 32 + node_modules/es-abstract/2016/SplitMatch.js | 38 + .../2016/StrictEqualityComparison.js | 17 + node_modules/es-abstract/2016/StringCreate.js | 40 + .../2016/SymbolDescriptiveString.js | 20 + .../es-abstract/2016/TestIntegrityLevel.js | 42 + node_modules/es-abstract/2016/TimeClip.js | 21 + node_modules/es-abstract/2016/TimeFromYear.js | 11 + .../es-abstract/2016/TimeWithinDay.js | 12 + node_modules/es-abstract/2016/ToBoolean.js | 5 + node_modules/es-abstract/2016/ToDateString.js | 22 + node_modules/es-abstract/2016/ToInt16.js | 10 + node_modules/es-abstract/2016/ToInt32.js | 9 + node_modules/es-abstract/2016/ToInt8.js | 10 + node_modules/es-abstract/2016/ToInteger.js | 12 + node_modules/es-abstract/2016/ToLength.js | 12 + node_modules/es-abstract/2016/ToNumber.js | 59 + node_modules/es-abstract/2016/ToObject.js | 14 + node_modules/es-abstract/2016/ToPrimitive.js | 12 + .../es-abstract/2016/ToPropertyDescriptor.js | 52 + .../es-abstract/2016/ToPropertyKey.js | 15 + node_modules/es-abstract/2016/ToString.js | 15 + node_modules/es-abstract/2016/ToUint16.js | 19 + node_modules/es-abstract/2016/ToUint32.js | 9 + node_modules/es-abstract/2016/ToUint8.js | 20 + node_modules/es-abstract/2016/ToUint8Clamp.js | 19 + node_modules/es-abstract/2016/Type.js | 12 + node_modules/es-abstract/2016/UTF16Decode.js | 21 + .../es-abstract/2016/UTF16Encoding.js | 25 + .../ValidateAndApplyPropertyDescriptor.js | 170 + node_modules/es-abstract/2016/WeekDay.js | 10 + node_modules/es-abstract/2016/YearFromTime.js | 16 + node_modules/es-abstract/2016/abs.js | 11 + node_modules/es-abstract/2016/floor.js | 11 + node_modules/es-abstract/2016/modulo.js | 9 + node_modules/es-abstract/2016/msFromTime.js | 11 + .../es-abstract/2016/thisBooleanValue.js | 15 + .../es-abstract/2016/thisNumberValue.js | 18 + .../es-abstract/2016/thisStringValue.js | 15 + .../es-abstract/2016/thisTimeValue.js | 9 + .../2017/AbstractEqualityComparison.js | 37 + .../2017/AbstractRelationalComparison.js | 63 + .../es-abstract/2017/AdvanceStringIndex.js | 47 + node_modules/es-abstract/2017/ArrayCreate.js | 53 + .../es-abstract/2017/ArraySetLength.js | 85 + .../es-abstract/2017/ArraySpeciesCreate.js | 46 + node_modules/es-abstract/2017/Call.js | 20 + .../2017/CanonicalNumericIndexString.js | 22 + .../es-abstract/2017/CharacterRange.js | 31 + .../2017/CompletePropertyDescriptor.js | 39 + .../es-abstract/2017/CreateDataProperty.js | 45 + .../2017/CreateDataPropertyOrThrow.js | 25 + node_modules/es-abstract/2017/CreateHTML.js | 30 + .../2017/CreateIterResultObject.js | 19 + .../2017/CreateListFromArrayLike.js | 43 + .../es-abstract/2017/CreateMethodProperty.js | 40 + node_modules/es-abstract/2017/DateFromTime.js | 54 + node_modules/es-abstract/2017/Day.js | 11 + node_modules/es-abstract/2017/DayFromYear.js | 10 + .../es-abstract/2017/DayWithinYear.js | 11 + node_modules/es-abstract/2017/DaysInYear.js | 18 + .../es-abstract/2017/DefinePropertyOrThrow.js | 50 + .../es-abstract/2017/DeletePropertyOrThrow.js | 27 + .../2017/EnumerableOwnProperties.js | 43 + .../2017/FromPropertyDescriptor.js | 16 + node_modules/es-abstract/2017/Get.js | 25 + node_modules/es-abstract/2017/GetIterator.js | 34 + node_modules/es-abstract/2017/GetMethod.js | 34 + .../es-abstract/2017/GetOwnPropertyKeys.js | 31 + .../2017/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2017/GetSubstitution.js | 104 + node_modules/es-abstract/2017/GetV.js | 23 + .../es-abstract/2017/HasOwnProperty.js | 22 + node_modules/es-abstract/2017/HasProperty.js | 20 + node_modules/es-abstract/2017/HourFromTime.js | 14 + node_modules/es-abstract/2017/InLeapYear.js | 21 + .../es-abstract/2017/InstanceofOperator.js | 30 + node_modules/es-abstract/2017/Invoke.js | 24 + .../es-abstract/2017/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/2017/IsArray.js | 4 + node_modules/es-abstract/2017/IsCallable.js | 5 + .../2017/IsCompatiblePropertyDescriptor.js | 9 + .../es-abstract/2017/IsConcatSpreadable.js | 25 + .../es-abstract/2017/IsConstructor.js | 40 + .../es-abstract/2017/IsDataDescriptor.js | 23 + node_modules/es-abstract/2017/IsExtensible.js | 18 + .../es-abstract/2017/IsGenericDescriptor.js | 23 + node_modules/es-abstract/2017/IsInteger.js | 17 + node_modules/es-abstract/2017/IsPromise.js | 24 + .../es-abstract/2017/IsPropertyDescriptor.js | 19 + .../es-abstract/2017/IsPropertyKey.js | 7 + node_modules/es-abstract/2017/IsRegExp.js | 24 + .../es-abstract/2017/IsSharedArrayBuffer.js | 19 + .../es-abstract/2017/IterableToList.js | 24 + .../es-abstract/2017/IteratorClose.js | 50 + .../es-abstract/2017/IteratorComplete.js | 18 + node_modules/es-abstract/2017/IteratorNext.js | 18 + node_modules/es-abstract/2017/IteratorStep.js | 13 + .../es-abstract/2017/IteratorValue.js | 18 + node_modules/es-abstract/2017/MakeDate.js | 13 + node_modules/es-abstract/2017/MakeDay.js | 33 + node_modules/es-abstract/2017/MakeTime.js | 23 + node_modules/es-abstract/2017/MinFromTime.js | 14 + .../es-abstract/2017/MonthFromTime.js | 47 + node_modules/es-abstract/2017/ObjectCreate.js | 37 + .../2017/ObjectDefineProperties.js | 40 + .../2017/OrdinaryCreateFromConstructor.js | 20 + .../2017/OrdinaryDefineOwnProperty.js | 61 + .../2017/OrdinaryGetOwnProperty.js | 44 + .../2017/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2017/OrdinaryHasInstance.js | 25 + .../es-abstract/2017/OrdinaryHasProperty.js | 20 + .../2017/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2017/OrdinaryToPrimitive.js | 38 + .../es-abstract/2017/QuoteJSONString.js | 52 + node_modules/es-abstract/2017/RegExpCreate.js | 21 + node_modules/es-abstract/2017/RegExpExec.js | 32 + .../2017/RequireObjectCoercible.js | 3 + node_modules/es-abstract/2017/SameValue.js | 13 + .../es-abstract/2017/SameValueNonNumber.js | 16 + .../es-abstract/2017/SameValueZero.js | 9 + node_modules/es-abstract/2017/SecFromTime.js | 14 + node_modules/es-abstract/2017/Set.js | 47 + .../es-abstract/2017/SetFunctionName.js | 44 + .../es-abstract/2017/SetIntegrityLevel.js | 57 + .../es-abstract/2017/SpeciesConstructor.js | 32 + node_modules/es-abstract/2017/SplitMatch.js | 38 + .../2017/StrictEqualityComparison.js | 17 + node_modules/es-abstract/2017/StringCreate.js | 40 + .../es-abstract/2017/StringGetOwnProperty.js | 48 + .../2017/SymbolDescriptiveString.js | 20 + .../es-abstract/2017/TestIntegrityLevel.js | 42 + node_modules/es-abstract/2017/TimeClip.js | 21 + node_modules/es-abstract/2017/TimeFromYear.js | 11 + .../es-abstract/2017/TimeWithinDay.js | 12 + node_modules/es-abstract/2017/ToBoolean.js | 5 + node_modules/es-abstract/2017/ToDateString.js | 22 + node_modules/es-abstract/2017/ToIndex.js | 26 + node_modules/es-abstract/2017/ToInt16.js | 10 + node_modules/es-abstract/2017/ToInt32.js | 9 + node_modules/es-abstract/2017/ToInt8.js | 10 + node_modules/es-abstract/2017/ToInteger.js | 12 + node_modules/es-abstract/2017/ToLength.js | 12 + node_modules/es-abstract/2017/ToNumber.js | 59 + node_modules/es-abstract/2017/ToObject.js | 14 + node_modules/es-abstract/2017/ToPrimitive.js | 12 + .../es-abstract/2017/ToPropertyDescriptor.js | 52 + .../es-abstract/2017/ToPropertyKey.js | 15 + node_modules/es-abstract/2017/ToString.js | 15 + node_modules/es-abstract/2017/ToUint16.js | 19 + node_modules/es-abstract/2017/ToUint32.js | 9 + node_modules/es-abstract/2017/ToUint8.js | 20 + node_modules/es-abstract/2017/ToUint8Clamp.js | 19 + node_modules/es-abstract/2017/Type.js | 12 + node_modules/es-abstract/2017/UTF16Decode.js | 21 + .../es-abstract/2017/UTF16Encoding.js | 25 + .../ValidateAndApplyPropertyDescriptor.js | 170 + node_modules/es-abstract/2017/WeekDay.js | 10 + node_modules/es-abstract/2017/YearFromTime.js | 16 + node_modules/es-abstract/2017/abs.js | 11 + node_modules/es-abstract/2017/floor.js | 11 + node_modules/es-abstract/2017/modulo.js | 9 + node_modules/es-abstract/2017/msFromTime.js | 11 + .../es-abstract/2017/thisBooleanValue.js | 15 + .../es-abstract/2017/thisNumberValue.js | 18 + .../es-abstract/2017/thisStringValue.js | 15 + .../es-abstract/2017/thisTimeValue.js | 9 + .../2018/AbstractEqualityComparison.js | 37 + .../2018/AbstractRelationalComparison.js | 61 + .../es-abstract/2018/AdvanceStringIndex.js | 47 + node_modules/es-abstract/2018/ArrayCreate.js | 53 + .../es-abstract/2018/ArraySetLength.js | 85 + .../es-abstract/2018/ArraySpeciesCreate.js | 46 + node_modules/es-abstract/2018/Call.js | 20 + .../2018/CanonicalNumericIndexString.js | 22 + .../es-abstract/2018/CharacterRange.js | 31 + .../2018/CompletePropertyDescriptor.js | 39 + .../es-abstract/2018/CopyDataProperties.js | 68 + .../es-abstract/2018/CreateDataProperty.js | 45 + .../2018/CreateDataPropertyOrThrow.js | 25 + node_modules/es-abstract/2018/CreateHTML.js | 30 + .../2018/CreateIterResultObject.js | 19 + .../2018/CreateListFromArrayLike.js | 43 + .../es-abstract/2018/CreateMethodProperty.js | 40 + node_modules/es-abstract/2018/DateFromTime.js | 54 + node_modules/es-abstract/2018/DateString.js | 30 + node_modules/es-abstract/2018/Day.js | 11 + node_modules/es-abstract/2018/DayFromYear.js | 10 + .../es-abstract/2018/DayWithinYear.js | 11 + node_modules/es-abstract/2018/DaysInYear.js | 18 + .../es-abstract/2018/DefinePropertyOrThrow.js | 50 + .../es-abstract/2018/DeletePropertyOrThrow.js | 27 + .../2018/EnumerableOwnPropertyNames.js | 43 + .../2018/FromPropertyDescriptor.js | 16 + node_modules/es-abstract/2018/Get.js | 25 + node_modules/es-abstract/2018/GetIterator.js | 34 + node_modules/es-abstract/2018/GetMethod.js | 34 + .../es-abstract/2018/GetOwnPropertyKeys.js | 31 + .../2018/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2018/GetSubstitution.js | 128 + node_modules/es-abstract/2018/GetV.js | 23 + .../es-abstract/2018/HasOwnProperty.js | 22 + node_modules/es-abstract/2018/HasProperty.js | 20 + node_modules/es-abstract/2018/HourFromTime.js | 14 + node_modules/es-abstract/2018/InLeapYear.js | 21 + .../es-abstract/2018/InstanceofOperator.js | 30 + node_modules/es-abstract/2018/Invoke.js | 24 + .../es-abstract/2018/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/2018/IsArray.js | 4 + node_modules/es-abstract/2018/IsCallable.js | 5 + .../2018/IsCompatiblePropertyDescriptor.js | 9 + .../es-abstract/2018/IsConcatSpreadable.js | 25 + .../es-abstract/2018/IsConstructor.js | 40 + .../es-abstract/2018/IsDataDescriptor.js | 23 + node_modules/es-abstract/2018/IsExtensible.js | 18 + .../es-abstract/2018/IsGenericDescriptor.js | 23 + node_modules/es-abstract/2018/IsInteger.js | 17 + node_modules/es-abstract/2018/IsPromise.js | 24 + .../es-abstract/2018/IsPropertyKey.js | 7 + node_modules/es-abstract/2018/IsRegExp.js | 24 + .../es-abstract/2018/IsSharedArrayBuffer.js | 19 + .../es-abstract/2018/IsStringPrefix.js | 47 + .../es-abstract/2018/IterableToList.js | 24 + .../es-abstract/2018/IteratorClose.js | 50 + .../es-abstract/2018/IteratorComplete.js | 18 + node_modules/es-abstract/2018/IteratorNext.js | 18 + node_modules/es-abstract/2018/IteratorStep.js | 13 + .../es-abstract/2018/IteratorValue.js | 18 + node_modules/es-abstract/2018/MakeDate.js | 13 + node_modules/es-abstract/2018/MakeDay.js | 33 + node_modules/es-abstract/2018/MakeTime.js | 23 + node_modules/es-abstract/2018/MinFromTime.js | 14 + .../es-abstract/2018/MonthFromTime.js | 47 + .../es-abstract/2018/NumberToString.js | 19 + node_modules/es-abstract/2018/ObjectCreate.js | 37 + .../2018/ObjectDefineProperties.js | 40 + .../2018/OrdinaryCreateFromConstructor.js | 20 + .../2018/OrdinaryDefineOwnProperty.js | 61 + .../2018/OrdinaryGetOwnProperty.js | 44 + .../2018/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2018/OrdinaryHasInstance.js | 25 + .../es-abstract/2018/OrdinaryHasProperty.js | 20 + .../2018/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2018/OrdinaryToPrimitive.js | 38 + .../es-abstract/2018/PromiseResolve.js | 17 + .../es-abstract/2018/QuoteJSONString.js | 48 + node_modules/es-abstract/2018/RegExpCreate.js | 21 + node_modules/es-abstract/2018/RegExpExec.js | 32 + .../2018/RequireObjectCoercible.js | 3 + node_modules/es-abstract/2018/SameValue.js | 13 + .../es-abstract/2018/SameValueNonNumber.js | 16 + .../es-abstract/2018/SameValueZero.js | 9 + node_modules/es-abstract/2018/SecFromTime.js | 14 + node_modules/es-abstract/2018/Set.js | 47 + .../es-abstract/2018/SetFunctionLength.js | 31 + .../es-abstract/2018/SetFunctionName.js | 44 + .../es-abstract/2018/SetIntegrityLevel.js | 57 + .../es-abstract/2018/SpeciesConstructor.js | 32 + node_modules/es-abstract/2018/SplitMatch.js | 38 + .../2018/StrictEqualityComparison.js | 17 + node_modules/es-abstract/2018/StringCreate.js | 40 + .../es-abstract/2018/StringGetOwnProperty.js | 48 + .../2018/SymbolDescriptiveString.js | 20 + .../es-abstract/2018/TestIntegrityLevel.js | 42 + node_modules/es-abstract/2018/TimeClip.js | 21 + node_modules/es-abstract/2018/TimeFromYear.js | 11 + node_modules/es-abstract/2018/TimeString.js | 25 + .../es-abstract/2018/TimeWithinDay.js | 12 + node_modules/es-abstract/2018/ToBoolean.js | 5 + node_modules/es-abstract/2018/ToDateString.js | 22 + node_modules/es-abstract/2018/ToIndex.js | 26 + node_modules/es-abstract/2018/ToInt16.js | 10 + node_modules/es-abstract/2018/ToInt32.js | 9 + node_modules/es-abstract/2018/ToInt8.js | 10 + node_modules/es-abstract/2018/ToInteger.js | 12 + node_modules/es-abstract/2018/ToLength.js | 12 + node_modules/es-abstract/2018/ToNumber.js | 59 + node_modules/es-abstract/2018/ToObject.js | 14 + node_modules/es-abstract/2018/ToPrimitive.js | 12 + .../es-abstract/2018/ToPropertyDescriptor.js | 52 + .../es-abstract/2018/ToPropertyKey.js | 15 + node_modules/es-abstract/2018/ToString.js | 15 + node_modules/es-abstract/2018/ToUint16.js | 19 + node_modules/es-abstract/2018/ToUint32.js | 9 + node_modules/es-abstract/2018/ToUint8.js | 20 + node_modules/es-abstract/2018/ToUint8Clamp.js | 19 + node_modules/es-abstract/2018/Type.js | 12 + node_modules/es-abstract/2018/UTF16Decode.js | 21 + .../es-abstract/2018/UTF16Encoding.js | 25 + .../es-abstract/2018/UnicodeEscape.js | 26 + .../ValidateAndApplyPropertyDescriptor.js | 170 + node_modules/es-abstract/2018/WeekDay.js | 10 + node_modules/es-abstract/2018/YearFromTime.js | 16 + node_modules/es-abstract/2018/abs.js | 11 + node_modules/es-abstract/2018/floor.js | 11 + node_modules/es-abstract/2018/modulo.js | 9 + node_modules/es-abstract/2018/msFromTime.js | 11 + .../es-abstract/2018/thisBooleanValue.js | 15 + .../es-abstract/2018/thisNumberValue.js | 18 + .../es-abstract/2018/thisStringValue.js | 15 + .../es-abstract/2018/thisSymbolValue.js | 19 + .../es-abstract/2018/thisTimeValue.js | 9 + .../2019/AbstractEqualityComparison.js | 37 + .../2019/AbstractRelationalComparison.js | 61 + .../2019/AddEntriesFromIterable.js | 52 + .../es-abstract/2019/AdvanceStringIndex.js | 47 + node_modules/es-abstract/2019/ArrayCreate.js | 53 + .../es-abstract/2019/ArraySetLength.js | 85 + .../es-abstract/2019/ArraySpeciesCreate.js | 46 + node_modules/es-abstract/2019/Call.js | 20 + .../2019/CanonicalNumericIndexString.js | 22 + .../es-abstract/2019/CharacterRange.js | 31 + .../2019/CompletePropertyDescriptor.js | 39 + .../es-abstract/2019/CopyDataProperties.js | 68 + .../es-abstract/2019/CreateDataProperty.js | 45 + .../2019/CreateDataPropertyOrThrow.js | 25 + node_modules/es-abstract/2019/CreateHTML.js | 30 + .../2019/CreateIterResultObject.js | 19 + .../2019/CreateListFromArrayLike.js | 43 + .../es-abstract/2019/CreateMethodProperty.js | 40 + node_modules/es-abstract/2019/DateFromTime.js | 54 + node_modules/es-abstract/2019/DateString.js | 30 + node_modules/es-abstract/2019/Day.js | 11 + node_modules/es-abstract/2019/DayFromYear.js | 10 + .../es-abstract/2019/DayWithinYear.js | 11 + node_modules/es-abstract/2019/DaysInYear.js | 18 + .../es-abstract/2019/DefinePropertyOrThrow.js | 50 + .../es-abstract/2019/DeletePropertyOrThrow.js | 27 + .../2019/EnumerableOwnPropertyNames.js | 43 + .../es-abstract/2019/FlattenIntoArray.js | 58 + .../2019/FromPropertyDescriptor.js | 16 + node_modules/es-abstract/2019/Get.js | 25 + node_modules/es-abstract/2019/GetIterator.js | 34 + node_modules/es-abstract/2019/GetMethod.js | 34 + .../es-abstract/2019/GetOwnPropertyKeys.js | 31 + .../2019/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2019/GetSubstitution.js | 128 + node_modules/es-abstract/2019/GetV.js | 23 + .../es-abstract/2019/HasOwnProperty.js | 22 + node_modules/es-abstract/2019/HasProperty.js | 20 + node_modules/es-abstract/2019/HourFromTime.js | 14 + node_modules/es-abstract/2019/InLeapYear.js | 21 + .../es-abstract/2019/InstanceofOperator.js | 30 + node_modules/es-abstract/2019/Invoke.js | 24 + .../es-abstract/2019/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/2019/IsArray.js | 4 + node_modules/es-abstract/2019/IsCallable.js | 5 + .../2019/IsCompatiblePropertyDescriptor.js | 9 + .../es-abstract/2019/IsConcatSpreadable.js | 25 + .../es-abstract/2019/IsConstructor.js | 40 + .../es-abstract/2019/IsDataDescriptor.js | 23 + node_modules/es-abstract/2019/IsExtensible.js | 18 + .../es-abstract/2019/IsGenericDescriptor.js | 23 + node_modules/es-abstract/2019/IsInteger.js | 17 + node_modules/es-abstract/2019/IsPromise.js | 24 + .../es-abstract/2019/IsPropertyKey.js | 7 + node_modules/es-abstract/2019/IsRegExp.js | 24 + .../es-abstract/2019/IsSharedArrayBuffer.js | 19 + .../es-abstract/2019/IsStringPrefix.js | 47 + .../es-abstract/2019/IterableToList.js | 24 + .../es-abstract/2019/IteratorClose.js | 50 + .../es-abstract/2019/IteratorComplete.js | 18 + node_modules/es-abstract/2019/IteratorNext.js | 18 + node_modules/es-abstract/2019/IteratorStep.js | 13 + .../es-abstract/2019/IteratorValue.js | 18 + node_modules/es-abstract/2019/MakeDate.js | 13 + node_modules/es-abstract/2019/MakeDay.js | 33 + node_modules/es-abstract/2019/MakeTime.js | 23 + node_modules/es-abstract/2019/MinFromTime.js | 14 + .../es-abstract/2019/MonthFromTime.js | 47 + .../es-abstract/2019/NumberToString.js | 19 + node_modules/es-abstract/2019/ObjectCreate.js | 37 + .../2019/ObjectDefineProperties.js | 40 + .../2019/OrdinaryCreateFromConstructor.js | 20 + .../2019/OrdinaryDefineOwnProperty.js | 61 + .../2019/OrdinaryGetOwnProperty.js | 44 + .../2019/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2019/OrdinaryHasInstance.js | 25 + .../es-abstract/2019/OrdinaryHasProperty.js | 20 + .../2019/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2019/OrdinaryToPrimitive.js | 38 + .../es-abstract/2019/PromiseResolve.js | 17 + .../es-abstract/2019/QuoteJSONString.js | 54 + node_modules/es-abstract/2019/RegExpCreate.js | 21 + node_modules/es-abstract/2019/RegExpExec.js | 32 + .../2019/RequireObjectCoercible.js | 3 + node_modules/es-abstract/2019/SameValue.js | 13 + .../es-abstract/2019/SameValueNonNumber.js | 16 + .../es-abstract/2019/SameValueZero.js | 9 + node_modules/es-abstract/2019/SecFromTime.js | 14 + node_modules/es-abstract/2019/Set.js | 47 + .../es-abstract/2019/SetFunctionLength.js | 31 + .../es-abstract/2019/SetFunctionName.js | 44 + .../es-abstract/2019/SetIntegrityLevel.js | 57 + .../es-abstract/2019/SpeciesConstructor.js | 32 + node_modules/es-abstract/2019/SplitMatch.js | 38 + .../2019/StrictEqualityComparison.js | 17 + node_modules/es-abstract/2019/StringCreate.js | 40 + .../es-abstract/2019/StringGetOwnProperty.js | 48 + .../2019/SymbolDescriptiveString.js | 20 + .../es-abstract/2019/TestIntegrityLevel.js | 42 + node_modules/es-abstract/2019/TimeClip.js | 21 + node_modules/es-abstract/2019/TimeFromYear.js | 11 + node_modules/es-abstract/2019/TimeString.js | 25 + .../es-abstract/2019/TimeWithinDay.js | 12 + node_modules/es-abstract/2019/ToBoolean.js | 5 + node_modules/es-abstract/2019/ToDateString.js | 22 + node_modules/es-abstract/2019/ToIndex.js | 26 + node_modules/es-abstract/2019/ToInt16.js | 10 + node_modules/es-abstract/2019/ToInt32.js | 9 + node_modules/es-abstract/2019/ToInt8.js | 10 + node_modules/es-abstract/2019/ToInteger.js | 12 + node_modules/es-abstract/2019/ToLength.js | 12 + node_modules/es-abstract/2019/ToNumber.js | 59 + node_modules/es-abstract/2019/ToObject.js | 14 + node_modules/es-abstract/2019/ToPrimitive.js | 12 + .../es-abstract/2019/ToPropertyDescriptor.js | 52 + .../es-abstract/2019/ToPropertyKey.js | 15 + node_modules/es-abstract/2019/ToString.js | 15 + node_modules/es-abstract/2019/ToUint16.js | 19 + node_modules/es-abstract/2019/ToUint32.js | 9 + node_modules/es-abstract/2019/ToUint8.js | 20 + node_modules/es-abstract/2019/ToUint8Clamp.js | 19 + node_modules/es-abstract/2019/TrimString.js | 29 + node_modules/es-abstract/2019/Type.js | 12 + node_modules/es-abstract/2019/UTF16Decode.js | 21 + .../es-abstract/2019/UTF16Encoding.js | 25 + .../es-abstract/2019/UnicodeEscape.js | 26 + .../ValidateAndApplyPropertyDescriptor.js | 170 + node_modules/es-abstract/2019/WeekDay.js | 10 + node_modules/es-abstract/2019/YearFromTime.js | 16 + node_modules/es-abstract/2019/abs.js | 11 + node_modules/es-abstract/2019/floor.js | 11 + node_modules/es-abstract/2019/modulo.js | 9 + node_modules/es-abstract/2019/msFromTime.js | 11 + .../es-abstract/2019/thisBooleanValue.js | 15 + .../es-abstract/2019/thisNumberValue.js | 18 + .../es-abstract/2019/thisStringValue.js | 15 + .../es-abstract/2019/thisSymbolValue.js | 19 + .../es-abstract/2019/thisTimeValue.js | 3 + .../2020/AbstractEqualityComparison.js | 57 + .../2020/AbstractRelationalComparison.js | 82 + .../2020/AddEntriesFromIterable.js | 52 + .../es-abstract/2020/AdvanceStringIndex.js | 34 + node_modules/es-abstract/2020/ArrayCreate.js | 53 + .../es-abstract/2020/ArraySetLength.js | 85 + .../es-abstract/2020/ArraySpeciesCreate.js | 46 + node_modules/es-abstract/2020/BigInt/add.js | 18 + .../es-abstract/2020/BigInt/bitwiseAND.js | 17 + .../es-abstract/2020/BigInt/bitwiseNOT.js | 17 + .../es-abstract/2020/BigInt/bitwiseOR.js | 17 + .../es-abstract/2020/BigInt/bitwiseXOR.js | 17 + .../es-abstract/2020/BigInt/divide.js | 22 + node_modules/es-abstract/2020/BigInt/equal.js | 17 + .../es-abstract/2020/BigInt/exponentiate.js | 31 + node_modules/es-abstract/2020/BigInt/index.js | 43 + .../es-abstract/2020/BigInt/leftShift.js | 18 + .../es-abstract/2020/BigInt/lessThan.js | 18 + .../es-abstract/2020/BigInt/multiply.js | 18 + .../es-abstract/2020/BigInt/remainder.js | 30 + .../es-abstract/2020/BigInt/sameValue.js | 18 + .../es-abstract/2020/BigInt/sameValueZero.js | 18 + .../2020/BigInt/signedRightShift.js | 18 + .../es-abstract/2020/BigInt/subtract.js | 18 + .../es-abstract/2020/BigInt/toString.js | 18 + .../es-abstract/2020/BigInt/unaryMinus.js | 24 + .../2020/BigInt/unsignedRightShift.js | 17 + .../es-abstract/2020/BigIntBitwiseOp.js | 66 + node_modules/es-abstract/2020/BinaryAnd.js | 14 + node_modules/es-abstract/2020/BinaryOr.js | 14 + node_modules/es-abstract/2020/BinaryXor.js | 14 + node_modules/es-abstract/2020/Call.js | 20 + .../2020/CanonicalNumericIndexString.js | 22 + .../es-abstract/2020/CharacterRange.js | 31 + node_modules/es-abstract/2020/CodePointAt.js | 58 + .../2020/CompletePropertyDescriptor.js | 39 + .../es-abstract/2020/CopyDataProperties.js | 64 + .../es-abstract/2020/CreateDataProperty.js | 45 + .../2020/CreateDataPropertyOrThrow.js | 25 + node_modules/es-abstract/2020/CreateHTML.js | 30 + .../2020/CreateIterResultObject.js | 19 + .../2020/CreateListFromArrayLike.js | 44 + .../es-abstract/2020/CreateMethodProperty.js | 40 + .../2020/CreateRegExpStringIterator.js | 111 + node_modules/es-abstract/2020/DateFromTime.js | 54 + node_modules/es-abstract/2020/DateString.js | 30 + node_modules/es-abstract/2020/Day.js | 11 + node_modules/es-abstract/2020/DayFromYear.js | 10 + .../es-abstract/2020/DayWithinYear.js | 11 + node_modules/es-abstract/2020/DaysInYear.js | 18 + .../es-abstract/2020/DefinePropertyOrThrow.js | 50 + .../es-abstract/2020/DeletePropertyOrThrow.js | 27 + .../2020/EnumerableOwnPropertyNames.js | 43 + .../es-abstract/2020/FlattenIntoArray.js | 58 + .../2020/FromPropertyDescriptor.js | 16 + node_modules/es-abstract/2020/Get.js | 25 + node_modules/es-abstract/2020/GetIterator.js | 64 + node_modules/es-abstract/2020/GetMethod.js | 34 + .../es-abstract/2020/GetOwnPropertyKeys.js | 31 + .../2020/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2020/GetSubstitution.js | 128 + node_modules/es-abstract/2020/GetV.js | 23 + .../es-abstract/2020/HasOwnProperty.js | 22 + node_modules/es-abstract/2020/HasProperty.js | 20 + node_modules/es-abstract/2020/HourFromTime.js | 14 + node_modules/es-abstract/2020/InLeapYear.js | 21 + .../es-abstract/2020/InstanceofOperator.js | 30 + node_modules/es-abstract/2020/Invoke.js | 24 + .../es-abstract/2020/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/2020/IsArray.js | 4 + .../es-abstract/2020/IsBigIntElementType.js | 7 + node_modules/es-abstract/2020/IsCallable.js | 5 + .../2020/IsCompatiblePropertyDescriptor.js | 9 + .../es-abstract/2020/IsConcatSpreadable.js | 25 + .../es-abstract/2020/IsConstructor.js | 40 + .../es-abstract/2020/IsDataDescriptor.js | 23 + node_modules/es-abstract/2020/IsExtensible.js | 18 + .../es-abstract/2020/IsGenericDescriptor.js | 23 + node_modules/es-abstract/2020/IsInteger.js | 17 + .../es-abstract/2020/IsNoTearConfiguration.js | 16 + .../es-abstract/2020/IsNonNegativeInteger.js | 9 + node_modules/es-abstract/2020/IsPromise.js | 24 + .../es-abstract/2020/IsPropertyKey.js | 7 + node_modules/es-abstract/2020/IsRegExp.js | 24 + .../es-abstract/2020/IsSharedArrayBuffer.js | 19 + .../es-abstract/2020/IsStringPrefix.js | 47 + .../2020/IsUnclampedIntegerElementType.js | 12 + .../es-abstract/2020/IsUnsignedElementType.js | 11 + .../es-abstract/2020/IterableToList.js | 24 + .../es-abstract/2020/IteratorClose.js | 50 + .../es-abstract/2020/IteratorComplete.js | 18 + node_modules/es-abstract/2020/IteratorNext.js | 18 + node_modules/es-abstract/2020/IteratorStep.js | 13 + .../es-abstract/2020/IteratorValue.js | 18 + .../es-abstract/2020/LengthOfArrayLike.js | 20 + node_modules/es-abstract/2020/MakeDate.js | 13 + node_modules/es-abstract/2020/MakeDay.js | 33 + node_modules/es-abstract/2020/MakeTime.js | 23 + node_modules/es-abstract/2020/MinFromTime.js | 14 + .../es-abstract/2020/MonthFromTime.js | 47 + node_modules/es-abstract/2020/Number/add.js | 44 + .../es-abstract/2020/Number/bitwiseAND.js | 17 + .../es-abstract/2020/Number/bitwiseNOT.js | 19 + .../es-abstract/2020/Number/bitwiseOR.js | 17 + .../es-abstract/2020/Number/bitwiseXOR.js | 17 + .../es-abstract/2020/Number/divide.js | 22 + node_modules/es-abstract/2020/Number/equal.js | 21 + .../es-abstract/2020/Number/exponentiate.js | 77 + node_modules/es-abstract/2020/Number/index.js | 43 + .../es-abstract/2020/Number/leftShift.js | 24 + .../es-abstract/2020/Number/lessThan.js | 26 + .../es-abstract/2020/Number/multiply.js | 33 + .../es-abstract/2020/Number/remainder.js | 32 + .../es-abstract/2020/Number/sameValue.js | 21 + .../es-abstract/2020/Number/sameValueZero.js | 24 + .../2020/Number/signedRightShift.js | 24 + .../es-abstract/2020/Number/subtract.js | 16 + .../es-abstract/2020/Number/toString.js | 18 + .../es-abstract/2020/Number/unaryMinus.js | 21 + .../2020/Number/unsignedRightShift.js | 24 + .../es-abstract/2020/NumberBitwiseOp.js | 29 + .../es-abstract/2020/NumberToBigInt.js | 26 + .../2020/ObjectDefineProperties.js | 40 + .../2020/OrdinaryCreateFromConstructor.js | 20 + .../2020/OrdinaryDefineOwnProperty.js | 61 + .../2020/OrdinaryGetOwnProperty.js | 44 + .../2020/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2020/OrdinaryHasInstance.js | 25 + .../es-abstract/2020/OrdinaryHasProperty.js | 20 + .../es-abstract/2020/OrdinaryObjectCreate.js | 46 + .../2020/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2020/OrdinaryToPrimitive.js | 38 + .../es-abstract/2020/PromiseResolve.js | 17 + .../es-abstract/2020/QuoteJSONString.js | 54 + node_modules/es-abstract/2020/RegExpCreate.js | 21 + node_modules/es-abstract/2020/RegExpExec.js | 32 + .../2020/RequireObjectCoercible.js | 3 + node_modules/es-abstract/2020/SameValue.js | 13 + .../es-abstract/2020/SameValueNonNumeric.js | 21 + .../es-abstract/2020/SameValueZero.js | 9 + node_modules/es-abstract/2020/SecFromTime.js | 14 + node_modules/es-abstract/2020/Set.js | 47 + .../es-abstract/2020/SetFunctionLength.js | 31 + .../es-abstract/2020/SetFunctionName.js | 44 + .../es-abstract/2020/SetIntegrityLevel.js | 57 + .../es-abstract/2020/SpeciesConstructor.js | 32 + node_modules/es-abstract/2020/SplitMatch.js | 38 + .../2020/StrictEqualityComparison.js | 17 + node_modules/es-abstract/2020/StringCreate.js | 40 + .../es-abstract/2020/StringGetOwnProperty.js | 48 + node_modules/es-abstract/2020/StringPad.js | 43 + .../es-abstract/2020/StringToBigInt.js | 23 + .../2020/SymbolDescriptiveString.js | 20 + .../es-abstract/2020/TestIntegrityLevel.js | 42 + node_modules/es-abstract/2020/TimeClip.js | 21 + node_modules/es-abstract/2020/TimeFromYear.js | 11 + node_modules/es-abstract/2020/TimeString.js | 25 + .../es-abstract/2020/TimeWithinDay.js | 12 + node_modules/es-abstract/2020/ToBigInt.js | 25 + node_modules/es-abstract/2020/ToBigInt64.js | 25 + node_modules/es-abstract/2020/ToBigUint64.js | 22 + node_modules/es-abstract/2020/ToBoolean.js | 5 + node_modules/es-abstract/2020/ToDateString.js | 22 + node_modules/es-abstract/2020/ToIndex.js | 26 + node_modules/es-abstract/2020/ToInt16.js | 10 + node_modules/es-abstract/2020/ToInt32.js | 9 + node_modules/es-abstract/2020/ToInt8.js | 10 + node_modules/es-abstract/2020/ToInteger.js | 15 + node_modules/es-abstract/2020/ToLength.js | 12 + node_modules/es-abstract/2020/ToNumber.js | 62 + node_modules/es-abstract/2020/ToNumeric.js | 21 + node_modules/es-abstract/2020/ToObject.js | 14 + node_modules/es-abstract/2020/ToPrimitive.js | 12 + .../es-abstract/2020/ToPropertyDescriptor.js | 52 + .../es-abstract/2020/ToPropertyKey.js | 15 + node_modules/es-abstract/2020/ToString.js | 15 + node_modules/es-abstract/2020/ToUint16.js | 19 + node_modules/es-abstract/2020/ToUint32.js | 9 + node_modules/es-abstract/2020/ToUint8.js | 20 + node_modules/es-abstract/2020/ToUint8Clamp.js | 19 + node_modules/es-abstract/2020/TrimString.js | 29 + node_modules/es-abstract/2020/Type.js | 15 + .../es-abstract/2020/UTF16DecodeString.js | 29 + .../2020/UTF16DecodeSurrogatePair.js | 19 + .../es-abstract/2020/UTF16Encoding.js | 25 + .../es-abstract/2020/UnicodeEscape.js | 27 + .../ValidateAndApplyPropertyDescriptor.js | 170 + node_modules/es-abstract/2020/WeekDay.js | 10 + node_modules/es-abstract/2020/YearFromTime.js | 16 + node_modules/es-abstract/2020/abs.js | 11 + node_modules/es-abstract/2020/floor.js | 11 + node_modules/es-abstract/2020/modulo.js | 9 + node_modules/es-abstract/2020/msFromTime.js | 11 + .../es-abstract/2020/thisBigIntValue.js | 22 + .../es-abstract/2020/thisBooleanValue.js | 15 + .../es-abstract/2020/thisNumberValue.js | 18 + .../es-abstract/2020/thisStringValue.js | 15 + .../es-abstract/2020/thisSymbolValue.js | 19 + .../es-abstract/2020/thisTimeValue.js | 3 + .../2021/AbstractEqualityComparison.js | 57 + .../2021/AbstractRelationalComparison.js | 82 + .../2021/AddEntriesFromIterable.js | 52 + .../es-abstract/2021/AddToKeptObjects.js | 21 + .../es-abstract/2021/AdvanceStringIndex.js | 34 + .../ApplyStringOrNumericBinaryOperator.js | 80 + node_modules/es-abstract/2021/ArrayCreate.js | 53 + .../es-abstract/2021/ArraySetLength.js | 85 + .../es-abstract/2021/ArraySpeciesCreate.js | 48 + node_modules/es-abstract/2021/BigInt/add.js | 18 + .../es-abstract/2021/BigInt/bitwiseAND.js | 17 + .../es-abstract/2021/BigInt/bitwiseNOT.js | 17 + .../es-abstract/2021/BigInt/bitwiseOR.js | 17 + .../es-abstract/2021/BigInt/bitwiseXOR.js | 17 + .../es-abstract/2021/BigInt/divide.js | 22 + node_modules/es-abstract/2021/BigInt/equal.js | 17 + .../es-abstract/2021/BigInt/exponentiate.js | 31 + node_modules/es-abstract/2021/BigInt/index.js | 43 + .../es-abstract/2021/BigInt/leftShift.js | 18 + .../es-abstract/2021/BigInt/lessThan.js | 18 + .../es-abstract/2021/BigInt/multiply.js | 18 + .../es-abstract/2021/BigInt/remainder.js | 30 + .../es-abstract/2021/BigInt/sameValue.js | 18 + .../es-abstract/2021/BigInt/sameValueZero.js | 18 + .../2021/BigInt/signedRightShift.js | 18 + .../es-abstract/2021/BigInt/subtract.js | 18 + .../es-abstract/2021/BigInt/toString.js | 18 + .../es-abstract/2021/BigInt/unaryMinus.js | 24 + .../2021/BigInt/unsignedRightShift.js | 17 + .../es-abstract/2021/BigIntBitwiseOp.js | 66 + node_modules/es-abstract/2021/BinaryAnd.js | 14 + node_modules/es-abstract/2021/BinaryOr.js | 14 + node_modules/es-abstract/2021/BinaryXor.js | 14 + .../es-abstract/2021/ByteListBitwiseOp.js | 44 + .../es-abstract/2021/ByteListEqual.js | 33 + node_modules/es-abstract/2021/Call.js | 20 + .../2021/CanonicalNumericIndexString.js | 22 + .../es-abstract/2021/CharacterRange.js | 31 + .../es-abstract/2021/ClearKeptObjects.js | 12 + node_modules/es-abstract/2021/CodePointAt.js | 58 + .../es-abstract/2021/CodePointsToString.js | 27 + .../2021/CompletePropertyDescriptor.js | 39 + .../es-abstract/2021/CopyDataProperties.js | 70 + .../es-abstract/2021/CreateDataProperty.js | 45 + .../2021/CreateDataPropertyOrThrow.js | 25 + node_modules/es-abstract/2021/CreateHTML.js | 30 + .../2021/CreateIterResultObject.js | 19 + .../2021/CreateListFromArrayLike.js | 44 + .../es-abstract/2021/CreateMethodProperty.js | 40 + .../2021/CreateRegExpStringIterator.js | 111 + node_modules/es-abstract/2021/DateFromTime.js | 54 + node_modules/es-abstract/2021/DateString.js | 30 + node_modules/es-abstract/2021/Day.js | 11 + node_modules/es-abstract/2021/DayFromYear.js | 10 + .../es-abstract/2021/DayWithinYear.js | 11 + node_modules/es-abstract/2021/DaysInYear.js | 18 + .../es-abstract/2021/DefinePropertyOrThrow.js | 50 + .../es-abstract/2021/DeletePropertyOrThrow.js | 27 + .../2021/EnumerableOwnPropertyNames.js | 43 + .../es-abstract/2021/FlattenIntoArray.js | 58 + .../2021/FromPropertyDescriptor.js | 16 + node_modules/es-abstract/2021/Get.js | 25 + node_modules/es-abstract/2021/GetIterator.js | 64 + node_modules/es-abstract/2021/GetMethod.js | 34 + .../es-abstract/2021/GetOwnPropertyKeys.js | 31 + .../es-abstract/2021/GetPromiseResolve.js | 22 + .../2021/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2021/GetSubstitution.js | 128 + node_modules/es-abstract/2021/GetV.js | 23 + .../es-abstract/2021/HasOwnProperty.js | 22 + node_modules/es-abstract/2021/HasProperty.js | 20 + node_modules/es-abstract/2021/HourFromTime.js | 14 + node_modules/es-abstract/2021/InLeapYear.js | 21 + .../es-abstract/2021/InstanceofOperator.js | 30 + node_modules/es-abstract/2021/Invoke.js | 24 + .../es-abstract/2021/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/2021/IsArray.js | 4 + .../es-abstract/2021/IsBigIntElementType.js | 7 + node_modules/es-abstract/2021/IsCallable.js | 5 + .../2021/IsCompatiblePropertyDescriptor.js | 9 + .../es-abstract/2021/IsConcatSpreadable.js | 25 + .../es-abstract/2021/IsConstructor.js | 40 + .../es-abstract/2021/IsDataDescriptor.js | 23 + node_modules/es-abstract/2021/IsExtensible.js | 18 + .../es-abstract/2021/IsGenericDescriptor.js | 23 + .../es-abstract/2021/IsIntegralNumber.js | 18 + .../es-abstract/2021/IsNoTearConfiguration.js | 16 + node_modules/es-abstract/2021/IsPromise.js | 24 + .../es-abstract/2021/IsPropertyKey.js | 7 + node_modules/es-abstract/2021/IsRegExp.js | 24 + .../es-abstract/2021/IsSharedArrayBuffer.js | 19 + .../es-abstract/2021/IsStringPrefix.js | 47 + .../2021/IsUnclampedIntegerElementType.js | 12 + .../es-abstract/2021/IsUnsignedElementType.js | 11 + .../es-abstract/2021/IterableToList.js | 29 + .../es-abstract/2021/IteratorClose.js | 50 + .../es-abstract/2021/IteratorComplete.js | 18 + node_modules/es-abstract/2021/IteratorNext.js | 18 + node_modules/es-abstract/2021/IteratorStep.js | 13 + .../es-abstract/2021/IteratorValue.js | 18 + .../es-abstract/2021/LengthOfArrayLike.js | 20 + node_modules/es-abstract/2021/MakeDate.js | 13 + node_modules/es-abstract/2021/MakeDay.js | 36 + node_modules/es-abstract/2021/MakeTime.js | 23 + node_modules/es-abstract/2021/MinFromTime.js | 14 + .../es-abstract/2021/MonthFromTime.js | 47 + node_modules/es-abstract/2021/Number/add.js | 36 + .../es-abstract/2021/Number/bitwiseAND.js | 17 + .../es-abstract/2021/Number/bitwiseNOT.js | 19 + .../es-abstract/2021/Number/bitwiseOR.js | 17 + .../es-abstract/2021/Number/bitwiseXOR.js | 17 + .../es-abstract/2021/Number/divide.js | 22 + node_modules/es-abstract/2021/Number/equal.js | 21 + .../es-abstract/2021/Number/exponentiate.js | 77 + node_modules/es-abstract/2021/Number/index.js | 43 + .../es-abstract/2021/Number/leftShift.js | 25 + .../es-abstract/2021/Number/lessThan.js | 26 + .../es-abstract/2021/Number/multiply.js | 33 + .../es-abstract/2021/Number/remainder.js | 32 + .../es-abstract/2021/Number/sameValue.js | 21 + .../es-abstract/2021/Number/sameValueZero.js | 24 + .../2021/Number/signedRightShift.js | 25 + .../es-abstract/2021/Number/subtract.js | 19 + .../es-abstract/2021/Number/toString.js | 18 + .../es-abstract/2021/Number/unaryMinus.js | 21 + .../2021/Number/unsignedRightShift.js | 25 + .../es-abstract/2021/NumberBitwiseOp.js | 29 + .../es-abstract/2021/NumberToBigInt.js | 22 + .../2021/ObjectDefineProperties.js | 40 + .../2021/OrdinaryCreateFromConstructor.js | 20 + .../2021/OrdinaryDefineOwnProperty.js | 61 + .../2021/OrdinaryGetOwnProperty.js | 44 + .../2021/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2021/OrdinaryHasInstance.js | 25 + .../es-abstract/2021/OrdinaryHasProperty.js | 20 + .../es-abstract/2021/OrdinaryObjectCreate.js | 46 + .../2021/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2021/OrdinaryToPrimitive.js | 38 + .../es-abstract/2021/PromiseResolve.js | 17 + .../es-abstract/2021/QuoteJSONString.js | 54 + node_modules/es-abstract/2021/RegExpCreate.js | 21 + node_modules/es-abstract/2021/RegExpExec.js | 32 + .../2021/RequireObjectCoercible.js | 3 + node_modules/es-abstract/2021/SameValue.js | 13 + .../es-abstract/2021/SameValueNonNumeric.js | 21 + .../es-abstract/2021/SameValueZero.js | 9 + node_modules/es-abstract/2021/SecFromTime.js | 14 + node_modules/es-abstract/2021/Set.js | 47 + .../es-abstract/2021/SetFunctionLength.js | 31 + .../es-abstract/2021/SetFunctionName.js | 44 + .../es-abstract/2021/SetIntegrityLevel.js | 57 + .../es-abstract/2021/SpeciesConstructor.js | 32 + node_modules/es-abstract/2021/SplitMatch.js | 38 + .../2021/StrictEqualityComparison.js | 17 + node_modules/es-abstract/2021/StringCreate.js | 40 + .../es-abstract/2021/StringGetOwnProperty.js | 48 + .../es-abstract/2021/StringIndexOf.js | 39 + node_modules/es-abstract/2021/StringPad.js | 43 + .../es-abstract/2021/StringToBigInt.js | 23 + .../es-abstract/2021/StringToCodePoints.js | 29 + .../2021/SymbolDescriptiveString.js | 20 + .../es-abstract/2021/TestIntegrityLevel.js | 42 + node_modules/es-abstract/2021/TimeClip.js | 21 + node_modules/es-abstract/2021/TimeFromYear.js | 11 + node_modules/es-abstract/2021/TimeString.js | 25 + .../es-abstract/2021/TimeWithinDay.js | 12 + node_modules/es-abstract/2021/ToBigInt.js | 25 + node_modules/es-abstract/2021/ToBigInt64.js | 25 + node_modules/es-abstract/2021/ToBigUint64.js | 22 + node_modules/es-abstract/2021/ToBoolean.js | 5 + node_modules/es-abstract/2021/ToDateString.js | 22 + node_modules/es-abstract/2021/ToIndex.js | 26 + node_modules/es-abstract/2021/ToInt16.js | 10 + node_modules/es-abstract/2021/ToInt32.js | 9 + node_modules/es-abstract/2021/ToInt8.js | 10 + .../es-abstract/2021/ToIntegerOrInfinity.js | 20 + node_modules/es-abstract/2021/ToLength.js | 12 + node_modules/es-abstract/2021/ToNumber.js | 62 + node_modules/es-abstract/2021/ToNumeric.js | 21 + node_modules/es-abstract/2021/ToObject.js | 14 + node_modules/es-abstract/2021/ToPrimitive.js | 12 + .../es-abstract/2021/ToPropertyDescriptor.js | 52 + .../es-abstract/2021/ToPropertyKey.js | 15 + node_modules/es-abstract/2021/ToString.js | 15 + node_modules/es-abstract/2021/ToUint16.js | 19 + node_modules/es-abstract/2021/ToUint32.js | 9 + node_modules/es-abstract/2021/ToUint8.js | 20 + node_modules/es-abstract/2021/ToUint8Clamp.js | 19 + node_modules/es-abstract/2021/TrimString.js | 29 + node_modules/es-abstract/2021/Type.js | 15 + .../es-abstract/2021/UTF16EncodeCodePoint.js | 25 + .../2021/UTF16SurrogatePairToCodePoint.js | 19 + .../es-abstract/2021/UnicodeEscape.js | 27 + .../ValidateAndApplyPropertyDescriptor.js | 170 + node_modules/es-abstract/2021/WeakRefDeref.js | 24 + node_modules/es-abstract/2021/WeekDay.js | 10 + node_modules/es-abstract/2021/YearFromTime.js | 16 + node_modules/es-abstract/2021/abs.js | 11 + node_modules/es-abstract/2021/clamp.js | 18 + node_modules/es-abstract/2021/floor.js | 11 + node_modules/es-abstract/2021/modulo.js | 9 + node_modules/es-abstract/2021/msFromTime.js | 11 + node_modules/es-abstract/2021/substring.js | 20 + .../es-abstract/2021/thisBigIntValue.js | 22 + .../es-abstract/2021/thisBooleanValue.js | 15 + .../es-abstract/2021/thisNumberValue.js | 18 + .../es-abstract/2021/thisStringValue.js | 15 + .../es-abstract/2021/thisSymbolValue.js | 19 + .../es-abstract/2021/thisTimeValue.js | 3 + .../2022/AddEntriesFromIterable.js | 52 + .../es-abstract/2022/AddToKeptObjects.js | 21 + .../es-abstract/2022/AdvanceStringIndex.js | 34 + .../ApplyStringOrNumericBinaryOperator.js | 80 + node_modules/es-abstract/2022/ArrayCreate.js | 53 + .../es-abstract/2022/ArraySetLength.js | 85 + .../es-abstract/2022/ArraySpeciesCreate.js | 48 + node_modules/es-abstract/2022/BigInt/add.js | 18 + .../es-abstract/2022/BigInt/bitwiseAND.js | 17 + .../es-abstract/2022/BigInt/bitwiseNOT.js | 17 + .../es-abstract/2022/BigInt/bitwiseOR.js | 17 + .../es-abstract/2022/BigInt/bitwiseXOR.js | 17 + .../es-abstract/2022/BigInt/divide.js | 22 + node_modules/es-abstract/2022/BigInt/equal.js | 17 + .../es-abstract/2022/BigInt/exponentiate.js | 31 + node_modules/es-abstract/2022/BigInt/index.js | 43 + .../es-abstract/2022/BigInt/leftShift.js | 18 + .../es-abstract/2022/BigInt/lessThan.js | 18 + .../es-abstract/2022/BigInt/multiply.js | 18 + .../es-abstract/2022/BigInt/remainder.js | 30 + .../es-abstract/2022/BigInt/sameValue.js | 18 + .../es-abstract/2022/BigInt/sameValueZero.js | 18 + .../2022/BigInt/signedRightShift.js | 18 + .../es-abstract/2022/BigInt/subtract.js | 18 + .../es-abstract/2022/BigInt/toString.js | 18 + .../es-abstract/2022/BigInt/unaryMinus.js | 24 + .../2022/BigInt/unsignedRightShift.js | 17 + .../es-abstract/2022/BigIntBitwiseOp.js | 66 + node_modules/es-abstract/2022/BinaryAnd.js | 14 + node_modules/es-abstract/2022/BinaryOr.js | 14 + node_modules/es-abstract/2022/BinaryXor.js | 14 + .../es-abstract/2022/ByteListBitwiseOp.js | 44 + .../es-abstract/2022/ByteListEqual.js | 33 + node_modules/es-abstract/2022/Call.js | 20 + .../2022/CanonicalNumericIndexString.js | 22 + .../es-abstract/2022/CharacterRange.js | 31 + .../es-abstract/2022/ClearKeptObjects.js | 12 + node_modules/es-abstract/2022/CodePointAt.js | 58 + .../es-abstract/2022/CodePointsToString.js | 27 + .../2022/CompletePropertyDescriptor.js | 39 + .../es-abstract/2022/CopyDataProperties.js | 70 + .../es-abstract/2022/CreateDataProperty.js | 45 + .../2022/CreateDataPropertyOrThrow.js | 25 + node_modules/es-abstract/2022/CreateHTML.js | 30 + .../2022/CreateIterResultObject.js | 19 + .../2022/CreateListFromArrayLike.js | 44 + .../es-abstract/2022/CreateMethodProperty.js | 40 + .../CreateNonEnumerableDataPropertyOrThrow.js | 29 + .../2022/CreateRegExpStringIterator.js | 111 + node_modules/es-abstract/2022/DateFromTime.js | 54 + node_modules/es-abstract/2022/DateString.js | 30 + node_modules/es-abstract/2022/Day.js | 11 + node_modules/es-abstract/2022/DayFromYear.js | 10 + .../es-abstract/2022/DayWithinYear.js | 11 + node_modules/es-abstract/2022/DaysInYear.js | 18 + .../es-abstract/2022/DefinePropertyOrThrow.js | 50 + .../es-abstract/2022/DeletePropertyOrThrow.js | 27 + .../2022/EnumerableOwnPropertyNames.js | 43 + .../es-abstract/2022/FlattenIntoArray.js | 58 + .../2022/FromPropertyDescriptor.js | 16 + node_modules/es-abstract/2022/Get.js | 25 + node_modules/es-abstract/2022/GetIterator.js | 64 + .../es-abstract/2022/GetMatchIndexPair.js | 26 + .../es-abstract/2022/GetMatchString.js | 27 + node_modules/es-abstract/2022/GetMethod.js | 34 + .../es-abstract/2022/GetOwnPropertyKeys.js | 31 + .../es-abstract/2022/GetPromiseResolve.js | 22 + .../2022/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2022/GetStringIndex.js | 30 + .../es-abstract/2022/GetSubstitution.js | 128 + node_modules/es-abstract/2022/GetV.js | 23 + .../es-abstract/2022/HasOwnProperty.js | 22 + node_modules/es-abstract/2022/HasProperty.js | 20 + node_modules/es-abstract/2022/HourFromTime.js | 14 + node_modules/es-abstract/2022/InLeapYear.js | 21 + .../es-abstract/2022/InstallErrorCause.js | 23 + .../es-abstract/2022/InstanceofOperator.js | 30 + node_modules/es-abstract/2022/Invoke.js | 24 + .../es-abstract/2022/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/2022/IsArray.js | 4 + .../es-abstract/2022/IsBigIntElementType.js | 7 + node_modules/es-abstract/2022/IsCallable.js | 5 + .../2022/IsCompatiblePropertyDescriptor.js | 9 + .../es-abstract/2022/IsConcatSpreadable.js | 25 + .../es-abstract/2022/IsConstructor.js | 40 + .../es-abstract/2022/IsDataDescriptor.js | 23 + node_modules/es-abstract/2022/IsExtensible.js | 18 + .../es-abstract/2022/IsGenericDescriptor.js | 23 + .../es-abstract/2022/IsIntegralNumber.js | 18 + node_modules/es-abstract/2022/IsLessThan.js | 90 + .../es-abstract/2022/IsLooselyEqual.js | 59 + .../es-abstract/2022/IsNoTearConfiguration.js | 16 + node_modules/es-abstract/2022/IsPromise.js | 24 + .../es-abstract/2022/IsPropertyKey.js | 7 + node_modules/es-abstract/2022/IsRegExp.js | 24 + .../es-abstract/2022/IsSharedArrayBuffer.js | 19 + .../es-abstract/2022/IsStrictlyEqual.js | 20 + .../es-abstract/2022/IsStringPrefix.js | 22 + .../2022/IsStringWellFormedUnicode.js | 26 + .../2022/IsUnclampedIntegerElementType.js | 12 + .../es-abstract/2022/IsUnsignedElementType.js | 11 + .../es-abstract/2022/IterableToList.js | 29 + .../es-abstract/2022/IteratorClose.js | 50 + .../es-abstract/2022/IteratorComplete.js | 18 + node_modules/es-abstract/2022/IteratorNext.js | 18 + node_modules/es-abstract/2022/IteratorStep.js | 13 + .../es-abstract/2022/IteratorValue.js | 18 + .../es-abstract/2022/LengthOfArrayLike.js | 20 + node_modules/es-abstract/2022/MakeDate.js | 13 + node_modules/es-abstract/2022/MakeDay.js | 36 + .../2022/MakeMatchIndicesIndexPairArray.js | 69 + node_modules/es-abstract/2022/MakeTime.js | 23 + node_modules/es-abstract/2022/MinFromTime.js | 14 + .../es-abstract/2022/MonthFromTime.js | 47 + node_modules/es-abstract/2022/Number/add.js | 36 + .../es-abstract/2022/Number/bitwiseAND.js | 17 + .../es-abstract/2022/Number/bitwiseNOT.js | 19 + .../es-abstract/2022/Number/bitwiseOR.js | 17 + .../es-abstract/2022/Number/bitwiseXOR.js | 17 + .../es-abstract/2022/Number/divide.js | 22 + node_modules/es-abstract/2022/Number/equal.js | 21 + .../es-abstract/2022/Number/exponentiate.js | 77 + node_modules/es-abstract/2022/Number/index.js | 43 + .../es-abstract/2022/Number/leftShift.js | 25 + .../es-abstract/2022/Number/lessThan.js | 26 + .../es-abstract/2022/Number/multiply.js | 33 + .../es-abstract/2022/Number/remainder.js | 32 + .../es-abstract/2022/Number/sameValue.js | 21 + .../es-abstract/2022/Number/sameValueZero.js | 24 + .../2022/Number/signedRightShift.js | 25 + .../es-abstract/2022/Number/subtract.js | 19 + .../es-abstract/2022/Number/toString.js | 18 + .../es-abstract/2022/Number/unaryMinus.js | 21 + .../2022/Number/unsignedRightShift.js | 25 + .../es-abstract/2022/NumberBitwiseOp.js | 29 + .../es-abstract/2022/NumberToBigInt.js | 22 + .../2022/ObjectDefineProperties.js | 40 + .../2022/OrdinaryCreateFromConstructor.js | 20 + .../2022/OrdinaryDefineOwnProperty.js | 61 + .../2022/OrdinaryGetOwnProperty.js | 44 + .../2022/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2022/OrdinaryHasInstance.js | 25 + .../es-abstract/2022/OrdinaryHasProperty.js | 20 + .../es-abstract/2022/OrdinaryObjectCreate.js | 46 + .../2022/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2022/OrdinaryToPrimitive.js | 38 + .../es-abstract/2022/PromiseResolve.js | 17 + .../es-abstract/2022/QuoteJSONString.js | 54 + node_modules/es-abstract/2022/RegExpCreate.js | 21 + node_modules/es-abstract/2022/RegExpExec.js | 32 + .../es-abstract/2022/RegExpHasFlag.js | 38 + .../2022/RequireObjectCoercible.js | 3 + node_modules/es-abstract/2022/SameValue.js | 13 + .../es-abstract/2022/SameValueNonNumeric.js | 21 + .../es-abstract/2022/SameValueZero.js | 9 + node_modules/es-abstract/2022/SecFromTime.js | 14 + node_modules/es-abstract/2022/Set.js | 47 + .../es-abstract/2022/SetFunctionLength.js | 31 + .../es-abstract/2022/SetFunctionName.js | 44 + .../es-abstract/2022/SetIntegrityLevel.js | 57 + .../es-abstract/2022/SortIndexedProperties.js | 64 + .../es-abstract/2022/SpeciesConstructor.js | 32 + node_modules/es-abstract/2022/StringCreate.js | 40 + .../es-abstract/2022/StringGetOwnProperty.js | 48 + .../es-abstract/2022/StringIndexOf.js | 39 + node_modules/es-abstract/2022/StringPad.js | 43 + .../es-abstract/2022/StringToBigInt.js | 23 + .../es-abstract/2022/StringToCodePoints.js | 29 + .../es-abstract/2022/StringToNumber.js | 56 + .../2022/SymbolDescriptiveString.js | 20 + .../es-abstract/2022/TestIntegrityLevel.js | 42 + node_modules/es-abstract/2022/TimeClip.js | 21 + node_modules/es-abstract/2022/TimeFromYear.js | 11 + node_modules/es-abstract/2022/TimeString.js | 25 + .../es-abstract/2022/TimeWithinDay.js | 12 + node_modules/es-abstract/2022/ToBigInt.js | 25 + node_modules/es-abstract/2022/ToBigInt64.js | 25 + node_modules/es-abstract/2022/ToBigUint64.js | 22 + node_modules/es-abstract/2022/ToBoolean.js | 5 + node_modules/es-abstract/2022/ToDateString.js | 22 + node_modules/es-abstract/2022/ToIndex.js | 26 + node_modules/es-abstract/2022/ToInt16.js | 10 + node_modules/es-abstract/2022/ToInt32.js | 9 + node_modules/es-abstract/2022/ToInt8.js | 10 + .../es-abstract/2022/ToIntegerOrInfinity.js | 20 + node_modules/es-abstract/2022/ToLength.js | 12 + node_modules/es-abstract/2022/ToNumber.js | 26 + node_modules/es-abstract/2022/ToNumeric.js | 21 + node_modules/es-abstract/2022/ToObject.js | 14 + node_modules/es-abstract/2022/ToPrimitive.js | 12 + .../es-abstract/2022/ToPropertyDescriptor.js | 52 + .../es-abstract/2022/ToPropertyKey.js | 15 + node_modules/es-abstract/2022/ToString.js | 15 + node_modules/es-abstract/2022/ToUint16.js | 19 + node_modules/es-abstract/2022/ToUint32.js | 9 + node_modules/es-abstract/2022/ToUint8.js | 20 + node_modules/es-abstract/2022/ToUint8Clamp.js | 19 + .../2022/ToZeroPaddedDecimalString.js | 19 + node_modules/es-abstract/2022/TrimString.js | 29 + node_modules/es-abstract/2022/Type.js | 15 + .../es-abstract/2022/UTF16EncodeCodePoint.js | 25 + .../2022/UTF16SurrogatePairToCodePoint.js | 19 + .../es-abstract/2022/UnicodeEscape.js | 27 + .../ValidateAndApplyPropertyDescriptor.js | 177 + node_modules/es-abstract/2022/WeakRefDeref.js | 24 + node_modules/es-abstract/2022/WeekDay.js | 10 + node_modules/es-abstract/2022/YearFromTime.js | 16 + node_modules/es-abstract/2022/abs.js | 11 + node_modules/es-abstract/2022/clamp.js | 18 + node_modules/es-abstract/2022/floor.js | 11 + node_modules/es-abstract/2022/modulo.js | 9 + node_modules/es-abstract/2022/msFromTime.js | 11 + node_modules/es-abstract/2022/substring.js | 20 + .../es-abstract/2022/thisBigIntValue.js | 22 + .../es-abstract/2022/thisBooleanValue.js | 15 + .../es-abstract/2022/thisNumberValue.js | 18 + .../es-abstract/2022/thisStringValue.js | 15 + .../es-abstract/2022/thisSymbolValue.js | 19 + .../es-abstract/2022/thisTimeValue.js | 3 + .../5/AbstractEqualityComparison.js | 37 + .../5/AbstractRelationalComparison.js | 63 + .../es-abstract/5/CheckObjectCoercible.js | 14 + node_modules/es-abstract/5/DateFromTime.js | 54 + node_modules/es-abstract/5/Day.js | 11 + node_modules/es-abstract/5/DayFromYear.js | 10 + node_modules/es-abstract/5/DayWithinYear.js | 11 + node_modules/es-abstract/5/DaysInYear.js | 18 + .../es-abstract/5/FromPropertyDescriptor.js | 39 + node_modules/es-abstract/5/HourFromTime.js | 14 + node_modules/es-abstract/5/InLeapYear.js | 21 + .../es-abstract/5/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/5/IsCallable.js | 5 + .../es-abstract/5/IsDataDescriptor.js | 23 + .../es-abstract/5/IsGenericDescriptor.js | 23 + .../es-abstract/5/IsPropertyDescriptor.js | 19 + node_modules/es-abstract/5/MakeDate.js | 13 + node_modules/es-abstract/5/MakeDay.js | 33 + node_modules/es-abstract/5/MakeTime.js | 23 + node_modules/es-abstract/5/MinFromTime.js | 14 + node_modules/es-abstract/5/MonthFromTime.js | 47 + node_modules/es-abstract/5/SameValue.js | 13 + node_modules/es-abstract/5/SecFromTime.js | 14 + .../es-abstract/5/StrictEqualityComparison.js | 17 + node_modules/es-abstract/5/TimeClip.js | 21 + node_modules/es-abstract/5/TimeFromYear.js | 11 + node_modules/es-abstract/5/TimeWithinDay.js | 12 + node_modules/es-abstract/5/ToBoolean.js | 5 + node_modules/es-abstract/5/ToInt32.js | 9 + node_modules/es-abstract/5/ToInteger.js | 18 + node_modules/es-abstract/5/ToNumber.js | 20 + node_modules/es-abstract/5/ToObject.js | 14 + node_modules/es-abstract/5/ToPrimitive.js | 5 + .../es-abstract/5/ToPropertyDescriptor.js | 52 + node_modules/es-abstract/5/ToString.js | 12 + node_modules/es-abstract/5/ToUint16.js | 19 + node_modules/es-abstract/5/ToUint32.js | 9 + node_modules/es-abstract/5/Type.js | 24 + node_modules/es-abstract/5/WeekDay.js | 10 + node_modules/es-abstract/5/YearFromTime.js | 16 + node_modules/es-abstract/5/abs.js | 11 + node_modules/es-abstract/5/floor.js | 11 + node_modules/es-abstract/5/modulo.js | 9 + node_modules/es-abstract/5/msFromTime.js | 11 + node_modules/es-abstract/CHANGELOG.md | 613 + node_modules/es-abstract/GetIntrinsic.js | 5 + node_modules/es-abstract/LICENSE | 21 + node_modules/es-abstract/README.md | 43 + node_modules/es-abstract/es2015.js | 126 + node_modules/es-abstract/es2016.js | 131 + node_modules/es-abstract/es2017.js | 135 + node_modules/es-abstract/es2018.js | 143 + node_modules/es-abstract/es2019.js | 146 + node_modules/es-abstract/es2020.js | 169 + node_modules/es-abstract/es2021.js | 179 + node_modules/es-abstract/es2022.js | 189 + node_modules/es-abstract/es5.js | 51 + node_modules/es-abstract/es6.js | 3 + node_modules/es-abstract/es7.js | 3 + .../es-abstract/helpers/DefineOwnProperty.js | 55 + node_modules/es-abstract/helpers/IsArray.js | 12 + .../es-abstract/helpers/OwnPropertyKeys.js | 22 + .../es-abstract/helpers/assertRecord.js | 49 + node_modules/es-abstract/helpers/assign.js | 22 + node_modules/es-abstract/helpers/callBind.js | 5 + node_modules/es-abstract/helpers/callBound.js | 5 + node_modules/es-abstract/helpers/every.js | 10 + node_modules/es-abstract/helpers/forEach.js | 7 + .../helpers/fromPropertyDescriptor.js | 27 + .../es-abstract/helpers/getInferredName.js | 4 + .../es-abstract/helpers/getIteratorMethod.js | 47 + .../helpers/getOwnPropertyDescriptor.js | 15 + node_modules/es-abstract/helpers/getProto.js | 15 + .../helpers/getSymbolDescription.js | 4 + .../es-abstract/helpers/isAbstractClosure.js | 9 + .../es-abstract/helpers/isByteValue.js | 5 + .../es-abstract/helpers/isCodePoint.js | 5 + node_modules/es-abstract/helpers/isFinite.js | 5 + .../isFullyPopulatedPropertyDescriptor.js | 7 + .../es-abstract/helpers/isLeadingSurrogate.js | 5 + .../es-abstract/helpers/isMatchRecord.js | 16 + node_modules/es-abstract/helpers/isNaN.js | 5 + .../es-abstract/helpers/isPrefixOf.js | 13 + .../es-abstract/helpers/isPrimitive.js | 5 + .../helpers/isPropertyDescriptor.js | 31 + .../helpers/isSamePropertyDescriptor.js | 20 + .../helpers/isTrailingSurrogate.js | 5 + .../es-abstract/helpers/maxSafeInteger.js | 8 + node_modules/es-abstract/helpers/mod.js | 8 + node_modules/es-abstract/helpers/modBigInt.js | 6 + .../es-abstract/helpers/padTimeComponent.js | 9 + .../es-abstract/helpers/regexTester.js | 5 + node_modules/es-abstract/helpers/setProto.js | 16 + node_modules/es-abstract/helpers/sign.js | 5 + node_modules/es-abstract/helpers/some.js | 10 + .../es-abstract/helpers/timeConstants.js | 19 + node_modules/es-abstract/index.js | 32 + node_modules/es-abstract/operations/.eslintrc | 5 + node_modules/es-abstract/operations/2015.js | 741 + node_modules/es-abstract/operations/2016.js | 819 + node_modules/es-abstract/operations/2017.js | 963 + node_modules/es-abstract/operations/2018.js | 1042 + node_modules/es-abstract/operations/2019.js | 1057 + node_modules/es-abstract/operations/2020.js | 1246 ++ node_modules/es-abstract/operations/2021.js | 1309 ++ node_modules/es-abstract/operations/2022.js | 1399 ++ node_modules/es-abstract/package.json | 143 + node_modules/es-shim-unscopables/.eslintrc | 37 + .../es-shim-unscopables/.github/FUNDING.yml | 12 + node_modules/es-shim-unscopables/.nycrc | 9 + node_modules/es-shim-unscopables/CHANGELOG.md | 13 + node_modules/es-shim-unscopables/LICENSE | 21 + node_modules/es-shim-unscopables/README.md | 57 + node_modules/es-shim-unscopables/index.js | 21 + node_modules/es-shim-unscopables/package.json | 49 + .../es-shim-unscopables/test/index.js | 67 + node_modules/es-shim-unscopables/test/with.js | 35 + node_modules/es-to-primitive/.eslintrc | 22 + .../es-to-primitive/.github/FUNDING.yml | 12 + node_modules/es-to-primitive/.travis.yml | 15 + node_modules/es-to-primitive/CHANGELOG.md | 49 + node_modules/es-to-primitive/LICENSE | 22 + node_modules/es-to-primitive/Makefile | 61 + node_modules/es-to-primitive/README.md | 49 + node_modules/es-to-primitive/es2015.js | 75 + node_modules/es-to-primitive/es5.js | 45 + node_modules/es-to-primitive/es6.js | 3 + .../es-to-primitive/helpers/isPrimitive.js | 5 + node_modules/es-to-primitive/index.js | 17 + node_modules/es-to-primitive/package.json | 81 + node_modules/es-to-primitive/test/es2015.js | 151 + node_modules/es-to-primitive/test/es5.js | 118 + node_modules/es-to-primitive/test/es6.js | 151 + node_modules/es-to-primitive/test/index.js | 20 + node_modules/escape-string-regexp/index.d.ts | 18 + node_modules/escape-string-regexp/index.js | 13 + node_modules/escape-string-regexp/license | 9 + .../escape-string-regexp/package.json | 38 + node_modules/escape-string-regexp/readme.md | 34 + node_modules/eslint-plugin-react/LICENSE | 22 + node_modules/eslint-plugin-react/README.md | 283 + node_modules/eslint-plugin-react/index.js | 187 + .../lib/rules/boolean-prop-naming.js | 400 + .../lib/rules/button-has-type.js | 163 + .../rules/default-props-match-prop-types.js | 106 + .../lib/rules/destructuring-assignment.js | 280 + .../lib/rules/display-name.js | 264 + .../lib/rules/forbid-component-props.js | 114 + .../lib/rules/forbid-dom-props.js | 121 + .../lib/rules/forbid-elements.js | 114 + .../lib/rules/forbid-foreign-prop-types.js | 134 + .../lib/rules/forbid-prop-types.js | 293 + .../rules/function-component-definition.js | 284 + .../lib/rules/hook-use-state.js | 160 + .../lib/rules/iframe-missing-sandbox.js | 142 + .../lib/rules/jsx-boolean-value.js | 159 + .../lib/rules/jsx-child-element-spacing.js | 116 + .../lib/rules/jsx-closing-bracket-location.js | 308 + .../lib/rules/jsx-closing-tag-location.js | 73 + .../lib/rules/jsx-curly-brace-presence.js | 414 + .../lib/rules/jsx-curly-newline.js | 184 + .../lib/rules/jsx-curly-spacing.js | 430 + .../lib/rules/jsx-equals-spacing.js | 110 + .../lib/rules/jsx-filename-extension.js | 110 + .../lib/rules/jsx-first-prop-new-line.js | 76 + .../lib/rules/jsx-fragments.js | 209 + .../lib/rules/jsx-handler-names.js | 171 + .../lib/rules/jsx-indent-props.js | 213 + .../lib/rules/jsx-indent.js | 441 + .../eslint-plugin-react/lib/rules/jsx-key.js | 252 + .../lib/rules/jsx-max-depth.js | 166 + .../lib/rules/jsx-max-props-per-line.js | 154 + .../lib/rules/jsx-newline.js | 150 + .../lib/rules/jsx-no-bind.js | 208 + .../lib/rules/jsx-no-comment-textnodes.js | 64 + .../jsx-no-constructed-context-values.js | 218 + .../lib/rules/jsx-no-duplicate-props.js | 76 + .../lib/rules/jsx-no-leaked-render.js | 161 + .../lib/rules/jsx-no-literals.js | 192 + .../lib/rules/jsx-no-script-url.js | 97 + .../lib/rules/jsx-no-target-blank.js | 267 + .../lib/rules/jsx-no-undef.js | 115 + .../lib/rules/jsx-no-useless-fragment.js | 249 + .../lib/rules/jsx-one-expression-per-line.js | 233 + .../lib/rules/jsx-pascal-case.js | 163 + .../lib/rules/jsx-props-no-multi-spaces.js | 134 + .../lib/rules/jsx-props-no-spreading.js | 141 + .../lib/rules/jsx-sort-default-props.js | 173 + .../lib/rules/jsx-sort-props.js | 528 + .../lib/rules/jsx-space-before-closing.js | 95 + .../lib/rules/jsx-tag-spacing.js | 323 + .../lib/rules/jsx-uses-react.js | 46 + .../lib/rules/jsx-uses-vars.js | 60 + .../lib/rules/jsx-wrap-multilines.js | 260 + .../lib/rules/no-access-state-in-setstate.js | 187 + .../lib/rules/no-adjacent-inline-elements.js | 125 + .../lib/rules/no-array-index-key.js | 287 + .../lib/rules/no-arrow-function-lifecycle.js | 142 + .../lib/rules/no-children-prop.js | 119 + .../lib/rules/no-danger-with-children.js | 155 + .../lib/rules/no-danger.js | 74 + .../lib/rules/no-deprecated.js | 227 + .../lib/rules/no-did-mount-set-state.js | 10 + .../lib/rules/no-did-update-set-state.js | 10 + .../lib/rules/no-direct-mutation-state.js | 154 + .../lib/rules/no-find-dom-node.js | 50 + .../lib/rules/no-invalid-html-attribute.js | 592 + .../lib/rules/no-is-mounted.js | 55 + .../lib/rules/no-multi-comp.js | 79 + .../lib/rules/no-namespace.js | 61 + .../no-redundant-should-component-update.js | 87 + .../lib/rules/no-render-return-value.js | 81 + .../lib/rules/no-set-state.js | 85 + .../lib/rules/no-string-refs.js | 119 + .../lib/rules/no-this-in-sfc.js | 46 + .../eslint-plugin-react/lib/rules/no-typos.js | 259 + .../lib/rules/no-unescaped-entities.js | 133 + .../lib/rules/no-unknown-property.js | 601 + .../lib/rules/no-unsafe.js | 148 + .../rules/no-unstable-nested-components.js | 491 + .../no-unused-class-component-methods.js | 257 + .../lib/rules/no-unused-prop-types.js | 173 + .../lib/rules/no-unused-state.js | 520 + .../lib/rules/no-will-update-set-state.js | 14 + .../lib/rules/prefer-es6-class.js | 57 + .../lib/rules/prefer-exact-props.js | 161 + .../lib/rules/prefer-read-only-props.js | 89 + .../lib/rules/prefer-stateless-function.js | 392 + .../lib/rules/prop-types.js | 197 + .../lib/rules/react-in-jsx-scope.js | 56 + .../lib/rules/require-default-props.js | 197 + .../lib/rules/require-optimization.js | 237 + .../lib/rules/require-render-return.js | 104 + .../lib/rules/self-closing-comp.js | 103 + .../lib/rules/sort-comp.js | 446 + .../lib/rules/sort-prop-types.js | 266 + .../lib/rules/state-in-constructor.js | 67 + .../lib/rules/static-property-placement.js | 181 + .../lib/rules/style-prop-object.js | 137 + .../rules/void-dom-elements-no-children.js | 165 + .../eslint-plugin-react/lib/types.d.ts | 28 + .../lib/util/Components.js | 949 + .../lib/util/annotations.js | 32 + .../eslint-plugin-react/lib/util/ast.js | 461 + .../lib/util/componentUtil.js | 182 + .../lib/util/defaultProps.js | 268 + .../eslint-plugin-react/lib/util/docsUrl.js | 7 + .../eslint-plugin-react/lib/util/error.js | 14 + .../lib/util/getTokenBeforeClosingBracket.js | 16 + .../lib/util/isCreateElement.js | 34 + .../util/isDestructuredFromPragmaImport.js | 79 + .../lib/util/isFirstLetterCapitalized.js | 16 + .../eslint-plugin-react/lib/util/jsx.js | 196 + .../lib/util/lifecycleMethods.js | 30 + .../lib/util/linkComponents.js | 46 + .../eslint-plugin-react/lib/util/log.js | 14 + .../lib/util/makeNoMethodSetStateRule.js | 119 + .../eslint-plugin-react/lib/util/pragma.js | 72 + .../eslint-plugin-react/lib/util/propTypes.js | 1248 ++ .../lib/util/propTypesSort.js | 164 + .../lib/util/propWrapper.js | 58 + .../eslint-plugin-react/lib/util/props.js | 103 + .../eslint-plugin-react/lib/util/report.js | 13 + .../lib/util/usedPropTypes.js | 567 + .../eslint-plugin-react/lib/util/variable.js | 94 + .../eslint-plugin-react/lib/util/version.js | 160 + .../node_modules/doctrine/CHANGELOG.md | 94 + .../node_modules/doctrine/LICENSE | 177 + .../doctrine/LICENSE.closure-compiler | 202 + .../node_modules/doctrine/LICENSE.esprima | 19 + .../node_modules/doctrine/README.md | 165 + .../node_modules/doctrine/lib/doctrine.js | 899 + .../node_modules/doctrine/lib/typed.js | 1305 ++ .../node_modules/doctrine/lib/utility.js | 35 + .../node_modules/doctrine/package.json | 57 + node_modules/eslint-plugin-react/package.json | 102 + node_modules/eslint-scope/LICENSE | 22 + node_modules/eslint-scope/README.md | 66 + .../eslint-scope/dist/eslint-scope.cjs | 2240 ++ node_modules/eslint-scope/lib/definition.js | 85 + node_modules/eslint-scope/lib/index.js | 172 + .../eslint-scope/lib/pattern-visitor.js | 153 + node_modules/eslint-scope/lib/reference.js | 166 + node_modules/eslint-scope/lib/referencer.js | 654 + .../eslint-scope/lib/scope-manager.js | 255 + node_modules/eslint-scope/lib/scope.js | 772 + node_modules/eslint-scope/lib/variable.js | 87 + node_modules/eslint-scope/lib/version.js | 3 + node_modules/eslint-scope/package.json | 62 + node_modules/eslint-utils/LICENSE | 21 + node_modules/eslint-utils/README.md | 38 + node_modules/eslint-utils/index.js | 1956 ++ node_modules/eslint-utils/index.js.map | 1 + node_modules/eslint-utils/index.mjs | 1914 ++ node_modules/eslint-utils/index.mjs.map | 1 + .../eslint-visitor-keys/CHANGELOG.md | 36 + .../node_modules/eslint-visitor-keys/LICENSE | 201 + .../eslint-visitor-keys/README.md | 98 + .../eslint-visitor-keys/lib/index.js | 81 + .../eslint-visitor-keys/lib/visitor-keys.json | 289 + .../eslint-visitor-keys/package.json | 39 + node_modules/eslint-utils/package.json | 78 + node_modules/eslint-visitor-keys/LICENSE | 201 + node_modules/eslint-visitor-keys/README.md | 107 + .../dist/eslint-visitor-keys.cjs | 382 + .../eslint-visitor-keys/dist/index.d.ts | 18 + .../dist/visitor-keys.d.ts | 10 + node_modules/eslint-visitor-keys/lib/index.js | 65 + .../eslint-visitor-keys/lib/visitor-keys.js | 312 + node_modules/eslint-visitor-keys/package.json | 62 + node_modules/eslint/LICENSE | 19 + node_modules/eslint/README.md | 298 + node_modules/eslint/bin/eslint.js | 140 + node_modules/eslint/conf/config-schema.js | 93 + .../eslint/conf/default-cli-options.js | 32 + node_modules/eslint/conf/eslint-all.js | 31 + .../eslint/conf/eslint-recommended.js | 76 + node_modules/eslint/conf/globals.js | 149 + node_modules/eslint/conf/replacements.json | 22 + node_modules/eslint/conf/rule-type-list.json | 36 + node_modules/eslint/lib/api.js | 26 + .../eslint/lib/cli-engine/cli-engine.js | 1067 + .../eslint/lib/cli-engine/file-enumerator.js | 545 + .../lib/cli-engine/formatters/checkstyle.js | 60 + .../lib/cli-engine/formatters/compact.js | 60 + .../eslint/lib/cli-engine/formatters/html.js | 326 + .../lib/cli-engine/formatters/jslint-xml.js | 41 + .../formatters/json-with-metadata.js | 16 + .../eslint/lib/cli-engine/formatters/json.js | 13 + .../eslint/lib/cli-engine/formatters/junit.js | 82 + .../lib/cli-engine/formatters/stylish.js | 101 + .../eslint/lib/cli-engine/formatters/tap.js | 95 + .../eslint/lib/cli-engine/formatters/unix.js | 58 + .../lib/cli-engine/formatters/visualstudio.js | 63 + node_modules/eslint/lib/cli-engine/hash.js | 35 + node_modules/eslint/lib/cli-engine/index.js | 7 + .../lib/cli-engine/lint-result-cache.js | 191 + .../eslint/lib/cli-engine/load-rules.js | 46 + .../eslint/lib/cli-engine/xml-escape.js | 34 + node_modules/eslint/lib/cli.js | 446 + .../eslint/lib/config/default-config.js | 70 + .../eslint/lib/config/flat-config-array.js | 214 + .../eslint/lib/config/flat-config-helpers.js | 111 + .../eslint/lib/config/flat-config-schema.js | 457 + .../eslint/lib/config/rule-validator.js | 157 + .../eslint/lib/eslint/eslint-helpers.js | 642 + node_modules/eslint/lib/eslint/eslint.js | 700 + node_modules/eslint/lib/eslint/flat-eslint.js | 1135 + node_modules/eslint/lib/eslint/index.js | 9 + .../lib/linter/apply-disable-directives.js | 341 + .../code-path-analysis/code-path-analyzer.js | 844 + .../code-path-analysis/code-path-segment.js | 235 + .../code-path-analysis/code-path-state.js | 1483 ++ .../linter/code-path-analysis/code-path.js | 247 + .../code-path-analysis/debug-helpers.js | 203 + .../linter/code-path-analysis/fork-context.js | 248 + .../linter/code-path-analysis/id-generator.js | 45 + .../lib/linter/config-comment-parser.js | 144 + node_modules/eslint/lib/linter/index.js | 13 + node_modules/eslint/lib/linter/interpolate.js | 28 + node_modules/eslint/lib/linter/linter.js | 2078 ++ .../eslint/lib/linter/node-event-generator.js | 354 + .../eslint/lib/linter/report-translator.js | 368 + node_modules/eslint/lib/linter/rule-fixer.js | 140 + node_modules/eslint/lib/linter/rules.js | 80 + .../eslint/lib/linter/safe-emitter.js | 52 + .../eslint/lib/linter/source-code-fixer.js | 152 + node_modules/eslint/lib/linter/timing.js | 161 + node_modules/eslint/lib/options.js | 377 + .../lib/rule-tester/flat-rule-tester.js | 1042 + node_modules/eslint/lib/rule-tester/index.js | 5 + .../eslint/lib/rule-tester/rule-tester.js | 1050 + .../eslint/lib/rules/accessor-pairs.js | 354 + .../eslint/lib/rules/array-bracket-newline.js | 258 + .../eslint/lib/rules/array-bracket-spacing.js | 241 + .../eslint/lib/rules/array-callback-return.js | 296 + .../eslint/lib/rules/array-element-newline.js | 301 + .../eslint/lib/rules/arrow-body-style.js | 296 + node_modules/eslint/lib/rules/arrow-parens.js | 183 + .../eslint/lib/rules/arrow-spacing.js | 161 + .../eslint/lib/rules/block-scoped-var.js | 124 + .../eslint/lib/rules/block-spacing.js | 171 + node_modules/eslint/lib/rules/brace-style.js | 194 + .../eslint/lib/rules/callback-return.js | 187 + node_modules/eslint/lib/rules/camelcase.js | 398 + .../eslint/lib/rules/capitalized-comments.js | 300 + .../lib/rules/class-methods-use-this.js | 187 + node_modules/eslint/lib/rules/comma-dangle.js | 370 + .../eslint/lib/rules/comma-spacing.js | 189 + node_modules/eslint/lib/rules/comma-style.js | 311 + node_modules/eslint/lib/rules/complexity.js | 165 + .../lib/rules/computed-property-spacing.js | 205 + .../eslint/lib/rules/consistent-return.js | 185 + .../eslint/lib/rules/consistent-this.js | 151 + .../eslint/lib/rules/constructor-super.js | 423 + node_modules/eslint/lib/rules/curly.js | 486 + .../eslint/lib/rules/default-case-last.js | 44 + node_modules/eslint/lib/rules/default-case.js | 97 + .../eslint/lib/rules/default-param-last.js | 62 + node_modules/eslint/lib/rules/dot-location.js | 105 + node_modules/eslint/lib/rules/dot-notation.js | 177 + node_modules/eslint/lib/rules/eol-last.js | 112 + node_modules/eslint/lib/rules/eqeqeq.js | 174 + .../eslint/lib/rules/for-direction.js | 126 + .../eslint/lib/rules/func-call-spacing.js | 230 + .../eslint/lib/rules/func-name-matching.js | 253 + node_modules/eslint/lib/rules/func-names.js | 191 + node_modules/eslint/lib/rules/func-style.js | 98 + .../rules/function-call-argument-newline.js | 122 + .../lib/rules/function-paren-newline.js | 289 + .../lib/rules/generator-star-spacing.js | 206 + .../eslint/lib/rules/getter-return.js | 173 + .../eslint/lib/rules/global-require.js | 88 + .../lib/rules/grouped-accessor-pairs.js | 224 + node_modules/eslint/lib/rules/guard-for-in.js | 76 + .../eslint/lib/rules/handle-callback-err.js | 100 + node_modules/eslint/lib/rules/id-blacklist.js | 245 + node_modules/eslint/lib/rules/id-denylist.js | 227 + node_modules/eslint/lib/rules/id-length.js | 210 + node_modules/eslint/lib/rules/id-match.js | 298 + .../lib/rules/implicit-arrow-linebreak.js | 81 + .../eslint/lib/rules/indent-legacy.js | 1126 + node_modules/eslint/lib/rules/indent.js | 1804 ++ node_modules/eslint/lib/rules/index.js | 303 + .../eslint/lib/rules/init-declarations.js | 139 + node_modules/eslint/lib/rules/jsx-quotes.js | 95 + node_modules/eslint/lib/rules/key-spacing.js | 678 + .../eslint/lib/rules/keyword-spacing.js | 637 + .../eslint/lib/rules/line-comment-position.js | 122 + .../eslint/lib/rules/linebreak-style.js | 105 + .../eslint/lib/rules/lines-around-comment.js | 457 + .../lib/rules/lines-around-directive.js | 201 + .../lib/rules/lines-between-class-members.js | 181 + .../lib/rules/logical-assignment-operators.js | 474 + .../eslint/lib/rules/max-classes-per-file.js | 89 + node_modules/eslint/lib/rules/max-depth.js | 156 + node_modules/eslint/lib/rules/max-len.js | 433 + .../lib/rules/max-lines-per-function.js | 213 + node_modules/eslint/lib/rules/max-lines.js | 193 + .../eslint/lib/rules/max-nested-callbacks.js | 117 + node_modules/eslint/lib/rules/max-params.js | 102 + .../lib/rules/max-statements-per-line.js | 196 + .../eslint/lib/rules/max-statements.js | 184 + .../lib/rules/multiline-comment-style.js | 435 + .../eslint/lib/rules/multiline-ternary.js | 171 + node_modules/eslint/lib/rules/new-cap.js | 276 + node_modules/eslint/lib/rules/new-parens.js | 99 + .../eslint/lib/rules/newline-after-var.js | 255 + .../eslint/lib/rules/newline-before-return.js | 217 + .../lib/rules/newline-per-chained-call.js | 123 + node_modules/eslint/lib/rules/no-alert.js | 136 + .../eslint/lib/rules/no-array-constructor.js | 54 + .../lib/rules/no-async-promise-executor.js | 39 + .../eslint/lib/rules/no-await-in-loop.js | 106 + node_modules/eslint/lib/rules/no-bitwise.js | 119 + .../eslint/lib/rules/no-buffer-constructor.js | 50 + node_modules/eslint/lib/rules/no-caller.js | 46 + .../eslint/lib/rules/no-case-declarations.js | 64 + .../eslint/lib/rules/no-catch-shadow.js | 80 + .../eslint/lib/rules/no-class-assign.js | 61 + .../eslint/lib/rules/no-compare-neg-zero.js | 60 + .../eslint/lib/rules/no-cond-assign.js | 159 + .../eslint/lib/rules/no-confusing-arrow.js | 89 + node_modules/eslint/lib/rules/no-console.js | 134 + .../eslint/lib/rules/no-const-assign.js | 54 + .../rules/no-constant-binary-expression.js | 500 + .../eslint/lib/rules/no-constant-condition.js | 149 + .../eslint/lib/rules/no-constructor-return.js | 62 + node_modules/eslint/lib/rules/no-continue.js | 39 + .../eslint/lib/rules/no-control-regex.js | 125 + node_modules/eslint/lib/rules/no-debugger.js | 43 + .../eslint/lib/rules/no-delete-var.js | 42 + node_modules/eslint/lib/rules/no-div-regex.js | 53 + node_modules/eslint/lib/rules/no-dupe-args.js | 80 + .../eslint/lib/rules/no-dupe-class-members.js | 104 + .../eslint/lib/rules/no-dupe-else-if.js | 122 + node_modules/eslint/lib/rules/no-dupe-keys.js | 142 + .../eslint/lib/rules/no-duplicate-case.js | 71 + .../eslint/lib/rules/no-duplicate-imports.js | 290 + .../eslint/lib/rules/no-else-return.js | 404 + .../lib/rules/no-empty-character-class.js | 55 + .../eslint/lib/rules/no-empty-function.js | 167 + .../eslint/lib/rules/no-empty-pattern.js | 43 + node_modules/eslint/lib/rules/no-empty.js | 86 + node_modules/eslint/lib/rules/no-eq-null.js | 46 + node_modules/eslint/lib/rules/no-eval.js | 286 + node_modules/eslint/lib/rules/no-ex-assign.js | 52 + .../eslint/lib/rules/no-extend-native.js | 178 + .../eslint/lib/rules/no-extra-bind.js | 213 + .../eslint/lib/rules/no-extra-boolean-cast.js | 317 + .../eslint/lib/rules/no-extra-label.js | 149 + .../eslint/lib/rules/no-extra-parens.js | 1235 ++ .../eslint/lib/rules/no-extra-semi.js | 126 + .../eslint/lib/rules/no-fallthrough.js | 152 + .../eslint/lib/rules/no-floating-decimal.js | 70 + .../eslint/lib/rules/no-func-assign.js | 76 + .../eslint/lib/rules/no-global-assign.js | 94 + .../eslint/lib/rules/no-implicit-coercion.js | 361 + .../eslint/lib/rules/no-implicit-globals.js | 140 + .../eslint/lib/rules/no-implied-eval.js | 131 + .../eslint/lib/rules/no-import-assign.js | 239 + .../eslint/lib/rules/no-inline-comments.js | 110 + .../eslint/lib/rules/no-inner-declarations.js | 110 + .../eslint/lib/rules/no-invalid-regexp.js | 157 + .../eslint/lib/rules/no-invalid-this.js | 150 + .../lib/rules/no-irregular-whitespace.js | 259 + node_modules/eslint/lib/rules/no-iterator.js | 52 + node_modules/eslint/lib/rules/no-label-var.js | 79 + node_modules/eslint/lib/rules/no-labels.js | 149 + .../eslint/lib/rules/no-lone-blocks.js | 134 + node_modules/eslint/lib/rules/no-lonely-if.js | 89 + node_modules/eslint/lib/rules/no-loop-func.js | 204 + .../eslint/lib/rules/no-loss-of-precision.js | 206 + .../eslint/lib/rules/no-magic-numbers.js | 226 + .../rules/no-misleading-character-class.js | 273 + .../eslint/lib/rules/no-mixed-operators.js | 226 + .../eslint/lib/rules/no-mixed-requires.js | 238 + .../lib/rules/no-mixed-spaces-and-tabs.js | 113 + .../eslint/lib/rules/no-multi-assign.js | 67 + .../eslint/lib/rules/no-multi-spaces.js | 138 + node_modules/eslint/lib/rules/no-multi-str.js | 65 + .../lib/rules/no-multiple-empty-lines.js | 151 + .../eslint/lib/rules/no-native-reassign.js | 97 + .../eslint/lib/rules/no-negated-condition.js | 95 + .../eslint/lib/rules/no-negated-in-lhs.js | 46 + .../eslint/lib/rules/no-nested-ternary.js | 44 + node_modules/eslint/lib/rules/no-new-func.js | 86 + .../eslint/lib/rules/no-new-object.js | 57 + .../eslint/lib/rules/no-new-require.js | 50 + .../eslint/lib/rules/no-new-symbol.js | 54 + .../eslint/lib/rules/no-new-wrappers.js | 48 + node_modules/eslint/lib/rules/no-new.js | 43 + .../lib/rules/no-nonoctal-decimal-escape.js | 148 + node_modules/eslint/lib/rules/no-obj-calls.js | 84 + .../eslint/lib/rules/no-octal-escape.js | 56 + node_modules/eslint/lib/rules/no-octal.js | 45 + .../eslint/lib/rules/no-param-reassign.js | 229 + .../eslint/lib/rules/no-path-concat.js | 64 + node_modules/eslint/lib/rules/no-plusplus.js | 105 + .../eslint/lib/rules/no-process-env.js | 51 + .../eslint/lib/rules/no-process-exit.js | 47 + .../lib/rules/no-promise-executor-return.js | 121 + node_modules/eslint/lib/rules/no-proto.js | 48 + .../eslint/lib/rules/no-prototype-builtins.js | 71 + node_modules/eslint/lib/rules/no-redeclare.js | 174 + .../eslint/lib/rules/no-regex-spaces.js | 180 + .../eslint/lib/rules/no-restricted-exports.js | 96 + .../eslint/lib/rules/no-restricted-globals.js | 122 + .../eslint/lib/rules/no-restricted-imports.js | 387 + .../eslint/lib/rules/no-restricted-modules.js | 216 + .../lib/rules/no-restricted-properties.js | 181 + .../eslint/lib/rules/no-restricted-syntax.js | 70 + .../eslint/lib/rules/no-return-assign.js | 80 + .../eslint/lib/rules/no-return-await.js | 103 + .../eslint/lib/rules/no-script-url.js | 61 + .../eslint/lib/rules/no-self-assign.js | 183 + .../eslint/lib/rules/no-self-compare.js | 60 + node_modules/eslint/lib/rules/no-sequences.js | 138 + .../eslint/lib/rules/no-setter-return.js | 225 + .../lib/rules/no-shadow-restricted-names.js | 64 + node_modules/eslint/lib/rules/no-shadow.js | 335 + .../eslint/lib/rules/no-spaced-func.js | 83 + .../eslint/lib/rules/no-sparse-arrays.js | 50 + node_modules/eslint/lib/rules/no-sync.js | 64 + node_modules/eslint/lib/rules/no-tabs.js | 78 + .../lib/rules/no-template-curly-in-string.js | 44 + node_modules/eslint/lib/rules/no-ternary.js | 41 + .../eslint/lib/rules/no-this-before-super.js | 304 + .../eslint/lib/rules/no-throw-literal.js | 51 + .../eslint/lib/rules/no-trailing-spaces.js | 190 + .../eslint/lib/rules/no-undef-init.js | 75 + node_modules/eslint/lib/rules/no-undef.js | 78 + node_modules/eslint/lib/rules/no-undefined.js | 84 + .../eslint/lib/rules/no-underscore-dangle.js | 309 + .../lib/rules/no-unexpected-multiline.js | 120 + .../lib/rules/no-unmodified-loop-condition.js | 360 + .../eslint/lib/rules/no-unneeded-ternary.js | 166 + .../eslint/lib/rules/no-unreachable-loop.js | 150 + .../eslint/lib/rules/no-unreachable.js | 264 + .../eslint/lib/rules/no-unsafe-finally.js | 111 + .../eslint/lib/rules/no-unsafe-negation.js | 128 + .../lib/rules/no-unsafe-optional-chaining.js | 205 + .../eslint/lib/rules/no-unused-expressions.js | 189 + .../eslint/lib/rules/no-unused-labels.js | 110 + .../rules/no-unused-private-class-members.js | 195 + .../eslint/lib/rules/no-unused-vars.js | 717 + .../eslint/lib/rules/no-use-before-define.js | 347 + .../lib/rules/no-useless-backreference.js | 192 + .../eslint/lib/rules/no-useless-call.js | 90 + .../eslint/lib/rules/no-useless-catch.js | 57 + .../lib/rules/no-useless-computed-key.js | 168 + .../eslint/lib/rules/no-useless-concat.js | 115 + .../lib/rules/no-useless-constructor.js | 189 + .../eslint/lib/rules/no-useless-escape.js | 254 + .../eslint/lib/rules/no-useless-rename.js | 172 + .../eslint/lib/rules/no-useless-return.js | 305 + node_modules/eslint/lib/rules/no-var.js | 334 + node_modules/eslint/lib/rules/no-void.js | 64 + .../eslint/lib/rules/no-warning-comments.js | 201 + .../rules/no-whitespace-before-property.js | 113 + node_modules/eslint/lib/rules/no-with.js | 39 + .../rules/nonblock-statement-body-position.js | 124 + .../eslint/lib/rules/object-curly-newline.js | 321 + .../eslint/lib/rules/object-curly-spacing.js | 308 + .../lib/rules/object-property-newline.js | 99 + .../eslint/lib/rules/object-shorthand.js | 519 + .../lib/rules/one-var-declaration-per-line.js | 92 + node_modules/eslint/lib/rules/one-var.js | 567 + .../eslint/lib/rules/operator-assignment.js | 209 + .../eslint/lib/rules/operator-linebreak.js | 250 + .../eslint/lib/rules/padded-blocks.js | 307 + .../rules/padding-line-between-statements.js | 632 + .../eslint/lib/rules/prefer-arrow-callback.js | 380 + node_modules/eslint/lib/rules/prefer-const.js | 501 + .../eslint/lib/rules/prefer-destructuring.js | 301 + .../rules/prefer-exponentiation-operator.js | 190 + .../lib/rules/prefer-named-capture-group.js | 110 + .../lib/rules/prefer-numeric-literals.js | 148 + .../eslint/lib/rules/prefer-object-has-own.js | 112 + .../eslint/lib/rules/prefer-object-spread.js | 299 + .../lib/rules/prefer-promise-reject-errors.js | 131 + .../eslint/lib/rules/prefer-reflect.js | 127 + .../eslint/lib/rules/prefer-regex-literals.js | 396 + .../eslint/lib/rules/prefer-rest-params.js | 115 + .../eslint/lib/rules/prefer-spread.js | 87 + .../eslint/lib/rules/prefer-template.js | 275 + node_modules/eslint/lib/rules/quote-props.js | 307 + node_modules/eslint/lib/rules/quotes.js | 347 + node_modules/eslint/lib/rules/radix.js | 198 + .../lib/rules/require-atomic-updates.js | 317 + .../eslint/lib/rules/require-await.js | 113 + .../eslint/lib/rules/require-jsdoc.js | 122 + .../lib/rules/require-unicode-regexp.js | 69 + .../eslint/lib/rules/require-yield.js | 77 + .../eslint/lib/rules/rest-spread-spacing.js | 120 + node_modules/eslint/lib/rules/semi-spacing.js | 245 + node_modules/eslint/lib/rules/semi-style.js | 155 + node_modules/eslint/lib/rules/semi.js | 410 + node_modules/eslint/lib/rules/sort-imports.js | 241 + node_modules/eslint/lib/rules/sort-keys.js | 230 + node_modules/eslint/lib/rules/sort-vars.js | 104 + .../eslint/lib/rules/space-before-blocks.js | 201 + .../lib/rules/space-before-function-paren.js | 164 + .../eslint/lib/rules/space-in-parens.js | 282 + .../eslint/lib/rules/space-infix-ops.js | 195 + .../eslint/lib/rules/space-unary-ops.js | 321 + .../eslint/lib/rules/spaced-comment.js | 382 + node_modules/eslint/lib/rules/strict.js | 277 + .../eslint/lib/rules/switch-colon-spacing.js | 129 + .../eslint/lib/rules/symbol-description.js | 71 + .../lib/rules/template-curly-spacing.js | 141 + .../eslint/lib/rules/template-tag-spacing.js | 90 + node_modules/eslint/lib/rules/unicode-bom.js | 73 + node_modules/eslint/lib/rules/use-isnan.js | 141 + .../eslint/lib/rules/utils/ast-utils.js | 2124 ++ .../eslint/lib/rules/utils/fix-tracker.js | 114 + .../eslint/lib/rules/utils/keywords.js | 67 + .../lib/rules/utils/lazy-loading-rule-map.js | 115 + .../lib/rules/utils/patterns/letters.js | 36 + .../eslint/lib/rules/utils/unicode/index.js | 11 + .../utils/unicode/is-combining-character.js | 13 + .../rules/utils/unicode/is-emoji-modifier.js | 13 + .../unicode/is-regional-indicator-symbol.js | 13 + .../rules/utils/unicode/is-surrogate-pair.js | 14 + node_modules/eslint/lib/rules/valid-jsdoc.js | 516 + node_modules/eslint/lib/rules/valid-typeof.js | 121 + node_modules/eslint/lib/rules/vars-on-top.js | 157 + node_modules/eslint/lib/rules/wrap-iife.js | 204 + node_modules/eslint/lib/rules/wrap-regex.js | 59 + .../eslint/lib/rules/yield-star-spacing.js | 127 + node_modules/eslint/lib/rules/yoda.js | 362 + node_modules/eslint/lib/shared/ajv.js | 34 + node_modules/eslint/lib/shared/ast-utils.js | 29 + .../eslint/lib/shared/config-validator.js | 347 + .../eslint/lib/shared/deprecation-warnings.js | 58 + node_modules/eslint/lib/shared/logging.js | 30 + .../lib/shared/relative-module-resolver.js | 50 + .../eslint/lib/shared/runtime-info.js | 167 + .../eslint/lib/shared/string-utils.js | 22 + node_modules/eslint/lib/shared/traverser.js | 195 + node_modules/eslint/lib/shared/types.js | 212 + node_modules/eslint/lib/source-code/index.js | 5 + .../eslint/lib/source-code/source-code.js | 593 + .../backward-token-comment-cursor.js | 57 + .../token-store/backward-token-cursor.js | 58 + .../lib/source-code/token-store/cursor.js | 76 + .../lib/source-code/token-store/cursors.js | 90 + .../token-store/decorative-cursor.js | 39 + .../source-code/token-store/filter-cursor.js | 43 + .../forward-token-comment-cursor.js | 57 + .../token-store/forward-token-cursor.js | 63 + .../lib/source-code/token-store/index.js | 627 + .../source-code/token-store/limit-cursor.js | 40 + .../token-store/padded-token-cursor.js | 38 + .../source-code/token-store/skip-cursor.js | 42 + .../lib/source-code/token-store/utils.js | 92 + node_modules/eslint/lib/unsupported-api.js | 27 + .../eslint/messages/all-files-ignored.js | 16 + .../eslint/messages/extend-config-missing.js | 13 + .../eslint/messages/failed-to-read-json.js | 11 + .../eslint/messages/file-not-found.js | 10 + .../eslint/messages/no-config-found.js | 15 + .../eslint/messages/plugin-conflict.js | 22 + .../eslint/messages/plugin-invalid.js | 16 + .../eslint/messages/plugin-missing.js | 19 + .../print-config-with-directory-path.js | 8 + .../eslint/messages/whitespace-found.js | 11 + node_modules/eslint/package.json | 169 + node_modules/espree/LICENSE | 25 + node_modules/espree/README.md | 244 + node_modules/espree/dist/espree.cjs | 938 + node_modules/espree/espree.js | 173 + node_modules/espree/lib/espree.js | 348 + node_modules/espree/lib/features.js | 27 + node_modules/espree/lib/options.js | 122 + node_modules/espree/lib/token-translator.js | 265 + node_modules/espree/lib/version.js | 3 + node_modules/espree/package.json | 82 + node_modules/esquery/README.md | 27 + node_modules/esquery/dist/esquery.esm.js | 4793 ++++ node_modules/esquery/dist/esquery.esm.min.js | 2 + .../esquery/dist/esquery.esm.min.js.map | 1 + node_modules/esquery/dist/esquery.js | 4801 ++++ node_modules/esquery/dist/esquery.lite.js | 3995 ++++ node_modules/esquery/dist/esquery.lite.min.js | 2 + .../esquery/dist/esquery.lite.min.js.map | 1 + node_modules/esquery/dist/esquery.min.js | 2 + node_modules/esquery/dist/esquery.min.js.map | 1 + node_modules/esquery/license.txt | 24 + node_modules/esquery/package.json | 78 + node_modules/esquery/parser.js | 2602 +++ node_modules/esrecurse/.babelrc | 3 + node_modules/esrecurse/README.md | 171 + node_modules/esrecurse/esrecurse.js | 117 + node_modules/esrecurse/gulpfile.babel.js | 92 + node_modules/esrecurse/package.json | 52 + node_modules/estraverse/.jshintrc | 16 + node_modules/estraverse/LICENSE.BSD | 19 + node_modules/estraverse/README.md | 153 + node_modules/estraverse/estraverse.js | 805 + node_modules/estraverse/gulpfile.js | 70 + node_modules/estraverse/package.json | 40 + node_modules/esutils/LICENSE.BSD | 19 + node_modules/esutils/README.md | 174 + node_modules/esutils/lib/ast.js | 144 + node_modules/esutils/lib/code.js | 135 + node_modules/esutils/lib/keyword.js | 165 + node_modules/esutils/lib/utils.js | 33 + node_modules/esutils/package.json | 44 + node_modules/fast-deep-equal/LICENSE | 21 + node_modules/fast-deep-equal/README.md | 96 + node_modules/fast-deep-equal/es6/index.d.ts | 2 + node_modules/fast-deep-equal/es6/index.js | 72 + node_modules/fast-deep-equal/es6/react.d.ts | 2 + node_modules/fast-deep-equal/es6/react.js | 79 + node_modules/fast-deep-equal/index.d.ts | 4 + node_modules/fast-deep-equal/index.js | 46 + node_modules/fast-deep-equal/package.json | 61 + node_modules/fast-deep-equal/react.d.ts | 2 + node_modules/fast-deep-equal/react.js | 53 + node_modules/fast-glob/LICENSE | 21 + node_modules/fast-glob/README.md | 795 + .../node_modules/glob-parent/CHANGELOG.md | 110 + .../node_modules/glob-parent/LICENSE | 15 + .../node_modules/glob-parent/README.md | 137 + .../node_modules/glob-parent/index.js | 42 + .../node_modules/glob-parent/package.json | 48 + node_modules/fast-glob/out/index.d.ts | 27 + node_modules/fast-glob/out/index.js | 68 + .../fast-glob/out/managers/patterns.d.ts | 6 + .../fast-glob/out/managers/patterns.js | 21 + .../fast-glob/out/managers/tasks.d.ts | 22 + node_modules/fast-glob/out/managers/tasks.js | 80 + .../fast-glob/out/providers/async.d.ts | 9 + node_modules/fast-glob/out/providers/async.js | 23 + .../fast-glob/out/providers/filters/deep.d.ts | 16 + .../fast-glob/out/providers/filters/deep.js | 62 + .../out/providers/filters/entry.d.ts | 16 + .../fast-glob/out/providers/filters/entry.js | 64 + .../out/providers/filters/error.d.ts | 8 + .../fast-glob/out/providers/filters/error.js | 15 + .../out/providers/matchers/matcher.d.ts | 33 + .../out/providers/matchers/matcher.js | 50 + .../out/providers/matchers/partial.d.ts | 4 + .../out/providers/matchers/partial.js | 38 + .../fast-glob/out/providers/provider.d.ts | 19 + .../fast-glob/out/providers/provider.js | 48 + .../fast-glob/out/providers/stream.d.ts | 11 + .../fast-glob/out/providers/stream.js | 31 + .../fast-glob/out/providers/sync.d.ts | 9 + node_modules/fast-glob/out/providers/sync.js | 23 + .../out/providers/transformers/entry.d.ts | 8 + .../out/providers/transformers/entry.js | 26 + node_modules/fast-glob/out/readers/async.d.ts | 10 + node_modules/fast-glob/out/readers/async.js | 35 + .../fast-glob/out/readers/reader.d.ts | 15 + node_modules/fast-glob/out/readers/reader.js | 33 + .../fast-glob/out/readers/stream.d.ts | 14 + node_modules/fast-glob/out/readers/stream.js | 55 + node_modules/fast-glob/out/readers/sync.d.ts | 12 + node_modules/fast-glob/out/readers/sync.js | 43 + node_modules/fast-glob/out/settings.d.ts | 164 + node_modules/fast-glob/out/settings.js | 57 + node_modules/fast-glob/out/types/index.d.ts | 31 + node_modules/fast-glob/out/types/index.js | 2 + node_modules/fast-glob/out/utils/array.d.ts | 2 + node_modules/fast-glob/out/utils/array.js | 22 + node_modules/fast-glob/out/utils/errno.d.ts | 2 + node_modules/fast-glob/out/utils/errno.js | 7 + node_modules/fast-glob/out/utils/fs.d.ts | 4 + node_modules/fast-glob/out/utils/fs.js | 19 + node_modules/fast-glob/out/utils/index.d.ts | 8 + node_modules/fast-glob/out/utils/index.js | 17 + node_modules/fast-glob/out/utils/path.d.ts | 8 + node_modules/fast-glob/out/utils/path.js | 33 + node_modules/fast-glob/out/utils/pattern.d.ts | 42 + node_modules/fast-glob/out/utils/pattern.js | 169 + node_modules/fast-glob/out/utils/stream.d.ts | 3 + node_modules/fast-glob/out/utils/stream.js | 17 + node_modules/fast-glob/out/utils/string.d.ts | 2 + node_modules/fast-glob/out/utils/string.js | 11 + node_modules/fast-glob/package.json | 94 + .../fast-json-stable-stringify/.eslintrc.yml | 26 + .../.github/FUNDING.yml | 1 + .../fast-json-stable-stringify/.travis.yml | 8 + .../fast-json-stable-stringify/LICENSE | 21 + .../fast-json-stable-stringify/README.md | 131 + .../benchmark/index.js | 31 + .../benchmark/test.json | 137 + .../example/key_cmp.js | 7 + .../example/nested.js | 3 + .../fast-json-stable-stringify/example/str.js | 3 + .../example/value_cmp.js | 7 + .../fast-json-stable-stringify/index.d.ts | 4 + .../fast-json-stable-stringify/index.js | 59 + .../fast-json-stable-stringify/package.json | 52 + .../fast-json-stable-stringify/test/cmp.js | 13 + .../fast-json-stable-stringify/test/nested.js | 44 + .../fast-json-stable-stringify/test/str.js | 46 + .../test/to-json.js | 22 + node_modules/fast-levenshtein/LICENSE.md | 25 + node_modules/fast-levenshtein/README.md | 104 + node_modules/fast-levenshtein/levenshtein.js | 136 + node_modules/fast-levenshtein/package.json | 39 + node_modules/fastq/.github/dependabot.yml | 11 + node_modules/fastq/.github/workflows/ci.yml | 50 + node_modules/fastq/LICENSE | 13 + node_modules/fastq/README.md | 309 + node_modules/fastq/bench.js | 66 + node_modules/fastq/example.js | 14 + node_modules/fastq/example.mjs | 11 + node_modules/fastq/index.d.ts | 37 + node_modules/fastq/package.json | 52 + node_modules/fastq/queue.js | 283 + node_modules/fastq/test/example.ts | 81 + node_modules/fastq/test/promise.js | 221 + node_modules/fastq/test/test.js | 566 + node_modules/fastq/test/tsconfig.json | 11 + node_modules/file-entry-cache/LICENSE | 22 + node_modules/file-entry-cache/README.md | 112 + node_modules/file-entry-cache/cache.js | 291 + node_modules/file-entry-cache/changelog.md | 163 + node_modules/file-entry-cache/package.json | 80 + node_modules/fill-range/LICENSE | 21 + node_modules/fill-range/README.md | 237 + node_modules/fill-range/index.js | 249 + node_modules/fill-range/package.json | 69 + node_modules/find-up/index.d.ts | 138 + node_modules/find-up/index.js | 89 + node_modules/find-up/license | 9 + node_modules/find-up/package.json | 54 + node_modules/find-up/readme.md | 151 + node_modules/flat-cache/LICENSE | 22 + node_modules/flat-cache/README.md | 73 + node_modules/flat-cache/changelog.md | 328 + node_modules/flat-cache/package.json | 84 + node_modules/flat-cache/src/cache.js | 197 + node_modules/flat-cache/src/del.js | 13 + node_modules/flat-cache/src/utils.js | 44 + node_modules/flatted/LICENSE | 15 + node_modules/flatted/README.md | 111 + node_modules/flatted/cjs/index.js | 99 + node_modules/flatted/cjs/package.json | 1 + node_modules/flatted/es.js | 2 + node_modules/flatted/esm.js | 2 + node_modules/flatted/esm/index.js | 94 + node_modules/flatted/index.js | 135 + node_modules/flatted/min.js | 2 + node_modules/flatted/package.json | 63 + node_modules/flatted/php/flatted.php | 156 + node_modules/flatted/types.d.ts | 62 + node_modules/fs.realpath/LICENSE | 43 + node_modules/fs.realpath/README.md | 33 + node_modules/fs.realpath/index.js | 66 + node_modules/fs.realpath/old.js | 303 + node_modules/fs.realpath/package.json | 26 + node_modules/function-bind/.editorconfig | 20 + node_modules/function-bind/.eslintrc | 15 + node_modules/function-bind/.jscs.json | 176 + node_modules/function-bind/.npmignore | 22 + node_modules/function-bind/.travis.yml | 168 + node_modules/function-bind/LICENSE | 20 + node_modules/function-bind/README.md | 48 + node_modules/function-bind/implementation.js | 52 + node_modules/function-bind/index.js | 5 + node_modules/function-bind/package.json | 63 + node_modules/function-bind/test/.eslintrc | 9 + node_modules/function-bind/test/index.js | 252 + .../function.prototype.name/.editorconfig | 20 + .../function.prototype.name/.eslintignore | 1 + .../function.prototype.name/.eslintrc | 9 + .../.github/FUNDING.yml | 12 + node_modules/function.prototype.name/.nycrc | 9 + .../function.prototype.name/CHANGELOG.md | 82 + node_modules/function.prototype.name/LICENSE | 21 + .../function.prototype.name/README.md | 42 + node_modules/function.prototype.name/auto.js | 3 + .../helpers/functionsHaveNames.js | 5 + .../function.prototype.name/implementation.js | 43 + node_modules/function.prototype.name/index.js | 18 + .../function.prototype.name/package.json | 80 + .../function.prototype.name/polyfill.js | 7 + node_modules/function.prototype.name/shim.js | 35 + .../test/implementation.js | 20 + .../function.prototype.name/test/index.js | 23 + .../function.prototype.name/test/shimmed.js | 21 + .../function.prototype.name/test/tests.js | 60 + .../function.prototype.name/test/uglified.js | 17 + .../functions-have-names/.editorconfig | 20 + node_modules/functions-have-names/.eslintrc | 19 + .../functions-have-names/.github/FUNDING.yml | 12 + node_modules/functions-have-names/.nycrc | 9 + .../functions-have-names/CHANGELOG.md | 89 + node_modules/functions-have-names/LICENSE | 21 + node_modules/functions-have-names/README.md | 40 + node_modules/functions-have-names/index.js | 31 + .../functions-have-names/package.json | 55 + .../functions-have-names/test/index.js | 65 + node_modules/get-intrinsic/.eslintrc | 37 + .../get-intrinsic/.github/FUNDING.yml | 12 + node_modules/get-intrinsic/.nycrc | 9 + node_modules/get-intrinsic/CHANGELOG.md | 98 + node_modules/get-intrinsic/LICENSE | 21 + node_modules/get-intrinsic/README.md | 71 + node_modules/get-intrinsic/index.js | 334 + node_modules/get-intrinsic/package.json | 91 + .../get-intrinsic/test/GetIntrinsic.js | 274 + .../get-symbol-description/.eslintignore | 1 + node_modules/get-symbol-description/.eslintrc | 14 + .../.github/FUNDING.yml | 12 + node_modules/get-symbol-description/.nycrc | 9 + .../get-symbol-description/CHANGELOG.md | 16 + node_modules/get-symbol-description/LICENSE | 21 + node_modules/get-symbol-description/README.md | 43 + .../get-symbol-description/getInferredName.js | 10 + node_modules/get-symbol-description/index.js | 43 + .../get-symbol-description/package.json | 71 + .../get-symbol-description/test/index.js | 67 + node_modules/glob-parent/LICENSE | 15 + node_modules/glob-parent/README.md | 134 + node_modules/glob-parent/index.js | 75 + node_modules/glob-parent/package.json | 54 + node_modules/glob/LICENSE | 21 + node_modules/glob/README.md | 378 + node_modules/glob/common.js | 238 + node_modules/glob/glob.js | 790 + node_modules/glob/package.json | 55 + node_modules/glob/sync.js | 486 + node_modules/globals/globals.json | 1800 ++ node_modules/globals/index.d.ts | 6 + node_modules/globals/index.js | 2 + node_modules/globals/license | 9 + node_modules/globals/package.json | 55 + node_modules/globals/readme.md | 56 + node_modules/globby/gitignore.js | 120 + node_modules/globby/index.d.ts | 186 + node_modules/globby/index.js | 181 + node_modules/globby/license | 9 + node_modules/globby/package.json | 82 + node_modules/globby/readme.md | 170 + node_modules/globby/stream-utils.js | 46 + node_modules/grapheme-splitter/LICENSE | 22 + node_modules/grapheme-splitter/README.md | 111 + node_modules/grapheme-splitter/index.d.ts | 24 + node_modules/grapheme-splitter/index.js | 1743 ++ node_modules/grapheme-splitter/package.json | 34 + .../tests/GraphemeBreakTest.txt | 850 + .../tests/grapheme_splitter_tests.js | 83 + node_modules/has-bigints/.eslintrc | 5 + node_modules/has-bigints/.github/FUNDING.yml | 12 + node_modules/has-bigints/.nycrc | 9 + node_modules/has-bigints/CHANGELOG.md | 60 + node_modules/has-bigints/LICENSE | 21 + node_modules/has-bigints/README.md | 39 + node_modules/has-bigints/index.js | 10 + node_modules/has-bigints/package.json | 54 + node_modules/has-bigints/test/index.js | 44 + node_modules/has-flag/index.d.ts | 39 + node_modules/has-flag/index.js | 8 + node_modules/has-flag/license | 9 + node_modules/has-flag/package.json | 46 + node_modules/has-flag/readme.md | 89 + .../has-property-descriptors/.eslintrc | 13 + .../.github/FUNDING.yml | 12 + node_modules/has-property-descriptors/.nycrc | 9 + .../has-property-descriptors/CHANGELOG.md | 16 + node_modules/has-property-descriptors/LICENSE | 21 + .../has-property-descriptors/README.md | 43 + .../has-property-descriptors/index.js | 33 + .../has-property-descriptors/package.json | 70 + .../has-property-descriptors/test/index.js | 57 + node_modules/has-symbols/.eslintrc | 11 + node_modules/has-symbols/.github/FUNDING.yml | 12 + node_modules/has-symbols/.nycrc | 9 + node_modules/has-symbols/CHANGELOG.md | 75 + node_modules/has-symbols/LICENSE | 21 + node_modules/has-symbols/README.md | 46 + node_modules/has-symbols/index.js | 13 + node_modules/has-symbols/package.json | 101 + node_modules/has-symbols/shams.js | 42 + node_modules/has-symbols/test/index.js | 22 + .../has-symbols/test/shams/core-js.js | 28 + .../test/shams/get-own-property-symbols.js | 28 + node_modules/has-symbols/test/tests.js | 56 + node_modules/has-tostringtag/.eslintrc | 11 + .../has-tostringtag/.github/FUNDING.yml | 12 + node_modules/has-tostringtag/CHANGELOG.md | 20 + node_modules/has-tostringtag/LICENSE | 21 + node_modules/has-tostringtag/README.md | 46 + node_modules/has-tostringtag/index.js | 7 + node_modules/has-tostringtag/package.json | 84 + node_modules/has-tostringtag/shams.js | 7 + node_modules/has-tostringtag/test/index.js | 21 + .../has-tostringtag/test/shams/core-js.js | 28 + .../test/shams/get-own-property-symbols.js | 28 + node_modules/has-tostringtag/test/tests.js | 14 + node_modules/has/LICENSE-MIT | 22 + node_modules/has/README.md | 18 + node_modules/has/package.json | 48 + node_modules/has/src/index.js | 5 + node_modules/has/test/index.js | 10 + node_modules/ignore/LICENSE-MIT | 21 + node_modules/ignore/README.md | 412 + node_modules/ignore/index.d.ts | 61 + node_modules/ignore/index.js | 603 + node_modules/ignore/legacy.js | 498 + node_modules/ignore/package.json | 71 + node_modules/import-fresh/index.d.ts | 30 + node_modules/import-fresh/index.js | 33 + node_modules/import-fresh/license | 9 + node_modules/import-fresh/package.json | 43 + node_modules/import-fresh/readme.md | 48 + node_modules/imurmurhash/README.md | 122 + node_modules/imurmurhash/imurmurhash.js | 138 + node_modules/imurmurhash/imurmurhash.min.js | 12 + node_modules/imurmurhash/package.json | 40 + node_modules/inflight/LICENSE | 15 + node_modules/inflight/README.md | 37 + node_modules/inflight/inflight.js | 54 + node_modules/inflight/package.json | 29 + node_modules/inherits/LICENSE | 16 + node_modules/inherits/README.md | 42 + node_modules/inherits/inherits.js | 9 + node_modules/inherits/inherits_browser.js | 27 + node_modules/inherits/package.json | 29 + node_modules/internal-slot/.editorconfig | 20 + node_modules/internal-slot/.eslintignore | 1 + node_modules/internal-slot/.eslintrc | 12 + .../internal-slot/.github/FUNDING.yml | 12 + node_modules/internal-slot/.nycrc | 13 + node_modules/internal-slot/CHANGELOG.md | 58 + node_modules/internal-slot/LICENSE | 21 + node_modules/internal-slot/README.md | 52 + node_modules/internal-slot/index.js | 59 + node_modules/internal-slot/package.json | 63 + node_modules/internal-slot/test/index.js | 120 + node_modules/is-bigint/.eslintignore | 1 + node_modules/is-bigint/.eslintrc | 10 + node_modules/is-bigint/.github/FUNDING.yml | 12 + node_modules/is-bigint/.nycrc | 9 + node_modules/is-bigint/CHANGELOG.md | 71 + node_modules/is-bigint/LICENSE | 21 + node_modules/is-bigint/README.md | 44 + node_modules/is-bigint/index.js | 38 + node_modules/is-bigint/package.json | 58 + node_modules/is-bigint/test/index.js | 81 + node_modules/is-boolean-object/.editorconfig | 22 + node_modules/is-boolean-object/.eslintignore | 1 + node_modules/is-boolean-object/.eslintrc | 22 + .../is-boolean-object/.github/FUNDING.yml | 12 + node_modules/is-boolean-object/.nycrc | 10 + node_modules/is-boolean-object/CHANGELOG.md | 107 + node_modules/is-boolean-object/LICENSE | 22 + node_modules/is-boolean-object/README.md | 57 + node_modules/is-boolean-object/index.js | 26 + node_modules/is-boolean-object/package.json | 87 + node_modules/is-boolean-object/test/index.js | 48 + node_modules/is-callable/.editorconfig | 31 + node_modules/is-callable/.eslintrc | 10 + node_modules/is-callable/.github/FUNDING.yml | 12 + node_modules/is-callable/.nycrc | 9 + node_modules/is-callable/CHANGELOG.md | 158 + node_modules/is-callable/LICENSE | 22 + node_modules/is-callable/README.md | 83 + node_modules/is-callable/index.js | 101 + node_modules/is-callable/package.json | 106 + node_modules/is-callable/test/index.js | 244 + node_modules/is-core-module/.eslintrc | 18 + node_modules/is-core-module/.nycrc | 9 + node_modules/is-core-module/CHANGELOG.md | 143 + node_modules/is-core-module/LICENSE | 20 + node_modules/is-core-module/README.md | 40 + node_modules/is-core-module/core.json | 153 + node_modules/is-core-module/index.js | 69 + node_modules/is-core-module/package.json | 65 + node_modules/is-core-module/test/index.js | 133 + node_modules/is-date-object/.editorconfig | 20 + node_modules/is-date-object/.eslintignore | 1 + node_modules/is-date-object/.eslintrc | 9 + .../is-date-object/.github/FUNDING.yml | 12 + node_modules/is-date-object/.nycrc | 10 + node_modules/is-date-object/CHANGELOG.md | 114 + node_modules/is-date-object/LICENSE | 22 + node_modules/is-date-object/README.md | 52 + node_modules/is-date-object/index.js | 22 + node_modules/is-date-object/package.json | 79 + node_modules/is-date-object/test/index.js | 36 + node_modules/is-extglob/LICENSE | 21 + node_modules/is-extglob/README.md | 107 + node_modules/is-extglob/index.js | 20 + node_modules/is-extglob/package.json | 69 + node_modules/is-glob/LICENSE | 21 + node_modules/is-glob/README.md | 206 + node_modules/is-glob/index.js | 150 + node_modules/is-glob/package.json | 81 + node_modules/is-negative-zero/.editorconfig | 8 + node_modules/is-negative-zero/.eslintignore | 1 + node_modules/is-negative-zero/.eslintrc | 9 + .../is-negative-zero/.github/FUNDING.yml | 12 + node_modules/is-negative-zero/.nycrc | 9 + node_modules/is-negative-zero/CHANGELOG.md | 136 + node_modules/is-negative-zero/LICENSE | 20 + node_modules/is-negative-zero/README.md | 54 + node_modules/is-negative-zero/index.js | 6 + node_modules/is-negative-zero/package.json | 79 + node_modules/is-negative-zero/test/index.js | 28 + node_modules/is-number-object/.editorconfig | 23 + node_modules/is-number-object/.eslintrc | 16 + .../is-number-object/.github/FUNDING.yml | 12 + node_modules/is-number-object/.nycrc | 10 + node_modules/is-number-object/CHANGELOG.md | 125 + node_modules/is-number-object/LICENSE | 22 + node_modules/is-number-object/README.md | 55 + node_modules/is-number-object/index.js | 24 + node_modules/is-number-object/package.json | 85 + node_modules/is-number-object/test/index.js | 38 + node_modules/is-number/LICENSE | 21 + node_modules/is-number/README.md | 187 + node_modules/is-number/index.js | 18 + node_modules/is-number/package.json | 82 + node_modules/is-regex/.editorconfig | 20 + node_modules/is-regex/.eslintignore | 1 + node_modules/is-regex/.eslintrc | 19 + node_modules/is-regex/.nycrc | 10 + node_modules/is-regex/CHANGELOG.md | 197 + node_modules/is-regex/LICENSE | 20 + node_modules/is-regex/README.md | 52 + node_modules/is-regex/index.js | 58 + node_modules/is-regex/package.json | 86 + node_modules/is-regex/test/index.js | 104 + .../is-shared-array-buffer/.eslintignore | 1 + node_modules/is-shared-array-buffer/.eslintrc | 5 + .../.github/FUNDING.yml | 12 + node_modules/is-shared-array-buffer/.nycrc | 9 + .../is-shared-array-buffer/CHANGELOG.md | 44 + node_modules/is-shared-array-buffer/LICENSE | 21 + node_modules/is-shared-array-buffer/README.md | 58 + node_modules/is-shared-array-buffer/index.js | 21 + .../is-shared-array-buffer/package.json | 70 + .../is-shared-array-buffer/test/index.js | 27 + node_modules/is-string/.eslintignore | 1 + node_modules/is-string/.eslintrc | 19 + node_modules/is-string/.github/FUNDING.yml | 12 + node_modules/is-string/.nycrc | 10 + node_modules/is-string/CHANGELOG.md | 114 + node_modules/is-string/LICENSE | 22 + node_modules/is-string/README.md | 56 + node_modules/is-string/index.js | 24 + node_modules/is-string/package.json | 81 + node_modules/is-string/test/index.js | 39 + node_modules/is-symbol/.editorconfig | 13 + node_modules/is-symbol/.eslintignore | 1 + node_modules/is-symbol/.eslintrc | 14 + node_modules/is-symbol/.github/FUNDING.yml | 12 + node_modules/is-symbol/.nycrc | 9 + node_modules/is-symbol/CHANGELOG.md | 113 + node_modules/is-symbol/LICENSE | 22 + node_modules/is-symbol/README.md | 45 + node_modules/is-symbol/index.js | 35 + node_modules/is-symbol/package.json | 77 + node_modules/is-symbol/test/index.js | 92 + node_modules/is-weakref/.eslintignore | 1 + node_modules/is-weakref/.eslintrc | 5 + node_modules/is-weakref/.github/FUNDING.yml | 12 + node_modules/is-weakref/.nycrc | 9 + node_modules/is-weakref/CHANGELOG.md | 54 + node_modules/is-weakref/LICENSE | 21 + node_modules/is-weakref/README.md | 52 + node_modules/is-weakref/index.js | 21 + node_modules/is-weakref/package.json | 63 + node_modules/is-weakref/test/index.js | 26 + node_modules/isexe/.npmignore | 2 + node_modules/isexe/LICENSE | 15 + node_modules/isexe/README.md | 51 + node_modules/isexe/index.js | 57 + node_modules/isexe/mode.js | 41 + node_modules/isexe/package.json | 31 + node_modules/isexe/test/basic.js | 221 + node_modules/isexe/windows.js | 42 + node_modules/js-sdsl/CHANGELOG.md | 160 + node_modules/js-sdsl/LICENSE | 21 + node_modules/js-sdsl/README.md | 149 + node_modules/js-sdsl/README.zh-CN.md | 151 + .../cjs/container/ContainerBase/index.d.ts | 120 + .../dist/cjs/container/ContainerBase/index.js | 33 + .../container/HashContainer/Base/index.d.ts | 25 + .../cjs/container/HashContainer/Base/index.js | 42 + .../cjs/container/HashContainer/HashMap.d.ts | 22 + .../cjs/container/HashContainer/HashMap.js | 178 + .../cjs/container/HashContainer/HashSet.d.ts | 15 + .../cjs/container/HashContainer/HashSet.js | 149 + .../OtherContainer/PriorityQueue.d.ts | 48 + .../container/OtherContainer/PriorityQueue.js | 112 + .../cjs/container/OtherContainer/Queue.d.ts | 18 + .../cjs/container/OtherContainer/Queue.js | 44 + .../cjs/container/OtherContainer/Stack.d.ts | 18 + .../cjs/container/OtherContainer/Stack.js | 36 + .../Base/RandomIterator.d.ts | 8 + .../Base/RandomIterator.js | 67 + .../SequentialContainer/Base/index.d.ts | 44 + .../SequentialContainer/Base/index.js | 15 + .../container/SequentialContainer/Deque.d.ts | 50 + .../container/SequentialContainer/Deque.js | 324 + .../SequentialContainer/LinkList.d.ts | 49 + .../container/SequentialContainer/LinkList.js | 366 + .../container/SequentialContainer/Vector.d.ts | 37 + .../container/SequentialContainer/Vector.js | 150 + .../TreeContainer/Base/TreeIterator.d.ts | 15 + .../TreeContainer/Base/TreeIterator.js | 80 + .../TreeContainer/Base/TreeNode.d.ts | 36 + .../container/TreeContainer/Base/TreeNode.js | 113 + .../container/TreeContainer/Base/index.d.ts | 55 + .../cjs/container/TreeContainer/Base/index.js | 483 + .../container/TreeContainer/OrderedMap.d.ts | 42 + .../cjs/container/TreeContainer/OrderedMap.js | 136 + .../container/TreeContainer/OrderedSet.d.ts | 37 + .../cjs/container/TreeContainer/OrderedSet.js | 117 + node_modules/js-sdsl/dist/cjs/index.d.ts | 19 + node_modules/js-sdsl/dist/cjs/index.js | 101 + .../esm/container/ContainerBase/index.d.ts | 120 + .../dist/esm/container/ContainerBase/index.js | 57 + .../container/HashContainer/Base/index.d.ts | 25 + .../esm/container/HashContainer/Base/index.js | 62 + .../esm/container/HashContainer/HashMap.d.ts | 22 + .../esm/container/HashContainer/HashMap.js | 410 + .../esm/container/HashContainer/HashSet.d.ts | 15 + .../esm/container/HashContainer/HashSet.js | 325 + .../OtherContainer/PriorityQueue.d.ts | 48 + .../container/OtherContainer/PriorityQueue.js | 167 + .../esm/container/OtherContainer/Queue.d.ts | 18 + .../esm/container/OtherContainer/Queue.js | 55 + .../esm/container/OtherContainer/Stack.d.ts | 18 + .../esm/container/OtherContainer/Stack.js | 55 + .../Base/RandomIterator.d.ts | 8 + .../Base/RandomIterator.js | 87 + .../SequentialContainer/Base/index.d.ts | 44 + .../SequentialContainer/Base/index.js | 32 + .../container/SequentialContainer/Deque.d.ts | 50 + .../container/SequentialContainer/Deque.js | 493 + .../SequentialContainer/LinkList.d.ts | 49 + .../container/SequentialContainer/LinkList.js | 500 + .../container/SequentialContainer/Vector.d.ts | 37 + .../container/SequentialContainer/Vector.js | 318 + .../TreeContainer/Base/TreeIterator.d.ts | 15 + .../TreeContainer/Base/TreeIterator.js | 98 + .../TreeContainer/Base/TreeNode.d.ts | 36 + .../container/TreeContainer/Base/TreeNode.js | 130 + .../container/TreeContainer/Base/index.d.ts | 55 + .../esm/container/TreeContainer/Base/index.js | 525 + .../container/TreeContainer/OrderedMap.d.ts | 42 + .../esm/container/TreeContainer/OrderedMap.js | 334 + .../container/TreeContainer/OrderedSet.d.ts | 37 + .../esm/container/TreeContainer/OrderedSet.js | 292 + node_modules/js-sdsl/dist/esm/index.d.ts | 19 + node_modules/js-sdsl/dist/esm/index.js | 19 + node_modules/js-sdsl/dist/umd/js-sdsl.js | 2752 +++ node_modules/js-sdsl/dist/umd/js-sdsl.min.js | 2 + .../js-sdsl/dist/umd/js-sdsl.min.js.map | 1 + node_modules/js-sdsl/package.json | 157 + node_modules/js-tokens/CHANGELOG.md | 151 + node_modules/js-tokens/LICENSE | 21 + node_modules/js-tokens/README.md | 240 + node_modules/js-tokens/index.js | 23 + node_modules/js-tokens/package.json | 30 + node_modules/js-yaml/CHANGELOG.md | 616 + node_modules/js-yaml/LICENSE | 21 + node_modules/js-yaml/README.md | 246 + node_modules/js-yaml/bin/js-yaml.js | 126 + node_modules/js-yaml/dist/js-yaml.js | 3874 ++++ node_modules/js-yaml/dist/js-yaml.min.js | 2 + node_modules/js-yaml/dist/js-yaml.mjs | 3851 ++++ node_modules/js-yaml/index.js | 47 + node_modules/js-yaml/lib/common.js | 59 + node_modules/js-yaml/lib/dumper.js | 965 + node_modules/js-yaml/lib/exception.js | 55 + node_modules/js-yaml/lib/loader.js | 1727 ++ node_modules/js-yaml/lib/schema.js | 121 + node_modules/js-yaml/lib/schema/core.js | 11 + node_modules/js-yaml/lib/schema/default.js | 22 + node_modules/js-yaml/lib/schema/failsafe.js | 17 + node_modules/js-yaml/lib/schema/json.js | 19 + node_modules/js-yaml/lib/snippet.js | 101 + node_modules/js-yaml/lib/type.js | 66 + node_modules/js-yaml/lib/type/binary.js | 125 + node_modules/js-yaml/lib/type/bool.js | 35 + node_modules/js-yaml/lib/type/float.js | 97 + node_modules/js-yaml/lib/type/int.js | 156 + node_modules/js-yaml/lib/type/map.js | 8 + node_modules/js-yaml/lib/type/merge.js | 12 + node_modules/js-yaml/lib/type/null.js | 35 + node_modules/js-yaml/lib/type/omap.js | 44 + node_modules/js-yaml/lib/type/pairs.js | 53 + node_modules/js-yaml/lib/type/seq.js | 8 + node_modules/js-yaml/lib/type/set.js | 29 + node_modules/js-yaml/lib/type/str.js | 8 + node_modules/js-yaml/lib/type/timestamp.js | 88 + node_modules/js-yaml/package.json | 66 + .../json-schema-traverse/.eslintrc.yml | 27 + node_modules/json-schema-traverse/.travis.yml | 8 + node_modules/json-schema-traverse/LICENSE | 21 + node_modules/json-schema-traverse/README.md | 83 + node_modules/json-schema-traverse/index.js | 89 + .../json-schema-traverse/package.json | 43 + .../json-schema-traverse/spec/.eslintrc.yml | 6 + .../spec/fixtures/schema.js | 125 + .../json-schema-traverse/spec/index.spec.js | 171 + .../.npmignore | 1 + .../.travis.yml | 4 + .../LICENSE | 18 + .../example/key_cmp.js | 7 + .../example/nested.js | 3 + .../example/str.js | 3 + .../example/value_cmp.js | 7 + .../index.js | 82 + .../package.json | 43 + .../readme.markdown | 132 + .../test/cmp.js | 11 + .../test/nested.js | 42 + .../test/replacer.js | 74 + .../test/space.js | 59 + .../test/str.js | 32 + .../test/to-json.js | 20 + node_modules/jsx-ast-utils/.babelrc | 8 + node_modules/jsx-ast-utils/.eslintignore | 4 + node_modules/jsx-ast-utils/.eslintrc | 20 + .../jsx-ast-utils/.github/FUNDING.yml | 5 + node_modules/jsx-ast-utils/CHANGELOG.md | 199 + node_modules/jsx-ast-utils/LICENSE.md | 8 + node_modules/jsx-ast-utils/README.md | 298 + .../jsx-ast-utils/__tests__/helper.js | 87 + .../__tests__/src/elementType-test.js | 96 + .../__tests__/src/eventHandlers-test.js | 101 + .../__tests__/src/getProp-parser-test.js | 176 + .../__tests__/src/getProp-test.js | 149 + .../getPropLiteralValue-babelparser-test.js | 540 + .../getPropLiteralValue-flowparser-test.js | 522 + .../src/getPropValue-babelparser-test.js | 1248 ++ .../src/getPropValue-flowparser-test.js | 963 + .../__tests__/src/hasProp-test.js | 412 + .../jsx-ast-utils/__tests__/src/index-test.js | 35 + .../__tests__/src/propName-test.js | 42 + node_modules/jsx-ast-utils/elementType.js | 1 + node_modules/jsx-ast-utils/eventHandlers.js | 1 + .../jsx-ast-utils/eventHandlersByType.js | 1 + .../jsx-ast-utils/getLiteralPropValue.js | 1 + node_modules/jsx-ast-utils/getProp.js | 1 + node_modules/jsx-ast-utils/getPropValue.js | 1 + node_modules/jsx-ast-utils/hasAnyProp.js | 1 + node_modules/jsx-ast-utils/hasEveryProp.js | 1 + node_modules/jsx-ast-utils/hasProp.js | 1 + node_modules/jsx-ast-utils/lib/elementType.js | 48 + .../jsx-ast-utils/lib/eventHandlers.js | 32 + node_modules/jsx-ast-utils/lib/getProp.js | 115 + .../jsx-ast-utils/lib/getPropValue.js | 57 + node_modules/jsx-ast-utils/lib/hasProp.js | 74 + node_modules/jsx-ast-utils/lib/index.js | 40 + node_modules/jsx-ast-utils/lib/propName.js | 22 + .../jsx-ast-utils/lib/values/JSXElement.js | 23 + .../jsx-ast-utils/lib/values/JSXFragment.js | 22 + .../jsx-ast-utils/lib/values/JSXText.js | 14 + .../jsx-ast-utils/lib/values/Literal.js | 27 + .../lib/values/expressions/ArrayExpression.js | 20 + .../expressions/AssignmentExpression.js | 19 + .../values/expressions/BinaryExpression.js | 78 + .../lib/values/expressions/BindExpression.js | 30 + .../lib/values/expressions/CallExpression.js | 23 + .../lib/values/expressions/ChainExpression.js | 19 + .../expressions/ConditionalExpression.js | 22 + .../values/expressions/FunctionExpression.js | 19 + .../lib/values/expressions/Identifier.js | 35 + .../values/expressions/LogicalExpression.js | 33 + .../values/expressions/MemberExpression.js | 19 + .../lib/values/expressions/NewExpression.js | 15 + .../values/expressions/ObjectExpression.js | 38 + .../expressions/OptionalCallExpression.js | 21 + .../expressions/OptionalMemberExpression.js | 19 + .../values/expressions/SequenceExpression.js | 21 + .../lib/values/expressions/SpreadElement.js | 17 + .../values/expressions/TSNonNullExpression.js | 95 + .../expressions/TaggedTemplateExpression.js | 20 + .../lib/values/expressions/TemplateLiteral.js | 42 + .../lib/values/expressions/ThisExpression.js | 15 + .../values/expressions/TypeCastExpression.js | 19 + .../lib/values/expressions/UnaryExpression.js | 39 + .../values/expressions/UpdateExpression.js | 33 + .../lib/values/expressions/index.js | 288 + .../jsx-ast-utils/lib/values/index.js | 70 + node_modules/jsx-ast-utils/package.json | 71 + node_modules/jsx-ast-utils/propName.js | 1 + node_modules/jsx-ast-utils/src/elementType.js | 33 + .../jsx-ast-utils/src/eventHandlers.js | 112 + node_modules/jsx-ast-utils/src/getProp.js | 91 + .../jsx-ast-utils/src/getPropValue.js | 45 + node_modules/jsx-ast-utils/src/hasProp.js | 47 + node_modules/jsx-ast-utils/src/index.js | 19 + node_modules/jsx-ast-utils/src/propName.js | 14 + .../jsx-ast-utils/src/values/JSXElement.js | 15 + .../jsx-ast-utils/src/values/JSXFragment.js | 14 + .../jsx-ast-utils/src/values/JSXText.js | 8 + .../jsx-ast-utils/src/values/Literal.js | 20 + .../src/values/expressions/ArrayExpression.js | 14 + .../expressions/AssignmentExpression.js | 13 + .../values/expressions/BinaryExpression.js | 69 + .../src/values/expressions/BindExpression.js | 24 + .../src/values/expressions/CallExpression.js | 15 + .../src/values/expressions/ChainExpression.js | 13 + .../expressions/ConditionalExpression.js | 17 + .../values/expressions/FunctionExpression.js | 11 + .../src/values/expressions/Identifier.js | 28 + .../values/expressions/LogicalExpression.js | 24 + .../values/expressions/MemberExpression.js | 13 + .../src/values/expressions/NewExpression.js | 9 + .../values/expressions/ObjectExpression.js | 24 + .../expressions/OptionalCallExpression.js | 13 + .../expressions/OptionalMemberExpression.js | 13 + .../values/expressions/SequenceExpression.js | 13 + .../src/values/expressions/SpreadElement.js | 11 + .../values/expressions/TSNonNullExpression.js | 92 + .../expressions/TaggedTemplateExpression.js | 9 + .../src/values/expressions/TemplateLiteral.js | 38 + .../src/values/expressions/ThisExpression.js | 9 + .../values/expressions/TypeCastExpression.js | 13 + .../src/values/expressions/UnaryExpression.js | 31 + .../values/expressions/UpdateExpression.js | 24 + .../src/values/expressions/index.js | 184 + .../jsx-ast-utils/src/values/index.js | 45 + node_modules/levn/LICENSE | 22 + node_modules/levn/README.md | 196 + node_modules/levn/lib/cast.js | 327 + node_modules/levn/lib/index.js | 22 + node_modules/levn/lib/parse-string.js | 113 + node_modules/levn/package.json | 46 + node_modules/locate-path/index.d.ts | 83 + node_modules/locate-path/index.js | 68 + node_modules/locate-path/license | 9 + node_modules/locate-path/package.json | 46 + node_modules/locate-path/readme.md | 125 + node_modules/lodash.merge/LICENSE | 47 + node_modules/lodash.merge/README.md | 18 + node_modules/lodash.merge/index.js | 1977 ++ node_modules/lodash.merge/package.json | 16 + node_modules/loose-envify/LICENSE | 21 + node_modules/loose-envify/README.md | 45 + node_modules/loose-envify/cli.js | 16 + node_modules/loose-envify/custom.js | 4 + node_modules/loose-envify/index.js | 3 + node_modules/loose-envify/loose-envify.js | 36 + node_modules/loose-envify/package.json | 36 + node_modules/loose-envify/replace.js | 65 + node_modules/merge2/LICENSE | 21 + node_modules/merge2/README.md | 144 + node_modules/merge2/index.js | 144 + node_modules/merge2/package.json | 43 + node_modules/micromatch/LICENSE | 21 + node_modules/micromatch/README.md | 1011 + node_modules/micromatch/index.js | 467 + node_modules/micromatch/package.json | 119 + node_modules/minimatch/LICENSE | 15 + node_modules/minimatch/README.md | 230 + node_modules/minimatch/minimatch.js | 947 + node_modules/minimatch/package.json | 33 + node_modules/ms/index.js | 162 + node_modules/ms/license.md | 21 + node_modules/ms/package.json | 37 + node_modules/ms/readme.md | 60 + node_modules/natural-compare/README.md | 125 + node_modules/natural-compare/index.js | 57 + node_modules/natural-compare/package.json | 42 + node_modules/object-assign/index.js | 90 + node_modules/object-assign/license | 21 + node_modules/object-assign/package.json | 42 + node_modules/object-assign/readme.md | 61 + node_modules/object-inspect/.eslintrc | 53 + .../object-inspect/.github/FUNDING.yml | 12 + node_modules/object-inspect/.nycrc | 13 + node_modules/object-inspect/CHANGELOG.md | 360 + node_modules/object-inspect/LICENSE | 21 + node_modules/object-inspect/example/all.js | 23 + .../object-inspect/example/circular.js | 6 + node_modules/object-inspect/example/fn.js | 5 + .../object-inspect/example/inspect.js | 10 + node_modules/object-inspect/index.js | 512 + .../object-inspect/package-support.json | 20 + node_modules/object-inspect/package.json | 94 + node_modules/object-inspect/readme.markdown | 86 + node_modules/object-inspect/test-core-js.js | 26 + node_modules/object-inspect/test/bigint.js | 58 + .../object-inspect/test/browser/dom.js | 15 + node_modules/object-inspect/test/circular.js | 16 + node_modules/object-inspect/test/deep.js | 12 + node_modules/object-inspect/test/element.js | 53 + node_modules/object-inspect/test/err.js | 48 + node_modules/object-inspect/test/fakes.js | 29 + node_modules/object-inspect/test/fn.js | 76 + node_modules/object-inspect/test/has.js | 15 + node_modules/object-inspect/test/holes.js | 15 + .../object-inspect/test/indent-option.js | 271 + node_modules/object-inspect/test/inspect.js | 139 + node_modules/object-inspect/test/lowbyte.js | 12 + node_modules/object-inspect/test/number.js | 58 + .../object-inspect/test/quoteStyle.js | 17 + .../object-inspect/test/toStringTag.js | 40 + node_modules/object-inspect/test/undef.js | 12 + node_modules/object-inspect/test/values.js | 211 + node_modules/object-inspect/util.inspect.js | 1 + node_modules/object-keys/.editorconfig | 13 + node_modules/object-keys/.eslintrc | 17 + node_modules/object-keys/.travis.yml | 277 + node_modules/object-keys/CHANGELOG.md | 232 + node_modules/object-keys/LICENSE | 21 + node_modules/object-keys/README.md | 76 + node_modules/object-keys/implementation.js | 122 + node_modules/object-keys/index.js | 32 + node_modules/object-keys/isArguments.js | 17 + node_modules/object-keys/package.json | 88 + node_modules/object-keys/test/index.js | 5 + node_modules/object.assign/.editorconfig | 20 + node_modules/object.assign/.eslintrc | 28 + .../object.assign/.github/FUNDING.yml | 12 + node_modules/object.assign/.nycrc | 9 + node_modules/object.assign/CHANGELOG.md | 225 + node_modules/object.assign/LICENSE | 21 + node_modules/object.assign/README.md | 136 + node_modules/object.assign/auto.js | 3 + node_modules/object.assign/dist/browser.js | 944 + node_modules/object.assign/hasSymbols.js | 43 + node_modules/object.assign/implementation.js | 46 + node_modules/object.assign/index.js | 22 + node_modules/object.assign/package.json | 96 + node_modules/object.assign/polyfill.js | 55 + node_modules/object.assign/shim.js | 14 + node_modules/object.assign/test.html | 18458 ++++++++++++++++ .../object.assign/test/implementation.js | 19 + node_modules/object.assign/test/index.js | 17 + node_modules/object.assign/test/native.js | 49 + node_modules/object.assign/test/ses-compat.js | 12 + node_modules/object.assign/test/shimmed.js | 52 + node_modules/object.assign/test/tests.js | 232 + node_modules/object.entries/.editorconfig | 20 + node_modules/object.entries/.eslintignore | 1 + node_modules/object.entries/.eslintrc | 12 + node_modules/object.entries/.nycrc | 9 + node_modules/object.entries/CHANGELOG.md | 165 + node_modules/object.entries/LICENSE | 22 + node_modules/object.entries/README.md | 58 + node_modules/object.entries/auto.js | 3 + node_modules/object.entries/implementation.js | 17 + node_modules/object.entries/index.js | 18 + node_modules/object.entries/package.json | 86 + node_modules/object.entries/polyfill.js | 7 + node_modules/object.entries/shim.js | 14 + node_modules/object.entries/test/.eslintrc | 11 + .../object.entries/test/implementation.js | 20 + node_modules/object.entries/test/index.js | 17 + node_modules/object.entries/test/shimmed.js | 35 + node_modules/object.entries/test/tests.js | 82 + node_modules/object.fromentries/.editorconfig | 20 + node_modules/object.fromentries/.eslintignore | 1 + node_modules/object.fromentries/.eslintrc | 37 + node_modules/object.fromentries/.nycrc | 9 + node_modules/object.fromentries/CHANGELOG.md | 55 + node_modules/object.fromentries/LICENSE | 21 + node_modules/object.fromentries/README.md | 50 + node_modules/object.fromentries/auto.js | 3 + .../object.fromentries/implementation.js | 18 + node_modules/object.fromentries/index.js | 18 + node_modules/object.fromentries/package.json | 77 + node_modules/object.fromentries/polyfill.js | 7 + node_modules/object.fromentries/shim.js | 14 + .../object.fromentries/test/implementation.js | 20 + node_modules/object.fromentries/test/index.js | 17 + .../object.fromentries/test/shimmed.js | 44 + node_modules/object.fromentries/test/tests.js | 17 + node_modules/object.hasown/.eslintrc | 15 + .../object.hasown/.github/FUNDING.yml | 12 + node_modules/object.hasown/.nycrc | 9 + node_modules/object.hasown/CHANGELOG.md | 39 + node_modules/object.hasown/LICENSE | 21 + node_modules/object.hasown/README.md | 51 + node_modules/object.hasown/auto.js | 3 + node_modules/object.hasown/implementation.js | 11 + node_modules/object.hasown/index.js | 18 + node_modules/object.hasown/index.mjs | 9 + node_modules/object.hasown/package.json | 87 + node_modules/object.hasown/polyfill.js | 7 + node_modules/object.hasown/shim.js | 14 + .../object.hasown/test/implementation.js | 20 + node_modules/object.hasown/test/index.js | 11 + node_modules/object.hasown/test/index.mjs | 24 + node_modules/object.hasown/test/shimmed.js | 36 + node_modules/object.hasown/test/tests.js | 36 + node_modules/object.values/.editorconfig | 20 + node_modules/object.values/.eslintignore | 1 + node_modules/object.values/.eslintrc | 12 + node_modules/object.values/.nycrc | 9 + node_modules/object.values/CHANGELOG.md | 160 + node_modules/object.values/LICENSE | 22 + node_modules/object.values/README.md | 58 + node_modules/object.values/auto.js | 3 + node_modules/object.values/implementation.js | 18 + node_modules/object.values/index.js | 18 + node_modules/object.values/package.json | 90 + node_modules/object.values/polyfill.js | 7 + node_modules/object.values/shim.js | 14 + node_modules/object.values/test/.eslintrc | 11 + .../object.values/test/implementation.js | 20 + node_modules/object.values/test/index.js | 17 + node_modules/object.values/test/shimmed.js | 35 + node_modules/object.values/test/tests.js | 82 + node_modules/once/LICENSE | 15 + node_modules/once/README.md | 79 + node_modules/once/once.js | 42 + node_modules/once/package.json | 33 + node_modules/optionator/CHANGELOG.md | 59 + node_modules/optionator/LICENSE | 22 + node_modules/optionator/README.md | 238 + node_modules/optionator/lib/help.js | 260 + node_modules/optionator/lib/index.js | 465 + node_modules/optionator/lib/util.js | 54 + node_modules/optionator/package.json | 43 + node_modules/p-limit/index.d.ts | 42 + node_modules/p-limit/index.js | 71 + node_modules/p-limit/license | 9 + node_modules/p-limit/package.json | 52 + node_modules/p-limit/readme.md | 101 + node_modules/p-locate/index.d.ts | 53 + node_modules/p-locate/index.js | 50 + node_modules/p-locate/license | 9 + node_modules/p-locate/package.json | 54 + node_modules/p-locate/readme.md | 93 + node_modules/parent-module/index.js | 37 + node_modules/parent-module/license | 9 + node_modules/parent-module/package.json | 46 + node_modules/parent-module/readme.md | 67 + node_modules/path-exists/index.d.ts | 28 + node_modules/path-exists/index.js | 23 + node_modules/path-exists/license | 9 + node_modules/path-exists/package.json | 39 + node_modules/path-exists/readme.md | 52 + node_modules/path-is-absolute/index.js | 20 + node_modules/path-is-absolute/license | 21 + node_modules/path-is-absolute/package.json | 43 + node_modules/path-is-absolute/readme.md | 59 + node_modules/path-key/index.d.ts | 40 + node_modules/path-key/index.js | 16 + node_modules/path-key/license | 9 + node_modules/path-key/package.json | 39 + node_modules/path-key/readme.md | 61 + node_modules/path-parse/LICENSE | 21 + node_modules/path-parse/README.md | 42 + node_modules/path-parse/index.js | 75 + node_modules/path-parse/package.json | 33 + node_modules/path-type/index.d.ts | 51 + node_modules/path-type/index.js | 43 + node_modules/path-type/license | 9 + node_modules/path-type/package.json | 45 + node_modules/path-type/readme.md | 72 + node_modules/picomatch/CHANGELOG.md | 136 + node_modules/picomatch/LICENSE | 21 + node_modules/picomatch/README.md | 708 + node_modules/picomatch/index.js | 3 + node_modules/picomatch/lib/constants.js | 179 + node_modules/picomatch/lib/parse.js | 1091 + node_modules/picomatch/lib/picomatch.js | 342 + node_modules/picomatch/lib/scan.js | 391 + node_modules/picomatch/lib/utils.js | 64 + node_modules/picomatch/package.json | 81 + node_modules/prelude-ls/CHANGELOG.md | 108 + node_modules/prelude-ls/LICENSE | 22 + node_modules/prelude-ls/README.md | 15 + node_modules/prelude-ls/lib/Func.js | 69 + node_modules/prelude-ls/lib/List.js | 716 + node_modules/prelude-ls/lib/Num.js | 130 + node_modules/prelude-ls/lib/Obj.js | 154 + node_modules/prelude-ls/lib/Str.js | 92 + node_modules/prelude-ls/lib/index.js | 178 + node_modules/prelude-ls/package.json | 46 + node_modules/prop-types/LICENSE | 21 + node_modules/prop-types/README.md | 302 + node_modules/prop-types/checkPropTypes.js | 103 + node_modules/prop-types/factory.js | 19 + .../prop-types/factoryWithThrowingShims.js | 65 + .../prop-types/factoryWithTypeCheckers.js | 610 + node_modules/prop-types/index.js | 19 + .../prop-types/lib/ReactPropTypesSecret.js | 12 + node_modules/prop-types/lib/has.js | 1 + node_modules/prop-types/package.json | 60 + node_modules/prop-types/prop-types.js | 1315 ++ node_modules/prop-types/prop-types.min.js | 1 + node_modules/punycode/LICENSE-MIT.txt | 20 + node_modules/punycode/README.md | 122 + node_modules/punycode/package.json | 58 + node_modules/punycode/punycode.es6.js | 441 + node_modules/punycode/punycode.js | 440 + node_modules/queue-microtask/LICENSE | 20 + node_modules/queue-microtask/README.md | 90 + node_modules/queue-microtask/index.d.ts | 2 + node_modules/queue-microtask/index.js | 9 + node_modules/queue-microtask/package.json | 55 + node_modules/react-is/LICENSE | 21 + node_modules/react-is/README.md | 104 + node_modules/react-is/build-info.json | 8 + .../react-is/cjs/react-is.development.js | 181 + .../react-is/cjs/react-is.production.min.js | 15 + node_modules/react-is/index.js | 7 + node_modules/react-is/package.json | 27 + .../react-is/umd/react-is.development.js | 181 + .../react-is/umd/react-is.production.min.js | 13 + .../regexp.prototype.flags/.editorconfig | 13 + node_modules/regexp.prototype.flags/.eslintrc | 19 + node_modules/regexp.prototype.flags/.nycrc | 9 + .../regexp.prototype.flags/CHANGELOG.md | 190 + node_modules/regexp.prototype.flags/LICENSE | 22 + node_modules/regexp.prototype.flags/README.md | 54 + node_modules/regexp.prototype.flags/auto.js | 3 + .../regexp.prototype.flags/implementation.js | 39 + node_modules/regexp.prototype.flags/index.js | 18 + .../regexp.prototype.flags/package.json | 92 + .../regexp.prototype.flags/polyfill.js | 36 + node_modules/regexp.prototype.flags/shim.js | 26 + .../test/implementation.js | 20 + .../regexp.prototype.flags/test/index.js | 17 + .../regexp.prototype.flags/test/shimmed.js | 48 + .../regexp.prototype.flags/test/tests.js | 141 + node_modules/regexpp/LICENSE | 21 + node_modules/regexpp/README.md | 178 + node_modules/regexpp/index.d.ts | 248 + node_modules/regexpp/index.js | 2096 ++ node_modules/regexpp/index.js.map | 1 + node_modules/regexpp/index.mjs | 2087 ++ node_modules/regexpp/index.mjs.map | 1 + node_modules/regexpp/package.json | 91 + node_modules/resolve-from/index.js | 47 + node_modules/resolve-from/license | 9 + node_modules/resolve-from/package.json | 34 + node_modules/resolve-from/readme.md | 72 + node_modules/resolve/.editorconfig | 34 + node_modules/resolve/.eslintrc | 65 + node_modules/resolve/.github/FUNDING.yml | 12 + node_modules/resolve/LICENSE | 21 + node_modules/resolve/SECURITY.md | 3 + node_modules/resolve/async.js | 3 + node_modules/resolve/bin/resolve | 50 + node_modules/resolve/example/async.js | 5 + node_modules/resolve/example/sync.js | 3 + node_modules/resolve/index.js | 4 + node_modules/resolve/index.mjs | 4 + node_modules/resolve/lib/async.js | 349 + node_modules/resolve/lib/caller.js | 8 + node_modules/resolve/lib/homedir.js | 24 + .../resolve/lib/node-modules-paths.js | 42 + node_modules/resolve/lib/normalize-options.js | 10 + node_modules/resolve/lib/sync.js | 221 + node_modules/resolve/package.json | 82 + node_modules/resolve/readme.markdown | 294 + node_modules/resolve/sync.js | 3 + node_modules/resolve/test/dotdot.js | 29 + node_modules/resolve/test/dotdot/abc/index.js | 0 node_modules/resolve/test/dotdot/index.js | 0 node_modules/resolve/test/faulty_basedir.js | 29 + node_modules/resolve/test/filter.js | 37 + node_modules/resolve/test/filter_sync.js | 33 + node_modules/resolve/test/home_paths.js | 127 + node_modules/resolve/test/home_paths_sync.js | 114 + node_modules/resolve/test/mock.js | 315 + node_modules/resolve/test/mock_sync.js | 215 + node_modules/resolve/test/module_dir.js | 56 + .../test/module_dir/xmodules/aaa/index.js | 0 .../test/module_dir/ymodules/aaa/index.js | 0 .../test/module_dir/zmodules/bbb/main.js | 0 .../test/module_dir/zmodules/bbb/package.json | 3 + .../resolve/test/node-modules-paths.js | 143 + node_modules/resolve/test/node_path.js | 70 + .../resolve/test/node_path/x/aaa/index.js | 0 .../resolve/test/node_path/x/ccc/index.js | 0 .../resolve/test/node_path/y/bbb/index.js | 0 .../resolve/test/node_path/y/ccc/index.js | 0 node_modules/resolve/test/nonstring.js | 9 + node_modules/resolve/test/pathfilter.js | 75 + .../resolve/test/pathfilter/deep_ref/main.js | 0 node_modules/resolve/test/pathfilter_sync.js | 24 + node_modules/resolve/test/precedence.js | 23 + node_modules/resolve/test/precedence/aaa.js | 0 .../resolve/test/precedence/aaa/index.js | 0 .../resolve/test/precedence/aaa/main.js | 0 node_modules/resolve/test/precedence/bbb.js | 0 .../resolve/test/precedence/bbb/main.js | 0 node_modules/resolve/test/resolver.js | 611 + .../resolve/test/resolver/baz/doom.js | 0 .../resolve/test/resolver/baz/package.json | 4 + .../resolve/test/resolver/baz/quux.js | 0 .../resolve/test/resolver/browser_field/a.js | 0 .../resolve/test/resolver/browser_field/b.js | 0 .../test/resolver/browser_field/package.json | 5 + node_modules/resolve/test/resolver/cup.coffee | 1 + .../resolve/test/resolver/dot_main/index.js | 0 .../test/resolver/dot_main/package.json | 3 + .../test/resolver/dot_slash_main/index.js | 0 .../test/resolver/dot_slash_main/package.json | 3 + .../resolve/test/resolver/empty_main/index.js | 0 .../test/resolver/empty_main/package.json | 3 + .../resolve/test/resolver/false_main/index.js | 0 .../test/resolver/false_main/package.json | 4 + node_modules/resolve/test/resolver/foo.js | 0 .../test/resolver/incorrect_main/index.js | 0 .../test/resolver/incorrect_main/package.json | 3 + .../test/resolver/invalid_main/package.json | 7 + .../resolver/malformed_package_json/index.js | 0 .../malformed_package_json/package.json | 1 + .../test/resolver/missing_index/package.json | 3 + .../test/resolver/missing_main/index.js | 0 .../test/resolver/missing_main/package.json | 3 + node_modules/resolve/test/resolver/mug.coffee | 0 node_modules/resolve/test/resolver/mug.js | 0 .../test/resolver/multirepo/lerna.json | 6 + .../test/resolver/multirepo/package.json | 20 + .../multirepo/packages/package-a/index.js | 35 + .../multirepo/packages/package-a/package.json | 14 + .../multirepo/packages/package-b/index.js | 0 .../multirepo/packages/package-b/package.json | 14 + .../resolver/nested_symlinks/mylib/async.js | 26 + .../nested_symlinks/mylib/package.json | 15 + .../resolver/nested_symlinks/mylib/sync.js | 12 + .../resolve/test/resolver/null_main/index.js | 0 .../test/resolver/null_main/package.json | 3 + .../test/resolver/other_path/lib/other-lib.js | 0 .../resolve/test/resolver/other_path/root.js | 0 .../resolve/test/resolver/quux/foo/index.js | 0 .../resolve/test/resolver/same_names/foo.js | 0 .../test/resolver/same_names/foo/index.js | 0 .../resolver/symlinked/_/node_modules/foo.js | 0 .../symlinked/_/symlink_target/.gitkeep | 0 .../test/resolver/symlinked/package/bar.js | 0 .../resolver/symlinked/package/package.json | 3 + .../test/resolver/without_basedir/main.js | 5 + node_modules/resolve/test/resolver_sync.js | 723 + node_modules/resolve/test/shadowed_core.js | 54 + .../shadowed_core/node_modules/util/index.js | 0 node_modules/resolve/test/subdirs.js | 13 + node_modules/resolve/test/symlinks.js | 175 + node_modules/reusify/.coveralls.yml | 1 + node_modules/reusify/.travis.yml | 28 + node_modules/reusify/LICENSE | 22 + node_modules/reusify/README.md | 145 + .../benchmarks/createNoCodeFunction.js | 30 + node_modules/reusify/benchmarks/fib.js | 13 + .../reusify/benchmarks/reuseNoCodeFunction.js | 38 + node_modules/reusify/package.json | 45 + node_modules/reusify/reusify.js | 33 + node_modules/reusify/test.js | 66 + node_modules/rimraf/CHANGELOG.md | 65 + node_modules/rimraf/LICENSE | 15 + node_modules/rimraf/README.md | 101 + node_modules/rimraf/bin.js | 68 + node_modules/rimraf/package.json | 32 + node_modules/rimraf/rimraf.js | 360 + node_modules/run-parallel/LICENSE | 20 + node_modules/run-parallel/README.md | 85 + node_modules/run-parallel/index.js | 51 + node_modules/run-parallel/package.json | 58 + node_modules/safe-regex-test/.eslintrc | 9 + .../safe-regex-test/.github/FUNDING.yml | 12 + node_modules/safe-regex-test/CHANGELOG.md | 15 + node_modules/safe-regex-test/LICENSE | 21 + node_modules/safe-regex-test/README.md | 42 + node_modules/safe-regex-test/index.js | 17 + node_modules/safe-regex-test/package.json | 75 + node_modules/safe-regex-test/test/index.js | 37 + node_modules/semver/CHANGELOG.md | 70 + node_modules/semver/LICENSE | 15 + node_modules/semver/README.md | 443 + node_modules/semver/bin/semver.js | 174 + node_modules/semver/package.json | 28 + node_modules/semver/range.bnf | 16 + node_modules/semver/semver.js | 1596 ++ node_modules/shebang-command/index.js | 19 + node_modules/shebang-command/license | 9 + node_modules/shebang-command/package.json | 34 + node_modules/shebang-command/readme.md | 34 + node_modules/shebang-regex/index.d.ts | 22 + node_modules/shebang-regex/index.js | 2 + node_modules/shebang-regex/license | 9 + node_modules/shebang-regex/package.json | 35 + node_modules/shebang-regex/readme.md | 33 + node_modules/side-channel/.eslintignore | 1 + node_modules/side-channel/.eslintrc | 11 + node_modules/side-channel/.github/FUNDING.yml | 12 + node_modules/side-channel/.nycrc | 13 + node_modules/side-channel/CHANGELOG.md | 65 + node_modules/side-channel/LICENSE | 21 + node_modules/side-channel/README.md | 2 + node_modules/side-channel/index.js | 124 + node_modules/side-channel/package.json | 67 + node_modules/side-channel/test/index.js | 78 + node_modules/slash/index.d.ts | 25 + node_modules/slash/index.js | 11 + node_modules/slash/license | 9 + node_modules/slash/package.json | 35 + node_modules/slash/readme.md | 44 + .../string.prototype.matchall/.editorconfig | 20 + .../string.prototype.matchall/.eslintrc | 49 + .../.github/FUNDING.yml | 12 + node_modules/string.prototype.matchall/.nycrc | 9 + .../string.prototype.matchall/CHANGELOG.md | 129 + .../string.prototype.matchall/LICENSE | 22 + .../string.prototype.matchall/README.md | 75 + .../string.prototype.matchall/auto.js | 3 + .../implementation.js | 56 + .../string.prototype.matchall/index.js | 18 + .../string.prototype.matchall/package.json | 81 + .../polyfill-regexp-matchall.js | 11 + .../string.prototype.matchall/polyfill.js | 14 + .../regexp-matchall.js | 66 + .../string.prototype.matchall/shim.js | 49 + .../string.prototype.matchall/test/index.js | 13 + .../string.prototype.matchall/test/shimmed.js | 76 + .../string.prototype.matchall/test/tests.js | 247 + .../string.prototype.trimend/.editorconfig | 20 + .../string.prototype.trimend/.eslintrc | 24 + node_modules/string.prototype.trimend/.nycrc | 9 + .../string.prototype.trimend/CHANGELOG.md | 92 + node_modules/string.prototype.trimend/LICENSE | 21 + .../string.prototype.trimend/README.md | 46 + node_modules/string.prototype.trimend/auto.js | 3 + .../implementation.js | 15 + .../string.prototype.trimend/index.js | 23 + .../string.prototype.trimend/package.json | 71 + .../string.prototype.trimend/polyfill.js | 15 + node_modules/string.prototype.trimend/shim.js | 14 + .../test/implementation.js | 20 + .../string.prototype.trimend/test/index.js | 17 + .../string.prototype.trimend/test/shimmed.js | 36 + .../string.prototype.trimend/test/tests.js | 31 + .../string.prototype.trimstart/.editorconfig | 20 + .../string.prototype.trimstart/.eslintrc | 24 + .../string.prototype.trimstart/.nycrc | 9 + .../string.prototype.trimstart/CHANGELOG.md | 92 + .../string.prototype.trimstart/LICENSE | 21 + .../string.prototype.trimstart/README.md | 46 + .../string.prototype.trimstart/auto.js | 3 + .../implementation.js | 15 + .../string.prototype.trimstart/index.js | 23 + .../string.prototype.trimstart/package.json | 71 + .../string.prototype.trimstart/polyfill.js | 15 + .../string.prototype.trimstart/shim.js | 14 + .../test/implementation.js | 20 + .../string.prototype.trimstart/test/index.js | 18 + .../test/shimmed.js | 36 + .../string.prototype.trimstart/test/tests.js | 31 + node_modules/strip-ansi/index.d.ts | 17 + node_modules/strip-ansi/index.js | 4 + node_modules/strip-ansi/license | 9 + node_modules/strip-ansi/package.json | 54 + node_modules/strip-ansi/readme.md | 46 + node_modules/strip-json-comments/index.d.ts | 36 + node_modules/strip-json-comments/index.js | 77 + node_modules/strip-json-comments/license | 9 + node_modules/strip-json-comments/package.json | 47 + node_modules/strip-json-comments/readme.md | 78 + node_modules/supports-color/browser.js | 5 + node_modules/supports-color/index.js | 135 + node_modules/supports-color/license | 9 + node_modules/supports-color/package.json | 53 + node_modules/supports-color/readme.md | 76 + .../supports-preserve-symlinks-flag/.eslintrc | 14 + .../.github/FUNDING.yml | 12 + .../supports-preserve-symlinks-flag/.nycrc | 9 + .../CHANGELOG.md | 22 + .../supports-preserve-symlinks-flag/LICENSE | 21 + .../supports-preserve-symlinks-flag/README.md | 42 + .../browser.js | 3 + .../supports-preserve-symlinks-flag/index.js | 9 + .../package.json | 70 + .../test/index.js | 29 + node_modules/text-table/.travis.yml | 4 + node_modules/text-table/LICENSE | 18 + node_modules/text-table/example/align.js | 8 + node_modules/text-table/example/center.js | 8 + node_modules/text-table/example/dotalign.js | 9 + node_modules/text-table/example/doubledot.js | 11 + node_modules/text-table/example/table.js | 6 + node_modules/text-table/index.js | 86 + node_modules/text-table/package.json | 44 + node_modules/text-table/readme.markdown | 134 + node_modules/text-table/test/align.js | 18 + node_modules/text-table/test/ansi-colors.js | 32 + node_modules/text-table/test/center.js | 18 + node_modules/text-table/test/dotalign.js | 20 + node_modules/text-table/test/doubledot.js | 24 + node_modules/text-table/test/table.js | 14 + node_modules/to-regex-range/LICENSE | 21 + node_modules/to-regex-range/README.md | 305 + node_modules/to-regex-range/index.js | 288 + node_modules/to-regex-range/package.json | 88 + node_modules/type-check/LICENSE | 22 + node_modules/type-check/README.md | 210 + node_modules/type-check/lib/check.js | 128 + node_modules/type-check/lib/index.js | 16 + node_modules/type-check/lib/parse-type.js | 198 + node_modules/type-check/package.json | 39 + node_modules/type-fest/base.d.ts | 38 + node_modules/type-fest/index.d.ts | 2 + node_modules/type-fest/license | 9 + node_modules/type-fest/package.json | 58 + node_modules/type-fest/readme.md | 658 + .../type-fest/source/async-return-type.d.ts | 23 + node_modules/type-fest/source/asyncify.d.ts | 31 + node_modules/type-fest/source/basic.d.ts | 67 + .../type-fest/source/conditional-except.d.ts | 43 + .../type-fest/source/conditional-keys.d.ts | 43 + .../type-fest/source/conditional-pick.d.ts | 42 + node_modules/type-fest/source/entries.d.ts | 57 + node_modules/type-fest/source/entry.d.ts | 60 + node_modules/type-fest/source/except.d.ts | 22 + .../type-fest/source/fixed-length-array.d.ts | 38 + .../type-fest/source/iterable-element.d.ts | 46 + .../type-fest/source/literal-union.d.ts | 33 + .../type-fest/source/merge-exclusive.d.ts | 39 + node_modules/type-fest/source/merge.d.ts | 22 + node_modules/type-fest/source/mutable.d.ts | 22 + node_modules/type-fest/source/opaque.d.ts | 65 + .../type-fest/source/package-json.d.ts | 611 + .../type-fest/source/partial-deep.d.ts | 72 + node_modules/type-fest/source/promisable.d.ts | 23 + .../type-fest/source/promise-value.d.ts | 27 + .../type-fest/source/readonly-deep.d.ts | 59 + .../source/require-at-least-one.d.ts | 33 + .../type-fest/source/require-exactly-one.d.ts | 35 + .../type-fest/source/set-optional.d.ts | 34 + .../type-fest/source/set-required.d.ts | 34 + .../type-fest/source/set-return-type.d.ts | 29 + .../type-fest/source/stringified.d.ts | 21 + .../type-fest/source/tsconfig-json.d.ts | 870 + .../source/union-to-intersection.d.ts | 58 + node_modules/type-fest/source/utilities.d.ts | 3 + node_modules/type-fest/source/value-of.d.ts | 40 + node_modules/type-fest/ts41/camel-case.d.ts | 72 + .../type-fest/ts41/delimiter-case.d.ts | 85 + node_modules/type-fest/ts41/index.d.ts | 9 + node_modules/type-fest/ts41/kebab-case.d.ts | 36 + node_modules/type-fest/ts41/pascal-case.d.ts | 36 + node_modules/type-fest/ts41/snake-case.d.ts | 35 + node_modules/unbox-primitive/.editorconfig | 20 + node_modules/unbox-primitive/.eslintrc | 5 + .../unbox-primitive/.github/FUNDING.yml | 12 + node_modules/unbox-primitive/.nycrc | 13 + node_modules/unbox-primitive/CHANGELOG.md | 60 + node_modules/unbox-primitive/LICENSE | 21 + node_modules/unbox-primitive/README.md | 47 + node_modules/unbox-primitive/index.js | 39 + node_modules/unbox-primitive/package.json | 65 + node_modules/unbox-primitive/test/index.js | 59 + node_modules/uri-js/LICENSE | 11 + node_modules/uri-js/README.md | 203 + node_modules/uri-js/dist/es5/uri.all.d.ts | 59 + node_modules/uri-js/dist/es5/uri.all.js | 1443 ++ node_modules/uri-js/dist/es5/uri.all.js.map | 1 + node_modules/uri-js/dist/es5/uri.all.min.d.ts | 59 + node_modules/uri-js/dist/es5/uri.all.min.js | 3 + .../uri-js/dist/es5/uri.all.min.js.map | 1 + node_modules/uri-js/dist/esnext/index.d.ts | 1 + node_modules/uri-js/dist/esnext/index.js | 17 + node_modules/uri-js/dist/esnext/index.js.map | 1 + .../uri-js/dist/esnext/regexps-iri.d.ts | 3 + .../uri-js/dist/esnext/regexps-iri.js | 3 + .../uri-js/dist/esnext/regexps-iri.js.map | 1 + .../uri-js/dist/esnext/regexps-uri.d.ts | 4 + .../uri-js/dist/esnext/regexps-uri.js | 42 + .../uri-js/dist/esnext/regexps-uri.js.map | 1 + .../uri-js/dist/esnext/schemes/http.d.ts | 3 + .../uri-js/dist/esnext/schemes/http.js | 28 + .../uri-js/dist/esnext/schemes/http.js.map | 1 + .../uri-js/dist/esnext/schemes/https.d.ts | 3 + .../uri-js/dist/esnext/schemes/https.js | 9 + .../uri-js/dist/esnext/schemes/https.js.map | 1 + .../uri-js/dist/esnext/schemes/mailto.d.ts | 12 + .../uri-js/dist/esnext/schemes/mailto.js | 148 + .../uri-js/dist/esnext/schemes/mailto.js.map | 1 + .../uri-js/dist/esnext/schemes/urn-uuid.d.ts | 7 + .../uri-js/dist/esnext/schemes/urn-uuid.js | 23 + .../dist/esnext/schemes/urn-uuid.js.map | 1 + .../uri-js/dist/esnext/schemes/urn.d.ts | 10 + .../uri-js/dist/esnext/schemes/urn.js | 49 + .../uri-js/dist/esnext/schemes/urn.js.map | 1 + .../uri-js/dist/esnext/schemes/ws.d.ts | 7 + node_modules/uri-js/dist/esnext/schemes/ws.js | 41 + .../uri-js/dist/esnext/schemes/ws.js.map | 1 + .../uri-js/dist/esnext/schemes/wss.d.ts | 3 + .../uri-js/dist/esnext/schemes/wss.js | 9 + .../uri-js/dist/esnext/schemes/wss.js.map | 1 + node_modules/uri-js/dist/esnext/uri.d.ts | 59 + node_modules/uri-js/dist/esnext/uri.js | 480 + node_modules/uri-js/dist/esnext/uri.js.map | 1 + node_modules/uri-js/dist/esnext/util.d.ts | 6 + node_modules/uri-js/dist/esnext/util.js | 36 + node_modules/uri-js/dist/esnext/util.js.map | 1 + node_modules/uri-js/package.json | 77 + node_modules/uri-js/yarn.lock | 2558 +++ .../which-boxed-primitive/.editorconfig | 20 + .../which-boxed-primitive/.eslintignore | 1 + node_modules/which-boxed-primitive/.eslintrc | 9 + .../which-boxed-primitive/.github/FUNDING.yml | 12 + node_modules/which-boxed-primitive/.nycrc | 13 + .../which-boxed-primitive/CHANGELOG.md | 54 + node_modules/which-boxed-primitive/LICENSE | 21 + node_modules/which-boxed-primitive/README.md | 73 + node_modules/which-boxed-primitive/index.js | 30 + .../which-boxed-primitive/package.json | 65 + .../which-boxed-primitive/test/index.js | 66 + node_modules/which/CHANGELOG.md | 166 + node_modules/which/LICENSE | 15 + node_modules/which/README.md | 54 + node_modules/which/bin/node-which | 52 + node_modules/which/package.json | 43 + node_modules/which/which.js | 125 + node_modules/word-wrap/LICENSE | 21 + node_modules/word-wrap/README.md | 182 + node_modules/word-wrap/index.d.ts | 50 + node_modules/word-wrap/index.js | 46 + node_modules/word-wrap/package.json | 77 + node_modules/wrappy/LICENSE | 15 + node_modules/wrappy/README.md | 36 + node_modules/wrappy/package.json | 29 + node_modules/wrappy/wrappy.js | 33 + node_modules/yocto-queue/index.d.ts | 56 + node_modules/yocto-queue/index.js | 68 + node_modules/yocto-queue/license | 9 + node_modules/yocto-queue/package.json | 43 + node_modules/yocto-queue/readme.md | 64 + package-lock.json | 3751 ++++ package.json | 5 + 3846 files changed, 396901 insertions(+), 44 deletions(-) create mode 120000 node_modules/.bin/acorn create mode 120000 node_modules/.bin/eslint create mode 120000 node_modules/.bin/js-yaml create mode 120000 node_modules/.bin/loose-envify create mode 120000 node_modules/.bin/node-which create mode 120000 node_modules/.bin/resolve create mode 120000 node_modules/.bin/rimraf create mode 120000 node_modules/.bin/semver create mode 100644 node_modules/.package-lock.json create mode 100644 node_modules/@eslint/eslintrc/LICENSE create mode 100644 node_modules/@eslint/eslintrc/README.md create mode 100644 node_modules/@eslint/eslintrc/conf/config-schema.js create mode 100644 node_modules/@eslint/eslintrc/conf/environments.js create mode 100644 node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs create mode 100644 node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map create mode 100644 node_modules/@eslint/eslintrc/dist/eslintrc.cjs create mode 100644 node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map create mode 100644 node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array-factory.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array/config-array.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array/index.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array/override-tester.js create mode 100644 node_modules/@eslint/eslintrc/lib/flat-compat.js create mode 100644 node_modules/@eslint/eslintrc/lib/index-universal.js create mode 100644 node_modules/@eslint/eslintrc/lib/index.js create mode 100644 node_modules/@eslint/eslintrc/lib/shared/ajv.js create mode 100644 node_modules/@eslint/eslintrc/lib/shared/config-ops.js create mode 100644 node_modules/@eslint/eslintrc/lib/shared/config-validator.js create mode 100644 node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js create mode 100644 node_modules/@eslint/eslintrc/lib/shared/naming.js create mode 100644 node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js create mode 100644 node_modules/@eslint/eslintrc/lib/shared/types.js create mode 100644 node_modules/@eslint/eslintrc/package.json create mode 100644 node_modules/@eslint/eslintrc/universal.js create mode 100644 node_modules/@humanwhocodes/config-array/CHANGELOG.md create mode 100644 node_modules/@humanwhocodes/config-array/LICENSE create mode 100644 node_modules/@humanwhocodes/config-array/README.md create mode 100644 node_modules/@humanwhocodes/config-array/api.js create mode 100644 node_modules/@humanwhocodes/config-array/package.json create mode 100644 node_modules/@humanwhocodes/module-importer/CHANGELOG.md create mode 100644 node_modules/@humanwhocodes/module-importer/LICENSE create mode 100644 node_modules/@humanwhocodes/module-importer/README.md create mode 100644 node_modules/@humanwhocodes/module-importer/dist/module-importer.cjs create mode 100644 node_modules/@humanwhocodes/module-importer/dist/module-importer.d.cts create mode 100644 node_modules/@humanwhocodes/module-importer/dist/module-importer.d.ts create mode 100644 node_modules/@humanwhocodes/module-importer/dist/module-importer.js create mode 100644 node_modules/@humanwhocodes/module-importer/package.json create mode 100644 node_modules/@humanwhocodes/module-importer/src/module-importer.cjs create mode 100644 node_modules/@humanwhocodes/module-importer/src/module-importer.js create mode 100644 node_modules/@humanwhocodes/object-schema/.eslintrc.js create mode 100644 node_modules/@humanwhocodes/object-schema/.github/workflows/nodejs-test.yml create mode 100644 node_modules/@humanwhocodes/object-schema/.github/workflows/release-please.yml create mode 100644 node_modules/@humanwhocodes/object-schema/CHANGELOG.md create mode 100644 node_modules/@humanwhocodes/object-schema/LICENSE create mode 100644 node_modules/@humanwhocodes/object-schema/README.md create mode 100644 node_modules/@humanwhocodes/object-schema/package.json create mode 100644 node_modules/@humanwhocodes/object-schema/src/index.js create mode 100644 node_modules/@humanwhocodes/object-schema/src/merge-strategy.js create mode 100644 node_modules/@humanwhocodes/object-schema/src/object-schema.js create mode 100644 node_modules/@humanwhocodes/object-schema/src/validation-strategy.js create mode 100644 node_modules/@humanwhocodes/object-schema/tests/merge-strategy.js create mode 100644 node_modules/@humanwhocodes/object-schema/tests/object-schema.js create mode 100644 node_modules/@humanwhocodes/object-schema/tests/validation-strategy.js create mode 100644 node_modules/@nodelib/fs.scandir/LICENSE create mode 100644 node_modules/@nodelib/fs.scandir/README.md create mode 100644 node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/adapters/fs.js create mode 100644 node_modules/@nodelib/fs.scandir/out/constants.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/constants.js create mode 100644 node_modules/@nodelib/fs.scandir/out/index.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/index.js create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/async.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/async.js create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/common.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/common.js create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/sync.js create mode 100644 node_modules/@nodelib/fs.scandir/out/settings.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/settings.js create mode 100644 node_modules/@nodelib/fs.scandir/out/types/index.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/types/index.js create mode 100644 node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/utils/fs.js create mode 100644 node_modules/@nodelib/fs.scandir/out/utils/index.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/utils/index.js create mode 100644 node_modules/@nodelib/fs.scandir/package.json create mode 100644 node_modules/@nodelib/fs.stat/LICENSE create mode 100644 node_modules/@nodelib/fs.stat/README.md create mode 100644 node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/adapters/fs.js create mode 100644 node_modules/@nodelib/fs.stat/out/index.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/index.js create mode 100644 node_modules/@nodelib/fs.stat/out/providers/async.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/providers/async.js create mode 100644 node_modules/@nodelib/fs.stat/out/providers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/providers/sync.js create mode 100644 node_modules/@nodelib/fs.stat/out/settings.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/settings.js create mode 100644 node_modules/@nodelib/fs.stat/out/types/index.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/types/index.js create mode 100644 node_modules/@nodelib/fs.stat/package.json create mode 100644 node_modules/@nodelib/fs.walk/LICENSE create mode 100644 node_modules/@nodelib/fs.walk/README.md create mode 100644 node_modules/@nodelib/fs.walk/out/index.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/index.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/async.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/async.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/index.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/index.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/stream.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/stream.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/sync.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/async.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/async.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/common.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/common.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/reader.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/reader.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/sync.js create mode 100644 node_modules/@nodelib/fs.walk/out/settings.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/settings.js create mode 100644 node_modules/@nodelib/fs.walk/out/types/index.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/types/index.js create mode 100644 node_modules/@nodelib/fs.walk/package.json create mode 100644 node_modules/acorn-jsx/LICENSE create mode 100644 node_modules/acorn-jsx/README.md create mode 100644 node_modules/acorn-jsx/index.d.ts create mode 100644 node_modules/acorn-jsx/index.js create mode 100644 node_modules/acorn-jsx/package.json create mode 100644 node_modules/acorn-jsx/xhtml.js create mode 100644 node_modules/acorn/CHANGELOG.md create mode 100644 node_modules/acorn/LICENSE create mode 100644 node_modules/acorn/README.md create mode 100755 node_modules/acorn/bin/acorn create mode 100644 node_modules/acorn/dist/acorn.d.ts create mode 100644 node_modules/acorn/dist/acorn.js create mode 100644 node_modules/acorn/dist/acorn.mjs create mode 100644 node_modules/acorn/dist/acorn.mjs.d.ts create mode 100644 node_modules/acorn/dist/bin.js create mode 100644 node_modules/acorn/package.json create mode 100644 node_modules/ajv/.tonic_example.js create mode 100644 node_modules/ajv/LICENSE create mode 100644 node_modules/ajv/README.md create mode 100644 node_modules/ajv/dist/ajv.bundle.js create mode 100644 node_modules/ajv/dist/ajv.min.js create mode 100644 node_modules/ajv/dist/ajv.min.js.map create mode 100644 node_modules/ajv/lib/ajv.d.ts create mode 100644 node_modules/ajv/lib/ajv.js create mode 100644 node_modules/ajv/lib/cache.js create mode 100644 node_modules/ajv/lib/compile/async.js create mode 100644 node_modules/ajv/lib/compile/equal.js create mode 100644 node_modules/ajv/lib/compile/error_classes.js create mode 100644 node_modules/ajv/lib/compile/formats.js create mode 100644 node_modules/ajv/lib/compile/index.js create mode 100644 node_modules/ajv/lib/compile/resolve.js create mode 100644 node_modules/ajv/lib/compile/rules.js create mode 100644 node_modules/ajv/lib/compile/schema_obj.js create mode 100644 node_modules/ajv/lib/compile/ucs2length.js create mode 100644 node_modules/ajv/lib/compile/util.js create mode 100644 node_modules/ajv/lib/data.js create mode 100644 node_modules/ajv/lib/definition_schema.js create mode 100644 node_modules/ajv/lib/dot/_limit.jst create mode 100644 node_modules/ajv/lib/dot/_limitItems.jst create mode 100644 node_modules/ajv/lib/dot/_limitLength.jst create mode 100644 node_modules/ajv/lib/dot/_limitProperties.jst create mode 100644 node_modules/ajv/lib/dot/allOf.jst create mode 100644 node_modules/ajv/lib/dot/anyOf.jst create mode 100644 node_modules/ajv/lib/dot/coerce.def create mode 100644 node_modules/ajv/lib/dot/comment.jst create mode 100644 node_modules/ajv/lib/dot/const.jst create mode 100644 node_modules/ajv/lib/dot/contains.jst create mode 100644 node_modules/ajv/lib/dot/custom.jst create mode 100644 node_modules/ajv/lib/dot/defaults.def create mode 100644 node_modules/ajv/lib/dot/definitions.def create mode 100644 node_modules/ajv/lib/dot/dependencies.jst create mode 100644 node_modules/ajv/lib/dot/enum.jst create mode 100644 node_modules/ajv/lib/dot/errors.def create mode 100644 node_modules/ajv/lib/dot/format.jst create mode 100644 node_modules/ajv/lib/dot/if.jst create mode 100644 node_modules/ajv/lib/dot/items.jst create mode 100644 node_modules/ajv/lib/dot/missing.def create mode 100644 node_modules/ajv/lib/dot/multipleOf.jst create mode 100644 node_modules/ajv/lib/dot/not.jst create mode 100644 node_modules/ajv/lib/dot/oneOf.jst create mode 100644 node_modules/ajv/lib/dot/pattern.jst create mode 100644 node_modules/ajv/lib/dot/properties.jst create mode 100644 node_modules/ajv/lib/dot/propertyNames.jst create mode 100644 node_modules/ajv/lib/dot/ref.jst create mode 100644 node_modules/ajv/lib/dot/required.jst create mode 100644 node_modules/ajv/lib/dot/uniqueItems.jst create mode 100644 node_modules/ajv/lib/dot/validate.jst create mode 100644 node_modules/ajv/lib/dotjs/README.md create mode 100644 node_modules/ajv/lib/dotjs/_limit.js create mode 100644 node_modules/ajv/lib/dotjs/_limitItems.js create mode 100644 node_modules/ajv/lib/dotjs/_limitLength.js create mode 100644 node_modules/ajv/lib/dotjs/_limitProperties.js create mode 100644 node_modules/ajv/lib/dotjs/allOf.js create mode 100644 node_modules/ajv/lib/dotjs/anyOf.js create mode 100644 node_modules/ajv/lib/dotjs/comment.js create mode 100644 node_modules/ajv/lib/dotjs/const.js create mode 100644 node_modules/ajv/lib/dotjs/contains.js create mode 100644 node_modules/ajv/lib/dotjs/custom.js create mode 100644 node_modules/ajv/lib/dotjs/dependencies.js create mode 100644 node_modules/ajv/lib/dotjs/enum.js create mode 100644 node_modules/ajv/lib/dotjs/format.js create mode 100644 node_modules/ajv/lib/dotjs/if.js create mode 100644 node_modules/ajv/lib/dotjs/index.js create mode 100644 node_modules/ajv/lib/dotjs/items.js create mode 100644 node_modules/ajv/lib/dotjs/multipleOf.js create mode 100644 node_modules/ajv/lib/dotjs/not.js create mode 100644 node_modules/ajv/lib/dotjs/oneOf.js create mode 100644 node_modules/ajv/lib/dotjs/pattern.js create mode 100644 node_modules/ajv/lib/dotjs/properties.js create mode 100644 node_modules/ajv/lib/dotjs/propertyNames.js create mode 100644 node_modules/ajv/lib/dotjs/ref.js create mode 100644 node_modules/ajv/lib/dotjs/required.js create mode 100644 node_modules/ajv/lib/dotjs/uniqueItems.js create mode 100644 node_modules/ajv/lib/dotjs/validate.js create mode 100644 node_modules/ajv/lib/keyword.js create mode 100644 node_modules/ajv/lib/refs/data.json create mode 100644 node_modules/ajv/lib/refs/json-schema-draft-04.json create mode 100644 node_modules/ajv/lib/refs/json-schema-draft-06.json create mode 100644 node_modules/ajv/lib/refs/json-schema-draft-07.json create mode 100644 node_modules/ajv/lib/refs/json-schema-secure.json create mode 100644 node_modules/ajv/package.json create mode 100644 node_modules/ajv/scripts/.eslintrc.yml create mode 100644 node_modules/ajv/scripts/bundle.js create mode 100644 node_modules/ajv/scripts/compile-dots.js create mode 100644 node_modules/ajv/scripts/info create mode 100644 node_modules/ajv/scripts/prepare-tests create mode 100644 node_modules/ajv/scripts/publish-built-version create mode 100644 node_modules/ajv/scripts/travis-gh-pages create mode 100644 node_modules/ansi-regex/index.d.ts create mode 100644 node_modules/ansi-regex/index.js create mode 100644 node_modules/ansi-regex/license create mode 100644 node_modules/ansi-regex/package.json create mode 100644 node_modules/ansi-regex/readme.md create mode 100644 node_modules/ansi-styles/index.d.ts create mode 100644 node_modules/ansi-styles/index.js create mode 100644 node_modules/ansi-styles/license create mode 100644 node_modules/ansi-styles/package.json create mode 100644 node_modules/ansi-styles/readme.md create mode 100644 node_modules/argparse/CHANGELOG.md create mode 100644 node_modules/argparse/LICENSE create mode 100644 node_modules/argparse/README.md create mode 100644 node_modules/argparse/argparse.js create mode 100644 node_modules/argparse/lib/sub.js create mode 100644 node_modules/argparse/lib/textwrap.js create mode 100644 node_modules/argparse/package.json create mode 100644 node_modules/array-includes/.editorconfig create mode 100644 node_modules/array-includes/.eslintrc create mode 100644 node_modules/array-includes/.github/FUNDING.yml create mode 100644 node_modules/array-includes/.nycrc create mode 100644 node_modules/array-includes/CHANGELOG.md create mode 100644 node_modules/array-includes/LICENSE create mode 100644 node_modules/array-includes/README.md create mode 100644 node_modules/array-includes/auto.js create mode 100644 node_modules/array-includes/implementation.js create mode 100644 node_modules/array-includes/index.js create mode 100644 node_modules/array-includes/package.json create mode 100644 node_modules/array-includes/polyfill.js create mode 100644 node_modules/array-includes/shim.js create mode 100644 node_modules/array-includes/test/implementation.js create mode 100644 node_modules/array-includes/test/index.js create mode 100644 node_modules/array-includes/test/shimmed.js create mode 100644 node_modules/array-includes/test/tests.js create mode 100644 node_modules/array-union/index.d.ts create mode 100644 node_modules/array-union/index.js create mode 100644 node_modules/array-union/license create mode 100644 node_modules/array-union/package.json create mode 100644 node_modules/array-union/readme.md create mode 100644 node_modules/array.prototype.flatmap/.editorconfig create mode 100644 node_modules/array.prototype.flatmap/.eslintrc create mode 100644 node_modules/array.prototype.flatmap/.github/FUNDING.yml create mode 100644 node_modules/array.prototype.flatmap/.nycrc create mode 100644 node_modules/array.prototype.flatmap/CHANGELOG.md create mode 100644 node_modules/array.prototype.flatmap/LICENSE create mode 100644 node_modules/array.prototype.flatmap/README.md create mode 100644 node_modules/array.prototype.flatmap/auto.js create mode 100644 node_modules/array.prototype.flatmap/implementation.js create mode 100644 node_modules/array.prototype.flatmap/index.js create mode 100644 node_modules/array.prototype.flatmap/package.json create mode 100644 node_modules/array.prototype.flatmap/polyfill.js create mode 100644 node_modules/array.prototype.flatmap/shim.js create mode 100644 node_modules/array.prototype.flatmap/test/implementation.js create mode 100644 node_modules/array.prototype.flatmap/test/index.js create mode 100644 node_modules/array.prototype.flatmap/test/shimmed.js create mode 100644 node_modules/array.prototype.flatmap/test/tests.js create mode 100644 node_modules/balanced-match/.github/FUNDING.yml create mode 100644 node_modules/balanced-match/LICENSE.md create mode 100644 node_modules/balanced-match/README.md create mode 100644 node_modules/balanced-match/index.js create mode 100644 node_modules/balanced-match/package.json create mode 100644 node_modules/brace-expansion/LICENSE create mode 100644 node_modules/brace-expansion/README.md create mode 100644 node_modules/brace-expansion/index.js create mode 100644 node_modules/brace-expansion/package.json create mode 100644 node_modules/braces/CHANGELOG.md create mode 100644 node_modules/braces/LICENSE create mode 100644 node_modules/braces/README.md create mode 100644 node_modules/braces/index.js create mode 100644 node_modules/braces/lib/compile.js create mode 100644 node_modules/braces/lib/constants.js create mode 100644 node_modules/braces/lib/expand.js create mode 100644 node_modules/braces/lib/parse.js create mode 100644 node_modules/braces/lib/stringify.js create mode 100644 node_modules/braces/lib/utils.js create mode 100644 node_modules/braces/package.json create mode 100644 node_modules/call-bind/.eslintignore create mode 100644 node_modules/call-bind/.eslintrc create mode 100644 node_modules/call-bind/.github/FUNDING.yml create mode 100644 node_modules/call-bind/.nycrc create mode 100644 node_modules/call-bind/CHANGELOG.md create mode 100644 node_modules/call-bind/LICENSE create mode 100644 node_modules/call-bind/README.md create mode 100644 node_modules/call-bind/callBound.js create mode 100644 node_modules/call-bind/index.js create mode 100644 node_modules/call-bind/package.json create mode 100644 node_modules/call-bind/test/callBound.js create mode 100644 node_modules/call-bind/test/index.js create mode 100644 node_modules/callsites/index.d.ts create mode 100644 node_modules/callsites/index.js create mode 100644 node_modules/callsites/license create mode 100644 node_modules/callsites/package.json create mode 100644 node_modules/callsites/readme.md create mode 100644 node_modules/chalk/index.d.ts create mode 100644 node_modules/chalk/license create mode 100644 node_modules/chalk/package.json create mode 100644 node_modules/chalk/readme.md create mode 100644 node_modules/chalk/source/index.js create mode 100644 node_modules/chalk/source/templates.js create mode 100644 node_modules/chalk/source/util.js create mode 100644 node_modules/color-convert/CHANGELOG.md create mode 100644 node_modules/color-convert/LICENSE create mode 100644 node_modules/color-convert/README.md create mode 100644 node_modules/color-convert/conversions.js create mode 100644 node_modules/color-convert/index.js create mode 100644 node_modules/color-convert/package.json create mode 100644 node_modules/color-convert/route.js create mode 100644 node_modules/color-name/LICENSE create mode 100644 node_modules/color-name/README.md create mode 100644 node_modules/color-name/index.js create mode 100644 node_modules/color-name/package.json create mode 100644 node_modules/concat-map/.travis.yml create mode 100644 node_modules/concat-map/LICENSE create mode 100644 node_modules/concat-map/README.markdown create mode 100644 node_modules/concat-map/example/map.js create mode 100644 node_modules/concat-map/index.js create mode 100644 node_modules/concat-map/package.json create mode 100644 node_modules/concat-map/test/map.js create mode 100644 node_modules/cross-spawn/CHANGELOG.md create mode 100644 node_modules/cross-spawn/LICENSE create mode 100644 node_modules/cross-spawn/README.md create mode 100644 node_modules/cross-spawn/index.js create mode 100644 node_modules/cross-spawn/lib/enoent.js create mode 100644 node_modules/cross-spawn/lib/parse.js create mode 100644 node_modules/cross-spawn/lib/util/escape.js create mode 100644 node_modules/cross-spawn/lib/util/readShebang.js create mode 100644 node_modules/cross-spawn/lib/util/resolveCommand.js create mode 100644 node_modules/cross-spawn/package.json create mode 100644 node_modules/debug/LICENSE create mode 100644 node_modules/debug/README.md create mode 100644 node_modules/debug/package.json create mode 100644 node_modules/debug/src/browser.js create mode 100644 node_modules/debug/src/common.js create mode 100644 node_modules/debug/src/index.js create mode 100644 node_modules/debug/src/node.js create mode 100644 node_modules/deep-is/.travis.yml create mode 100644 node_modules/deep-is/LICENSE create mode 100644 node_modules/deep-is/README.markdown create mode 100644 node_modules/deep-is/example/cmp.js create mode 100644 node_modules/deep-is/index.js create mode 100644 node_modules/deep-is/package.json create mode 100644 node_modules/deep-is/test/NaN.js create mode 100644 node_modules/deep-is/test/cmp.js create mode 100644 node_modules/deep-is/test/neg-vs-pos-0.js create mode 100644 node_modules/define-properties/.editorconfig create mode 100644 node_modules/define-properties/.eslintrc create mode 100644 node_modules/define-properties/.github/FUNDING.yml create mode 100644 node_modules/define-properties/.nycrc create mode 100644 node_modules/define-properties/CHANGELOG.md create mode 100644 node_modules/define-properties/LICENSE create mode 100644 node_modules/define-properties/README.md create mode 100644 node_modules/define-properties/index.js create mode 100644 node_modules/define-properties/package.json create mode 100644 node_modules/dir-glob/index.js create mode 100644 node_modules/dir-glob/license create mode 100644 node_modules/dir-glob/package.json create mode 100644 node_modules/dir-glob/readme.md create mode 100644 node_modules/doctrine/CHANGELOG.md create mode 100644 node_modules/doctrine/LICENSE create mode 100644 node_modules/doctrine/LICENSE.closure-compiler create mode 100644 node_modules/doctrine/LICENSE.esprima create mode 100644 node_modules/doctrine/README.md create mode 100644 node_modules/doctrine/lib/doctrine.js create mode 100644 node_modules/doctrine/lib/typed.js create mode 100644 node_modules/doctrine/lib/utility.js create mode 100644 node_modules/doctrine/package.json create mode 100644 node_modules/es-abstract/.editorconfig create mode 100644 node_modules/es-abstract/.eslintrc create mode 100644 node_modules/es-abstract/.nycrc create mode 100644 node_modules/es-abstract/2015/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/2015/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/2015/AdvanceStringIndex.js create mode 100644 node_modules/es-abstract/2015/ArrayCreate.js create mode 100644 node_modules/es-abstract/2015/ArraySetLength.js create mode 100644 node_modules/es-abstract/2015/ArraySpeciesCreate.js create mode 100644 node_modules/es-abstract/2015/Call.js create mode 100644 node_modules/es-abstract/2015/CanonicalNumericIndexString.js create mode 100644 node_modules/es-abstract/2015/CharacterRange.js create mode 100644 node_modules/es-abstract/2015/CompletePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2015/CreateDataProperty.js create mode 100644 node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2015/CreateHTML.js create mode 100644 node_modules/es-abstract/2015/CreateIterResultObject.js create mode 100644 node_modules/es-abstract/2015/CreateListFromArrayLike.js create mode 100644 node_modules/es-abstract/2015/CreateMethodProperty.js create mode 100644 node_modules/es-abstract/2015/DateFromTime.js create mode 100644 node_modules/es-abstract/2015/Day.js create mode 100644 node_modules/es-abstract/2015/DayFromYear.js create mode 100644 node_modules/es-abstract/2015/DayWithinYear.js create mode 100644 node_modules/es-abstract/2015/DaysInYear.js create mode 100644 node_modules/es-abstract/2015/DefinePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2015/DeletePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2015/EnumerableOwnNames.js create mode 100644 node_modules/es-abstract/2015/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2015/Get.js create mode 100644 node_modules/es-abstract/2015/GetIterator.js create mode 100644 node_modules/es-abstract/2015/GetMethod.js create mode 100644 node_modules/es-abstract/2015/GetOwnPropertyKeys.js create mode 100644 node_modules/es-abstract/2015/GetPrototypeFromConstructor.js create mode 100644 node_modules/es-abstract/2015/GetSubstitution.js create mode 100644 node_modules/es-abstract/2015/GetV.js create mode 100644 node_modules/es-abstract/2015/HasOwnProperty.js create mode 100644 node_modules/es-abstract/2015/HasProperty.js create mode 100644 node_modules/es-abstract/2015/HourFromTime.js create mode 100644 node_modules/es-abstract/2015/InLeapYear.js create mode 100644 node_modules/es-abstract/2015/InstanceofOperator.js create mode 100644 node_modules/es-abstract/2015/Invoke.js create mode 100644 node_modules/es-abstract/2015/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/2015/IsArray.js create mode 100644 node_modules/es-abstract/2015/IsCallable.js create mode 100644 node_modules/es-abstract/2015/IsCompatiblePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2015/IsConcatSpreadable.js create mode 100644 node_modules/es-abstract/2015/IsConstructor.js create mode 100644 node_modules/es-abstract/2015/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/2015/IsExtensible.js create mode 100644 node_modules/es-abstract/2015/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/2015/IsInteger.js create mode 100644 node_modules/es-abstract/2015/IsPromise.js create mode 100644 node_modules/es-abstract/2015/IsPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2015/IsPropertyKey.js create mode 100644 node_modules/es-abstract/2015/IsRegExp.js create mode 100644 node_modules/es-abstract/2015/IteratorClose.js create mode 100644 node_modules/es-abstract/2015/IteratorComplete.js create mode 100644 node_modules/es-abstract/2015/IteratorNext.js create mode 100644 node_modules/es-abstract/2015/IteratorStep.js create mode 100644 node_modules/es-abstract/2015/IteratorValue.js create mode 100644 node_modules/es-abstract/2015/MakeDate.js create mode 100644 node_modules/es-abstract/2015/MakeDay.js create mode 100644 node_modules/es-abstract/2015/MakeTime.js create mode 100644 node_modules/es-abstract/2015/MinFromTime.js create mode 100644 node_modules/es-abstract/2015/MonthFromTime.js create mode 100644 node_modules/es-abstract/2015/ObjectCreate.js create mode 100644 node_modules/es-abstract/2015/ObjectDefineProperties.js create mode 100644 node_modules/es-abstract/2015/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js create mode 100644 node_modules/es-abstract/2015/OrdinaryHasInstance.js create mode 100644 node_modules/es-abstract/2015/OrdinaryHasProperty.js create mode 100644 node_modules/es-abstract/2015/QuoteJSONString.js create mode 100644 node_modules/es-abstract/2015/RegExpCreate.js create mode 100644 node_modules/es-abstract/2015/RegExpExec.js create mode 100644 node_modules/es-abstract/2015/RequireObjectCoercible.js create mode 100644 node_modules/es-abstract/2015/SameValue.js create mode 100644 node_modules/es-abstract/2015/SameValueZero.js create mode 100644 node_modules/es-abstract/2015/SecFromTime.js create mode 100644 node_modules/es-abstract/2015/Set.js create mode 100644 node_modules/es-abstract/2015/SetFunctionName.js create mode 100644 node_modules/es-abstract/2015/SetIntegrityLevel.js create mode 100644 node_modules/es-abstract/2015/SpeciesConstructor.js create mode 100644 node_modules/es-abstract/2015/SplitMatch.js create mode 100644 node_modules/es-abstract/2015/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/2015/StringCreate.js create mode 100644 node_modules/es-abstract/2015/StringGetIndexProperty.js create mode 100644 node_modules/es-abstract/2015/SymbolDescriptiveString.js create mode 100644 node_modules/es-abstract/2015/TestIntegrityLevel.js create mode 100644 node_modules/es-abstract/2015/TimeClip.js create mode 100644 node_modules/es-abstract/2015/TimeFromYear.js create mode 100644 node_modules/es-abstract/2015/TimeWithinDay.js create mode 100644 node_modules/es-abstract/2015/ToBoolean.js create mode 100644 node_modules/es-abstract/2015/ToDateString.js create mode 100644 node_modules/es-abstract/2015/ToInt16.js create mode 100644 node_modules/es-abstract/2015/ToInt32.js create mode 100644 node_modules/es-abstract/2015/ToInt8.js create mode 100644 node_modules/es-abstract/2015/ToInteger.js create mode 100644 node_modules/es-abstract/2015/ToLength.js create mode 100644 node_modules/es-abstract/2015/ToNumber.js create mode 100644 node_modules/es-abstract/2015/ToObject.js create mode 100644 node_modules/es-abstract/2015/ToPrimitive.js create mode 100644 node_modules/es-abstract/2015/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2015/ToPropertyKey.js create mode 100644 node_modules/es-abstract/2015/ToString.js create mode 100644 node_modules/es-abstract/2015/ToUint16.js create mode 100644 node_modules/es-abstract/2015/ToUint32.js create mode 100644 node_modules/es-abstract/2015/ToUint8.js create mode 100644 node_modules/es-abstract/2015/ToUint8Clamp.js create mode 100644 node_modules/es-abstract/2015/Type.js create mode 100644 node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2015/WeekDay.js create mode 100644 node_modules/es-abstract/2015/YearFromTime.js create mode 100644 node_modules/es-abstract/2015/abs.js create mode 100644 node_modules/es-abstract/2015/floor.js create mode 100644 node_modules/es-abstract/2015/modulo.js create mode 100644 node_modules/es-abstract/2015/msFromTime.js create mode 100644 node_modules/es-abstract/2015/thisBooleanValue.js create mode 100644 node_modules/es-abstract/2015/thisNumberValue.js create mode 100644 node_modules/es-abstract/2015/thisStringValue.js create mode 100644 node_modules/es-abstract/2015/thisTimeValue.js create mode 100644 node_modules/es-abstract/2016/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/2016/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/2016/AdvanceStringIndex.js create mode 100644 node_modules/es-abstract/2016/ArrayCreate.js create mode 100644 node_modules/es-abstract/2016/ArraySetLength.js create mode 100644 node_modules/es-abstract/2016/ArraySpeciesCreate.js create mode 100644 node_modules/es-abstract/2016/Call.js create mode 100644 node_modules/es-abstract/2016/CanonicalNumericIndexString.js create mode 100644 node_modules/es-abstract/2016/CharacterRange.js create mode 100644 node_modules/es-abstract/2016/CompletePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2016/CreateDataProperty.js create mode 100644 node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2016/CreateHTML.js create mode 100644 node_modules/es-abstract/2016/CreateIterResultObject.js create mode 100644 node_modules/es-abstract/2016/CreateListFromArrayLike.js create mode 100644 node_modules/es-abstract/2016/CreateMethodProperty.js create mode 100644 node_modules/es-abstract/2016/DateFromTime.js create mode 100644 node_modules/es-abstract/2016/Day.js create mode 100644 node_modules/es-abstract/2016/DayFromYear.js create mode 100644 node_modules/es-abstract/2016/DayWithinYear.js create mode 100644 node_modules/es-abstract/2016/DaysInYear.js create mode 100644 node_modules/es-abstract/2016/DefinePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2016/DeletePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2016/EnumerableOwnNames.js create mode 100644 node_modules/es-abstract/2016/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2016/Get.js create mode 100644 node_modules/es-abstract/2016/GetIterator.js create mode 100644 node_modules/es-abstract/2016/GetMethod.js create mode 100644 node_modules/es-abstract/2016/GetOwnPropertyKeys.js create mode 100644 node_modules/es-abstract/2016/GetPrototypeFromConstructor.js create mode 100644 node_modules/es-abstract/2016/GetSubstitution.js create mode 100644 node_modules/es-abstract/2016/GetV.js create mode 100644 node_modules/es-abstract/2016/HasOwnProperty.js create mode 100644 node_modules/es-abstract/2016/HasProperty.js create mode 100644 node_modules/es-abstract/2016/HourFromTime.js create mode 100644 node_modules/es-abstract/2016/InLeapYear.js create mode 100644 node_modules/es-abstract/2016/InstanceofOperator.js create mode 100644 node_modules/es-abstract/2016/Invoke.js create mode 100644 node_modules/es-abstract/2016/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/2016/IsArray.js create mode 100644 node_modules/es-abstract/2016/IsCallable.js create mode 100644 node_modules/es-abstract/2016/IsCompatiblePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2016/IsConcatSpreadable.js create mode 100644 node_modules/es-abstract/2016/IsConstructor.js create mode 100644 node_modules/es-abstract/2016/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/2016/IsExtensible.js create mode 100644 node_modules/es-abstract/2016/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/2016/IsInteger.js create mode 100644 node_modules/es-abstract/2016/IsPromise.js create mode 100644 node_modules/es-abstract/2016/IsPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2016/IsPropertyKey.js create mode 100644 node_modules/es-abstract/2016/IsRegExp.js create mode 100644 node_modules/es-abstract/2016/IterableToArrayLike.js create mode 100644 node_modules/es-abstract/2016/IteratorClose.js create mode 100644 node_modules/es-abstract/2016/IteratorComplete.js create mode 100644 node_modules/es-abstract/2016/IteratorNext.js create mode 100644 node_modules/es-abstract/2016/IteratorStep.js create mode 100644 node_modules/es-abstract/2016/IteratorValue.js create mode 100644 node_modules/es-abstract/2016/MakeDate.js create mode 100644 node_modules/es-abstract/2016/MakeDay.js create mode 100644 node_modules/es-abstract/2016/MakeTime.js create mode 100644 node_modules/es-abstract/2016/MinFromTime.js create mode 100644 node_modules/es-abstract/2016/MonthFromTime.js create mode 100644 node_modules/es-abstract/2016/ObjectCreate.js create mode 100644 node_modules/es-abstract/2016/ObjectDefineProperties.js create mode 100644 node_modules/es-abstract/2016/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js create mode 100644 node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/es-abstract/2016/OrdinaryHasInstance.js create mode 100644 node_modules/es-abstract/2016/OrdinaryHasProperty.js create mode 100644 node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js create mode 100644 node_modules/es-abstract/2016/QuoteJSONString.js create mode 100644 node_modules/es-abstract/2016/RegExpCreate.js create mode 100644 node_modules/es-abstract/2016/RegExpExec.js create mode 100644 node_modules/es-abstract/2016/RequireObjectCoercible.js create mode 100644 node_modules/es-abstract/2016/SameValue.js create mode 100644 node_modules/es-abstract/2016/SameValueNonNumber.js create mode 100644 node_modules/es-abstract/2016/SameValueZero.js create mode 100644 node_modules/es-abstract/2016/SecFromTime.js create mode 100644 node_modules/es-abstract/2016/Set.js create mode 100644 node_modules/es-abstract/2016/SetFunctionName.js create mode 100644 node_modules/es-abstract/2016/SetIntegrityLevel.js create mode 100644 node_modules/es-abstract/2016/SpeciesConstructor.js create mode 100644 node_modules/es-abstract/2016/SplitMatch.js create mode 100644 node_modules/es-abstract/2016/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/2016/StringCreate.js create mode 100644 node_modules/es-abstract/2016/SymbolDescriptiveString.js create mode 100644 node_modules/es-abstract/2016/TestIntegrityLevel.js create mode 100644 node_modules/es-abstract/2016/TimeClip.js create mode 100644 node_modules/es-abstract/2016/TimeFromYear.js create mode 100644 node_modules/es-abstract/2016/TimeWithinDay.js create mode 100644 node_modules/es-abstract/2016/ToBoolean.js create mode 100644 node_modules/es-abstract/2016/ToDateString.js create mode 100644 node_modules/es-abstract/2016/ToInt16.js create mode 100644 node_modules/es-abstract/2016/ToInt32.js create mode 100644 node_modules/es-abstract/2016/ToInt8.js create mode 100644 node_modules/es-abstract/2016/ToInteger.js create mode 100644 node_modules/es-abstract/2016/ToLength.js create mode 100644 node_modules/es-abstract/2016/ToNumber.js create mode 100644 node_modules/es-abstract/2016/ToObject.js create mode 100644 node_modules/es-abstract/2016/ToPrimitive.js create mode 100644 node_modules/es-abstract/2016/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2016/ToPropertyKey.js create mode 100644 node_modules/es-abstract/2016/ToString.js create mode 100644 node_modules/es-abstract/2016/ToUint16.js create mode 100644 node_modules/es-abstract/2016/ToUint32.js create mode 100644 node_modules/es-abstract/2016/ToUint8.js create mode 100644 node_modules/es-abstract/2016/ToUint8Clamp.js create mode 100644 node_modules/es-abstract/2016/Type.js create mode 100644 node_modules/es-abstract/2016/UTF16Decode.js create mode 100644 node_modules/es-abstract/2016/UTF16Encoding.js create mode 100644 node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2016/WeekDay.js create mode 100644 node_modules/es-abstract/2016/YearFromTime.js create mode 100644 node_modules/es-abstract/2016/abs.js create mode 100644 node_modules/es-abstract/2016/floor.js create mode 100644 node_modules/es-abstract/2016/modulo.js create mode 100644 node_modules/es-abstract/2016/msFromTime.js create mode 100644 node_modules/es-abstract/2016/thisBooleanValue.js create mode 100644 node_modules/es-abstract/2016/thisNumberValue.js create mode 100644 node_modules/es-abstract/2016/thisStringValue.js create mode 100644 node_modules/es-abstract/2016/thisTimeValue.js create mode 100644 node_modules/es-abstract/2017/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/2017/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/2017/AdvanceStringIndex.js create mode 100644 node_modules/es-abstract/2017/ArrayCreate.js create mode 100644 node_modules/es-abstract/2017/ArraySetLength.js create mode 100644 node_modules/es-abstract/2017/ArraySpeciesCreate.js create mode 100644 node_modules/es-abstract/2017/Call.js create mode 100644 node_modules/es-abstract/2017/CanonicalNumericIndexString.js create mode 100644 node_modules/es-abstract/2017/CharacterRange.js create mode 100644 node_modules/es-abstract/2017/CompletePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2017/CreateDataProperty.js create mode 100644 node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2017/CreateHTML.js create mode 100644 node_modules/es-abstract/2017/CreateIterResultObject.js create mode 100644 node_modules/es-abstract/2017/CreateListFromArrayLike.js create mode 100644 node_modules/es-abstract/2017/CreateMethodProperty.js create mode 100644 node_modules/es-abstract/2017/DateFromTime.js create mode 100644 node_modules/es-abstract/2017/Day.js create mode 100644 node_modules/es-abstract/2017/DayFromYear.js create mode 100644 node_modules/es-abstract/2017/DayWithinYear.js create mode 100644 node_modules/es-abstract/2017/DaysInYear.js create mode 100644 node_modules/es-abstract/2017/DefinePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2017/DeletePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2017/EnumerableOwnProperties.js create mode 100644 node_modules/es-abstract/2017/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2017/Get.js create mode 100644 node_modules/es-abstract/2017/GetIterator.js create mode 100644 node_modules/es-abstract/2017/GetMethod.js create mode 100644 node_modules/es-abstract/2017/GetOwnPropertyKeys.js create mode 100644 node_modules/es-abstract/2017/GetPrototypeFromConstructor.js create mode 100644 node_modules/es-abstract/2017/GetSubstitution.js create mode 100644 node_modules/es-abstract/2017/GetV.js create mode 100644 node_modules/es-abstract/2017/HasOwnProperty.js create mode 100644 node_modules/es-abstract/2017/HasProperty.js create mode 100644 node_modules/es-abstract/2017/HourFromTime.js create mode 100644 node_modules/es-abstract/2017/InLeapYear.js create mode 100644 node_modules/es-abstract/2017/InstanceofOperator.js create mode 100644 node_modules/es-abstract/2017/Invoke.js create mode 100644 node_modules/es-abstract/2017/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/2017/IsArray.js create mode 100644 node_modules/es-abstract/2017/IsCallable.js create mode 100644 node_modules/es-abstract/2017/IsCompatiblePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2017/IsConcatSpreadable.js create mode 100644 node_modules/es-abstract/2017/IsConstructor.js create mode 100644 node_modules/es-abstract/2017/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/2017/IsExtensible.js create mode 100644 node_modules/es-abstract/2017/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/2017/IsInteger.js create mode 100644 node_modules/es-abstract/2017/IsPromise.js create mode 100644 node_modules/es-abstract/2017/IsPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2017/IsPropertyKey.js create mode 100644 node_modules/es-abstract/2017/IsRegExp.js create mode 100644 node_modules/es-abstract/2017/IsSharedArrayBuffer.js create mode 100644 node_modules/es-abstract/2017/IterableToList.js create mode 100644 node_modules/es-abstract/2017/IteratorClose.js create mode 100644 node_modules/es-abstract/2017/IteratorComplete.js create mode 100644 node_modules/es-abstract/2017/IteratorNext.js create mode 100644 node_modules/es-abstract/2017/IteratorStep.js create mode 100644 node_modules/es-abstract/2017/IteratorValue.js create mode 100644 node_modules/es-abstract/2017/MakeDate.js create mode 100644 node_modules/es-abstract/2017/MakeDay.js create mode 100644 node_modules/es-abstract/2017/MakeTime.js create mode 100644 node_modules/es-abstract/2017/MinFromTime.js create mode 100644 node_modules/es-abstract/2017/MonthFromTime.js create mode 100644 node_modules/es-abstract/2017/ObjectCreate.js create mode 100644 node_modules/es-abstract/2017/ObjectDefineProperties.js create mode 100644 node_modules/es-abstract/2017/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js create mode 100644 node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/es-abstract/2017/OrdinaryHasInstance.js create mode 100644 node_modules/es-abstract/2017/OrdinaryHasProperty.js create mode 100644 node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js create mode 100644 node_modules/es-abstract/2017/OrdinaryToPrimitive.js create mode 100644 node_modules/es-abstract/2017/QuoteJSONString.js create mode 100644 node_modules/es-abstract/2017/RegExpCreate.js create mode 100644 node_modules/es-abstract/2017/RegExpExec.js create mode 100644 node_modules/es-abstract/2017/RequireObjectCoercible.js create mode 100644 node_modules/es-abstract/2017/SameValue.js create mode 100644 node_modules/es-abstract/2017/SameValueNonNumber.js create mode 100644 node_modules/es-abstract/2017/SameValueZero.js create mode 100644 node_modules/es-abstract/2017/SecFromTime.js create mode 100644 node_modules/es-abstract/2017/Set.js create mode 100644 node_modules/es-abstract/2017/SetFunctionName.js create mode 100644 node_modules/es-abstract/2017/SetIntegrityLevel.js create mode 100644 node_modules/es-abstract/2017/SpeciesConstructor.js create mode 100644 node_modules/es-abstract/2017/SplitMatch.js create mode 100644 node_modules/es-abstract/2017/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/2017/StringCreate.js create mode 100644 node_modules/es-abstract/2017/StringGetOwnProperty.js create mode 100644 node_modules/es-abstract/2017/SymbolDescriptiveString.js create mode 100644 node_modules/es-abstract/2017/TestIntegrityLevel.js create mode 100644 node_modules/es-abstract/2017/TimeClip.js create mode 100644 node_modules/es-abstract/2017/TimeFromYear.js create mode 100644 node_modules/es-abstract/2017/TimeWithinDay.js create mode 100644 node_modules/es-abstract/2017/ToBoolean.js create mode 100644 node_modules/es-abstract/2017/ToDateString.js create mode 100644 node_modules/es-abstract/2017/ToIndex.js create mode 100644 node_modules/es-abstract/2017/ToInt16.js create mode 100644 node_modules/es-abstract/2017/ToInt32.js create mode 100644 node_modules/es-abstract/2017/ToInt8.js create mode 100644 node_modules/es-abstract/2017/ToInteger.js create mode 100644 node_modules/es-abstract/2017/ToLength.js create mode 100644 node_modules/es-abstract/2017/ToNumber.js create mode 100644 node_modules/es-abstract/2017/ToObject.js create mode 100644 node_modules/es-abstract/2017/ToPrimitive.js create mode 100644 node_modules/es-abstract/2017/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2017/ToPropertyKey.js create mode 100644 node_modules/es-abstract/2017/ToString.js create mode 100644 node_modules/es-abstract/2017/ToUint16.js create mode 100644 node_modules/es-abstract/2017/ToUint32.js create mode 100644 node_modules/es-abstract/2017/ToUint8.js create mode 100644 node_modules/es-abstract/2017/ToUint8Clamp.js create mode 100644 node_modules/es-abstract/2017/Type.js create mode 100644 node_modules/es-abstract/2017/UTF16Decode.js create mode 100644 node_modules/es-abstract/2017/UTF16Encoding.js create mode 100644 node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2017/WeekDay.js create mode 100644 node_modules/es-abstract/2017/YearFromTime.js create mode 100644 node_modules/es-abstract/2017/abs.js create mode 100644 node_modules/es-abstract/2017/floor.js create mode 100644 node_modules/es-abstract/2017/modulo.js create mode 100644 node_modules/es-abstract/2017/msFromTime.js create mode 100644 node_modules/es-abstract/2017/thisBooleanValue.js create mode 100644 node_modules/es-abstract/2017/thisNumberValue.js create mode 100644 node_modules/es-abstract/2017/thisStringValue.js create mode 100644 node_modules/es-abstract/2017/thisTimeValue.js create mode 100644 node_modules/es-abstract/2018/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/2018/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/2018/AdvanceStringIndex.js create mode 100644 node_modules/es-abstract/2018/ArrayCreate.js create mode 100644 node_modules/es-abstract/2018/ArraySetLength.js create mode 100644 node_modules/es-abstract/2018/ArraySpeciesCreate.js create mode 100644 node_modules/es-abstract/2018/Call.js create mode 100644 node_modules/es-abstract/2018/CanonicalNumericIndexString.js create mode 100644 node_modules/es-abstract/2018/CharacterRange.js create mode 100644 node_modules/es-abstract/2018/CompletePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2018/CopyDataProperties.js create mode 100644 node_modules/es-abstract/2018/CreateDataProperty.js create mode 100644 node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2018/CreateHTML.js create mode 100644 node_modules/es-abstract/2018/CreateIterResultObject.js create mode 100644 node_modules/es-abstract/2018/CreateListFromArrayLike.js create mode 100644 node_modules/es-abstract/2018/CreateMethodProperty.js create mode 100644 node_modules/es-abstract/2018/DateFromTime.js create mode 100644 node_modules/es-abstract/2018/DateString.js create mode 100644 node_modules/es-abstract/2018/Day.js create mode 100644 node_modules/es-abstract/2018/DayFromYear.js create mode 100644 node_modules/es-abstract/2018/DayWithinYear.js create mode 100644 node_modules/es-abstract/2018/DaysInYear.js create mode 100644 node_modules/es-abstract/2018/DefinePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2018/DeletePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js create mode 100644 node_modules/es-abstract/2018/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2018/Get.js create mode 100644 node_modules/es-abstract/2018/GetIterator.js create mode 100644 node_modules/es-abstract/2018/GetMethod.js create mode 100644 node_modules/es-abstract/2018/GetOwnPropertyKeys.js create mode 100644 node_modules/es-abstract/2018/GetPrototypeFromConstructor.js create mode 100644 node_modules/es-abstract/2018/GetSubstitution.js create mode 100644 node_modules/es-abstract/2018/GetV.js create mode 100644 node_modules/es-abstract/2018/HasOwnProperty.js create mode 100644 node_modules/es-abstract/2018/HasProperty.js create mode 100644 node_modules/es-abstract/2018/HourFromTime.js create mode 100644 node_modules/es-abstract/2018/InLeapYear.js create mode 100644 node_modules/es-abstract/2018/InstanceofOperator.js create mode 100644 node_modules/es-abstract/2018/Invoke.js create mode 100644 node_modules/es-abstract/2018/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/2018/IsArray.js create mode 100644 node_modules/es-abstract/2018/IsCallable.js create mode 100644 node_modules/es-abstract/2018/IsCompatiblePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2018/IsConcatSpreadable.js create mode 100644 node_modules/es-abstract/2018/IsConstructor.js create mode 100644 node_modules/es-abstract/2018/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/2018/IsExtensible.js create mode 100644 node_modules/es-abstract/2018/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/2018/IsInteger.js create mode 100644 node_modules/es-abstract/2018/IsPromise.js create mode 100644 node_modules/es-abstract/2018/IsPropertyKey.js create mode 100644 node_modules/es-abstract/2018/IsRegExp.js create mode 100644 node_modules/es-abstract/2018/IsSharedArrayBuffer.js create mode 100644 node_modules/es-abstract/2018/IsStringPrefix.js create mode 100644 node_modules/es-abstract/2018/IterableToList.js create mode 100644 node_modules/es-abstract/2018/IteratorClose.js create mode 100644 node_modules/es-abstract/2018/IteratorComplete.js create mode 100644 node_modules/es-abstract/2018/IteratorNext.js create mode 100644 node_modules/es-abstract/2018/IteratorStep.js create mode 100644 node_modules/es-abstract/2018/IteratorValue.js create mode 100644 node_modules/es-abstract/2018/MakeDate.js create mode 100644 node_modules/es-abstract/2018/MakeDay.js create mode 100644 node_modules/es-abstract/2018/MakeTime.js create mode 100644 node_modules/es-abstract/2018/MinFromTime.js create mode 100644 node_modules/es-abstract/2018/MonthFromTime.js create mode 100644 node_modules/es-abstract/2018/NumberToString.js create mode 100644 node_modules/es-abstract/2018/ObjectCreate.js create mode 100644 node_modules/es-abstract/2018/ObjectDefineProperties.js create mode 100644 node_modules/es-abstract/2018/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js create mode 100644 node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/es-abstract/2018/OrdinaryHasInstance.js create mode 100644 node_modules/es-abstract/2018/OrdinaryHasProperty.js create mode 100644 node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js create mode 100644 node_modules/es-abstract/2018/OrdinaryToPrimitive.js create mode 100644 node_modules/es-abstract/2018/PromiseResolve.js create mode 100644 node_modules/es-abstract/2018/QuoteJSONString.js create mode 100644 node_modules/es-abstract/2018/RegExpCreate.js create mode 100644 node_modules/es-abstract/2018/RegExpExec.js create mode 100644 node_modules/es-abstract/2018/RequireObjectCoercible.js create mode 100644 node_modules/es-abstract/2018/SameValue.js create mode 100644 node_modules/es-abstract/2018/SameValueNonNumber.js create mode 100644 node_modules/es-abstract/2018/SameValueZero.js create mode 100644 node_modules/es-abstract/2018/SecFromTime.js create mode 100644 node_modules/es-abstract/2018/Set.js create mode 100644 node_modules/es-abstract/2018/SetFunctionLength.js create mode 100644 node_modules/es-abstract/2018/SetFunctionName.js create mode 100644 node_modules/es-abstract/2018/SetIntegrityLevel.js create mode 100644 node_modules/es-abstract/2018/SpeciesConstructor.js create mode 100644 node_modules/es-abstract/2018/SplitMatch.js create mode 100644 node_modules/es-abstract/2018/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/2018/StringCreate.js create mode 100644 node_modules/es-abstract/2018/StringGetOwnProperty.js create mode 100644 node_modules/es-abstract/2018/SymbolDescriptiveString.js create mode 100644 node_modules/es-abstract/2018/TestIntegrityLevel.js create mode 100644 node_modules/es-abstract/2018/TimeClip.js create mode 100644 node_modules/es-abstract/2018/TimeFromYear.js create mode 100644 node_modules/es-abstract/2018/TimeString.js create mode 100644 node_modules/es-abstract/2018/TimeWithinDay.js create mode 100644 node_modules/es-abstract/2018/ToBoolean.js create mode 100644 node_modules/es-abstract/2018/ToDateString.js create mode 100644 node_modules/es-abstract/2018/ToIndex.js create mode 100644 node_modules/es-abstract/2018/ToInt16.js create mode 100644 node_modules/es-abstract/2018/ToInt32.js create mode 100644 node_modules/es-abstract/2018/ToInt8.js create mode 100644 node_modules/es-abstract/2018/ToInteger.js create mode 100644 node_modules/es-abstract/2018/ToLength.js create mode 100644 node_modules/es-abstract/2018/ToNumber.js create mode 100644 node_modules/es-abstract/2018/ToObject.js create mode 100644 node_modules/es-abstract/2018/ToPrimitive.js create mode 100644 node_modules/es-abstract/2018/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2018/ToPropertyKey.js create mode 100644 node_modules/es-abstract/2018/ToString.js create mode 100644 node_modules/es-abstract/2018/ToUint16.js create mode 100644 node_modules/es-abstract/2018/ToUint32.js create mode 100644 node_modules/es-abstract/2018/ToUint8.js create mode 100644 node_modules/es-abstract/2018/ToUint8Clamp.js create mode 100644 node_modules/es-abstract/2018/Type.js create mode 100644 node_modules/es-abstract/2018/UTF16Decode.js create mode 100644 node_modules/es-abstract/2018/UTF16Encoding.js create mode 100644 node_modules/es-abstract/2018/UnicodeEscape.js create mode 100644 node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2018/WeekDay.js create mode 100644 node_modules/es-abstract/2018/YearFromTime.js create mode 100644 node_modules/es-abstract/2018/abs.js create mode 100644 node_modules/es-abstract/2018/floor.js create mode 100644 node_modules/es-abstract/2018/modulo.js create mode 100644 node_modules/es-abstract/2018/msFromTime.js create mode 100644 node_modules/es-abstract/2018/thisBooleanValue.js create mode 100644 node_modules/es-abstract/2018/thisNumberValue.js create mode 100644 node_modules/es-abstract/2018/thisStringValue.js create mode 100644 node_modules/es-abstract/2018/thisSymbolValue.js create mode 100644 node_modules/es-abstract/2018/thisTimeValue.js create mode 100644 node_modules/es-abstract/2019/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/2019/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/2019/AddEntriesFromIterable.js create mode 100644 node_modules/es-abstract/2019/AdvanceStringIndex.js create mode 100644 node_modules/es-abstract/2019/ArrayCreate.js create mode 100644 node_modules/es-abstract/2019/ArraySetLength.js create mode 100644 node_modules/es-abstract/2019/ArraySpeciesCreate.js create mode 100644 node_modules/es-abstract/2019/Call.js create mode 100644 node_modules/es-abstract/2019/CanonicalNumericIndexString.js create mode 100644 node_modules/es-abstract/2019/CharacterRange.js create mode 100644 node_modules/es-abstract/2019/CompletePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2019/CopyDataProperties.js create mode 100644 node_modules/es-abstract/2019/CreateDataProperty.js create mode 100644 node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2019/CreateHTML.js create mode 100644 node_modules/es-abstract/2019/CreateIterResultObject.js create mode 100644 node_modules/es-abstract/2019/CreateListFromArrayLike.js create mode 100644 node_modules/es-abstract/2019/CreateMethodProperty.js create mode 100644 node_modules/es-abstract/2019/DateFromTime.js create mode 100644 node_modules/es-abstract/2019/DateString.js create mode 100644 node_modules/es-abstract/2019/Day.js create mode 100644 node_modules/es-abstract/2019/DayFromYear.js create mode 100644 node_modules/es-abstract/2019/DayWithinYear.js create mode 100644 node_modules/es-abstract/2019/DaysInYear.js create mode 100644 node_modules/es-abstract/2019/DefinePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2019/DeletePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js create mode 100644 node_modules/es-abstract/2019/FlattenIntoArray.js create mode 100644 node_modules/es-abstract/2019/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2019/Get.js create mode 100644 node_modules/es-abstract/2019/GetIterator.js create mode 100644 node_modules/es-abstract/2019/GetMethod.js create mode 100644 node_modules/es-abstract/2019/GetOwnPropertyKeys.js create mode 100644 node_modules/es-abstract/2019/GetPrototypeFromConstructor.js create mode 100644 node_modules/es-abstract/2019/GetSubstitution.js create mode 100644 node_modules/es-abstract/2019/GetV.js create mode 100644 node_modules/es-abstract/2019/HasOwnProperty.js create mode 100644 node_modules/es-abstract/2019/HasProperty.js create mode 100644 node_modules/es-abstract/2019/HourFromTime.js create mode 100644 node_modules/es-abstract/2019/InLeapYear.js create mode 100644 node_modules/es-abstract/2019/InstanceofOperator.js create mode 100644 node_modules/es-abstract/2019/Invoke.js create mode 100644 node_modules/es-abstract/2019/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/2019/IsArray.js create mode 100644 node_modules/es-abstract/2019/IsCallable.js create mode 100644 node_modules/es-abstract/2019/IsCompatiblePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2019/IsConcatSpreadable.js create mode 100644 node_modules/es-abstract/2019/IsConstructor.js create mode 100644 node_modules/es-abstract/2019/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/2019/IsExtensible.js create mode 100644 node_modules/es-abstract/2019/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/2019/IsInteger.js create mode 100644 node_modules/es-abstract/2019/IsPromise.js create mode 100644 node_modules/es-abstract/2019/IsPropertyKey.js create mode 100644 node_modules/es-abstract/2019/IsRegExp.js create mode 100644 node_modules/es-abstract/2019/IsSharedArrayBuffer.js create mode 100644 node_modules/es-abstract/2019/IsStringPrefix.js create mode 100644 node_modules/es-abstract/2019/IterableToList.js create mode 100644 node_modules/es-abstract/2019/IteratorClose.js create mode 100644 node_modules/es-abstract/2019/IteratorComplete.js create mode 100644 node_modules/es-abstract/2019/IteratorNext.js create mode 100644 node_modules/es-abstract/2019/IteratorStep.js create mode 100644 node_modules/es-abstract/2019/IteratorValue.js create mode 100644 node_modules/es-abstract/2019/MakeDate.js create mode 100644 node_modules/es-abstract/2019/MakeDay.js create mode 100644 node_modules/es-abstract/2019/MakeTime.js create mode 100644 node_modules/es-abstract/2019/MinFromTime.js create mode 100644 node_modules/es-abstract/2019/MonthFromTime.js create mode 100644 node_modules/es-abstract/2019/NumberToString.js create mode 100644 node_modules/es-abstract/2019/ObjectCreate.js create mode 100644 node_modules/es-abstract/2019/ObjectDefineProperties.js create mode 100644 node_modules/es-abstract/2019/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js create mode 100644 node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/es-abstract/2019/OrdinaryHasInstance.js create mode 100644 node_modules/es-abstract/2019/OrdinaryHasProperty.js create mode 100644 node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js create mode 100644 node_modules/es-abstract/2019/OrdinaryToPrimitive.js create mode 100644 node_modules/es-abstract/2019/PromiseResolve.js create mode 100644 node_modules/es-abstract/2019/QuoteJSONString.js create mode 100644 node_modules/es-abstract/2019/RegExpCreate.js create mode 100644 node_modules/es-abstract/2019/RegExpExec.js create mode 100644 node_modules/es-abstract/2019/RequireObjectCoercible.js create mode 100644 node_modules/es-abstract/2019/SameValue.js create mode 100644 node_modules/es-abstract/2019/SameValueNonNumber.js create mode 100644 node_modules/es-abstract/2019/SameValueZero.js create mode 100644 node_modules/es-abstract/2019/SecFromTime.js create mode 100644 node_modules/es-abstract/2019/Set.js create mode 100644 node_modules/es-abstract/2019/SetFunctionLength.js create mode 100644 node_modules/es-abstract/2019/SetFunctionName.js create mode 100644 node_modules/es-abstract/2019/SetIntegrityLevel.js create mode 100644 node_modules/es-abstract/2019/SpeciesConstructor.js create mode 100644 node_modules/es-abstract/2019/SplitMatch.js create mode 100644 node_modules/es-abstract/2019/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/2019/StringCreate.js create mode 100644 node_modules/es-abstract/2019/StringGetOwnProperty.js create mode 100644 node_modules/es-abstract/2019/SymbolDescriptiveString.js create mode 100644 node_modules/es-abstract/2019/TestIntegrityLevel.js create mode 100644 node_modules/es-abstract/2019/TimeClip.js create mode 100644 node_modules/es-abstract/2019/TimeFromYear.js create mode 100644 node_modules/es-abstract/2019/TimeString.js create mode 100644 node_modules/es-abstract/2019/TimeWithinDay.js create mode 100644 node_modules/es-abstract/2019/ToBoolean.js create mode 100644 node_modules/es-abstract/2019/ToDateString.js create mode 100644 node_modules/es-abstract/2019/ToIndex.js create mode 100644 node_modules/es-abstract/2019/ToInt16.js create mode 100644 node_modules/es-abstract/2019/ToInt32.js create mode 100644 node_modules/es-abstract/2019/ToInt8.js create mode 100644 node_modules/es-abstract/2019/ToInteger.js create mode 100644 node_modules/es-abstract/2019/ToLength.js create mode 100644 node_modules/es-abstract/2019/ToNumber.js create mode 100644 node_modules/es-abstract/2019/ToObject.js create mode 100644 node_modules/es-abstract/2019/ToPrimitive.js create mode 100644 node_modules/es-abstract/2019/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2019/ToPropertyKey.js create mode 100644 node_modules/es-abstract/2019/ToString.js create mode 100644 node_modules/es-abstract/2019/ToUint16.js create mode 100644 node_modules/es-abstract/2019/ToUint32.js create mode 100644 node_modules/es-abstract/2019/ToUint8.js create mode 100644 node_modules/es-abstract/2019/ToUint8Clamp.js create mode 100644 node_modules/es-abstract/2019/TrimString.js create mode 100644 node_modules/es-abstract/2019/Type.js create mode 100644 node_modules/es-abstract/2019/UTF16Decode.js create mode 100644 node_modules/es-abstract/2019/UTF16Encoding.js create mode 100644 node_modules/es-abstract/2019/UnicodeEscape.js create mode 100644 node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2019/WeekDay.js create mode 100644 node_modules/es-abstract/2019/YearFromTime.js create mode 100644 node_modules/es-abstract/2019/abs.js create mode 100644 node_modules/es-abstract/2019/floor.js create mode 100644 node_modules/es-abstract/2019/modulo.js create mode 100644 node_modules/es-abstract/2019/msFromTime.js create mode 100644 node_modules/es-abstract/2019/thisBooleanValue.js create mode 100644 node_modules/es-abstract/2019/thisNumberValue.js create mode 100644 node_modules/es-abstract/2019/thisStringValue.js create mode 100644 node_modules/es-abstract/2019/thisSymbolValue.js create mode 100644 node_modules/es-abstract/2019/thisTimeValue.js create mode 100644 node_modules/es-abstract/2020/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/2020/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/2020/AddEntriesFromIterable.js create mode 100644 node_modules/es-abstract/2020/AdvanceStringIndex.js create mode 100644 node_modules/es-abstract/2020/ArrayCreate.js create mode 100644 node_modules/es-abstract/2020/ArraySetLength.js create mode 100644 node_modules/es-abstract/2020/ArraySpeciesCreate.js create mode 100644 node_modules/es-abstract/2020/BigInt/add.js create mode 100644 node_modules/es-abstract/2020/BigInt/bitwiseAND.js create mode 100644 node_modules/es-abstract/2020/BigInt/bitwiseNOT.js create mode 100644 node_modules/es-abstract/2020/BigInt/bitwiseOR.js create mode 100644 node_modules/es-abstract/2020/BigInt/bitwiseXOR.js create mode 100644 node_modules/es-abstract/2020/BigInt/divide.js create mode 100644 node_modules/es-abstract/2020/BigInt/equal.js create mode 100644 node_modules/es-abstract/2020/BigInt/exponentiate.js create mode 100644 node_modules/es-abstract/2020/BigInt/index.js create mode 100644 node_modules/es-abstract/2020/BigInt/leftShift.js create mode 100644 node_modules/es-abstract/2020/BigInt/lessThan.js create mode 100644 node_modules/es-abstract/2020/BigInt/multiply.js create mode 100644 node_modules/es-abstract/2020/BigInt/remainder.js create mode 100644 node_modules/es-abstract/2020/BigInt/sameValue.js create mode 100644 node_modules/es-abstract/2020/BigInt/sameValueZero.js create mode 100644 node_modules/es-abstract/2020/BigInt/signedRightShift.js create mode 100644 node_modules/es-abstract/2020/BigInt/subtract.js create mode 100644 node_modules/es-abstract/2020/BigInt/toString.js create mode 100644 node_modules/es-abstract/2020/BigInt/unaryMinus.js create mode 100644 node_modules/es-abstract/2020/BigInt/unsignedRightShift.js create mode 100644 node_modules/es-abstract/2020/BigIntBitwiseOp.js create mode 100644 node_modules/es-abstract/2020/BinaryAnd.js create mode 100644 node_modules/es-abstract/2020/BinaryOr.js create mode 100644 node_modules/es-abstract/2020/BinaryXor.js create mode 100644 node_modules/es-abstract/2020/Call.js create mode 100644 node_modules/es-abstract/2020/CanonicalNumericIndexString.js create mode 100644 node_modules/es-abstract/2020/CharacterRange.js create mode 100644 node_modules/es-abstract/2020/CodePointAt.js create mode 100644 node_modules/es-abstract/2020/CompletePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2020/CopyDataProperties.js create mode 100644 node_modules/es-abstract/2020/CreateDataProperty.js create mode 100644 node_modules/es-abstract/2020/CreateDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2020/CreateHTML.js create mode 100644 node_modules/es-abstract/2020/CreateIterResultObject.js create mode 100644 node_modules/es-abstract/2020/CreateListFromArrayLike.js create mode 100644 node_modules/es-abstract/2020/CreateMethodProperty.js create mode 100644 node_modules/es-abstract/2020/CreateRegExpStringIterator.js create mode 100644 node_modules/es-abstract/2020/DateFromTime.js create mode 100644 node_modules/es-abstract/2020/DateString.js create mode 100644 node_modules/es-abstract/2020/Day.js create mode 100644 node_modules/es-abstract/2020/DayFromYear.js create mode 100644 node_modules/es-abstract/2020/DayWithinYear.js create mode 100644 node_modules/es-abstract/2020/DaysInYear.js create mode 100644 node_modules/es-abstract/2020/DefinePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2020/DeletePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2020/EnumerableOwnPropertyNames.js create mode 100644 node_modules/es-abstract/2020/FlattenIntoArray.js create mode 100644 node_modules/es-abstract/2020/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2020/Get.js create mode 100644 node_modules/es-abstract/2020/GetIterator.js create mode 100644 node_modules/es-abstract/2020/GetMethod.js create mode 100644 node_modules/es-abstract/2020/GetOwnPropertyKeys.js create mode 100644 node_modules/es-abstract/2020/GetPrototypeFromConstructor.js create mode 100644 node_modules/es-abstract/2020/GetSubstitution.js create mode 100644 node_modules/es-abstract/2020/GetV.js create mode 100644 node_modules/es-abstract/2020/HasOwnProperty.js create mode 100644 node_modules/es-abstract/2020/HasProperty.js create mode 100644 node_modules/es-abstract/2020/HourFromTime.js create mode 100644 node_modules/es-abstract/2020/InLeapYear.js create mode 100644 node_modules/es-abstract/2020/InstanceofOperator.js create mode 100644 node_modules/es-abstract/2020/Invoke.js create mode 100644 node_modules/es-abstract/2020/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/2020/IsArray.js create mode 100644 node_modules/es-abstract/2020/IsBigIntElementType.js create mode 100644 node_modules/es-abstract/2020/IsCallable.js create mode 100644 node_modules/es-abstract/2020/IsCompatiblePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2020/IsConcatSpreadable.js create mode 100644 node_modules/es-abstract/2020/IsConstructor.js create mode 100644 node_modules/es-abstract/2020/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/2020/IsExtensible.js create mode 100644 node_modules/es-abstract/2020/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/2020/IsInteger.js create mode 100644 node_modules/es-abstract/2020/IsNoTearConfiguration.js create mode 100644 node_modules/es-abstract/2020/IsNonNegativeInteger.js create mode 100644 node_modules/es-abstract/2020/IsPromise.js create mode 100644 node_modules/es-abstract/2020/IsPropertyKey.js create mode 100644 node_modules/es-abstract/2020/IsRegExp.js create mode 100644 node_modules/es-abstract/2020/IsSharedArrayBuffer.js create mode 100644 node_modules/es-abstract/2020/IsStringPrefix.js create mode 100644 node_modules/es-abstract/2020/IsUnclampedIntegerElementType.js create mode 100644 node_modules/es-abstract/2020/IsUnsignedElementType.js create mode 100644 node_modules/es-abstract/2020/IterableToList.js create mode 100644 node_modules/es-abstract/2020/IteratorClose.js create mode 100644 node_modules/es-abstract/2020/IteratorComplete.js create mode 100644 node_modules/es-abstract/2020/IteratorNext.js create mode 100644 node_modules/es-abstract/2020/IteratorStep.js create mode 100644 node_modules/es-abstract/2020/IteratorValue.js create mode 100644 node_modules/es-abstract/2020/LengthOfArrayLike.js create mode 100644 node_modules/es-abstract/2020/MakeDate.js create mode 100644 node_modules/es-abstract/2020/MakeDay.js create mode 100644 node_modules/es-abstract/2020/MakeTime.js create mode 100644 node_modules/es-abstract/2020/MinFromTime.js create mode 100644 node_modules/es-abstract/2020/MonthFromTime.js create mode 100644 node_modules/es-abstract/2020/Number/add.js create mode 100644 node_modules/es-abstract/2020/Number/bitwiseAND.js create mode 100644 node_modules/es-abstract/2020/Number/bitwiseNOT.js create mode 100644 node_modules/es-abstract/2020/Number/bitwiseOR.js create mode 100644 node_modules/es-abstract/2020/Number/bitwiseXOR.js create mode 100644 node_modules/es-abstract/2020/Number/divide.js create mode 100644 node_modules/es-abstract/2020/Number/equal.js create mode 100644 node_modules/es-abstract/2020/Number/exponentiate.js create mode 100644 node_modules/es-abstract/2020/Number/index.js create mode 100644 node_modules/es-abstract/2020/Number/leftShift.js create mode 100644 node_modules/es-abstract/2020/Number/lessThan.js create mode 100644 node_modules/es-abstract/2020/Number/multiply.js create mode 100644 node_modules/es-abstract/2020/Number/remainder.js create mode 100644 node_modules/es-abstract/2020/Number/sameValue.js create mode 100644 node_modules/es-abstract/2020/Number/sameValueZero.js create mode 100644 node_modules/es-abstract/2020/Number/signedRightShift.js create mode 100644 node_modules/es-abstract/2020/Number/subtract.js create mode 100644 node_modules/es-abstract/2020/Number/toString.js create mode 100644 node_modules/es-abstract/2020/Number/unaryMinus.js create mode 100644 node_modules/es-abstract/2020/Number/unsignedRightShift.js create mode 100644 node_modules/es-abstract/2020/NumberBitwiseOp.js create mode 100644 node_modules/es-abstract/2020/NumberToBigInt.js create mode 100644 node_modules/es-abstract/2020/ObjectDefineProperties.js create mode 100644 node_modules/es-abstract/2020/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/es-abstract/2020/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/es-abstract/2020/OrdinaryGetOwnProperty.js create mode 100644 node_modules/es-abstract/2020/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/es-abstract/2020/OrdinaryHasInstance.js create mode 100644 node_modules/es-abstract/2020/OrdinaryHasProperty.js create mode 100644 node_modules/es-abstract/2020/OrdinaryObjectCreate.js create mode 100644 node_modules/es-abstract/2020/OrdinarySetPrototypeOf.js create mode 100644 node_modules/es-abstract/2020/OrdinaryToPrimitive.js create mode 100644 node_modules/es-abstract/2020/PromiseResolve.js create mode 100644 node_modules/es-abstract/2020/QuoteJSONString.js create mode 100644 node_modules/es-abstract/2020/RegExpCreate.js create mode 100644 node_modules/es-abstract/2020/RegExpExec.js create mode 100644 node_modules/es-abstract/2020/RequireObjectCoercible.js create mode 100644 node_modules/es-abstract/2020/SameValue.js create mode 100644 node_modules/es-abstract/2020/SameValueNonNumeric.js create mode 100644 node_modules/es-abstract/2020/SameValueZero.js create mode 100644 node_modules/es-abstract/2020/SecFromTime.js create mode 100644 node_modules/es-abstract/2020/Set.js create mode 100644 node_modules/es-abstract/2020/SetFunctionLength.js create mode 100644 node_modules/es-abstract/2020/SetFunctionName.js create mode 100644 node_modules/es-abstract/2020/SetIntegrityLevel.js create mode 100644 node_modules/es-abstract/2020/SpeciesConstructor.js create mode 100644 node_modules/es-abstract/2020/SplitMatch.js create mode 100644 node_modules/es-abstract/2020/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/2020/StringCreate.js create mode 100644 node_modules/es-abstract/2020/StringGetOwnProperty.js create mode 100644 node_modules/es-abstract/2020/StringPad.js create mode 100644 node_modules/es-abstract/2020/StringToBigInt.js create mode 100644 node_modules/es-abstract/2020/SymbolDescriptiveString.js create mode 100644 node_modules/es-abstract/2020/TestIntegrityLevel.js create mode 100644 node_modules/es-abstract/2020/TimeClip.js create mode 100644 node_modules/es-abstract/2020/TimeFromYear.js create mode 100644 node_modules/es-abstract/2020/TimeString.js create mode 100644 node_modules/es-abstract/2020/TimeWithinDay.js create mode 100644 node_modules/es-abstract/2020/ToBigInt.js create mode 100644 node_modules/es-abstract/2020/ToBigInt64.js create mode 100644 node_modules/es-abstract/2020/ToBigUint64.js create mode 100644 node_modules/es-abstract/2020/ToBoolean.js create mode 100644 node_modules/es-abstract/2020/ToDateString.js create mode 100644 node_modules/es-abstract/2020/ToIndex.js create mode 100644 node_modules/es-abstract/2020/ToInt16.js create mode 100644 node_modules/es-abstract/2020/ToInt32.js create mode 100644 node_modules/es-abstract/2020/ToInt8.js create mode 100644 node_modules/es-abstract/2020/ToInteger.js create mode 100644 node_modules/es-abstract/2020/ToLength.js create mode 100644 node_modules/es-abstract/2020/ToNumber.js create mode 100644 node_modules/es-abstract/2020/ToNumeric.js create mode 100644 node_modules/es-abstract/2020/ToObject.js create mode 100644 node_modules/es-abstract/2020/ToPrimitive.js create mode 100644 node_modules/es-abstract/2020/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2020/ToPropertyKey.js create mode 100644 node_modules/es-abstract/2020/ToString.js create mode 100644 node_modules/es-abstract/2020/ToUint16.js create mode 100644 node_modules/es-abstract/2020/ToUint32.js create mode 100644 node_modules/es-abstract/2020/ToUint8.js create mode 100644 node_modules/es-abstract/2020/ToUint8Clamp.js create mode 100644 node_modules/es-abstract/2020/TrimString.js create mode 100644 node_modules/es-abstract/2020/Type.js create mode 100644 node_modules/es-abstract/2020/UTF16DecodeString.js create mode 100644 node_modules/es-abstract/2020/UTF16DecodeSurrogatePair.js create mode 100644 node_modules/es-abstract/2020/UTF16Encoding.js create mode 100644 node_modules/es-abstract/2020/UnicodeEscape.js create mode 100644 node_modules/es-abstract/2020/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2020/WeekDay.js create mode 100644 node_modules/es-abstract/2020/YearFromTime.js create mode 100644 node_modules/es-abstract/2020/abs.js create mode 100644 node_modules/es-abstract/2020/floor.js create mode 100644 node_modules/es-abstract/2020/modulo.js create mode 100644 node_modules/es-abstract/2020/msFromTime.js create mode 100644 node_modules/es-abstract/2020/thisBigIntValue.js create mode 100644 node_modules/es-abstract/2020/thisBooleanValue.js create mode 100644 node_modules/es-abstract/2020/thisNumberValue.js create mode 100644 node_modules/es-abstract/2020/thisStringValue.js create mode 100644 node_modules/es-abstract/2020/thisSymbolValue.js create mode 100644 node_modules/es-abstract/2020/thisTimeValue.js create mode 100644 node_modules/es-abstract/2021/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/2021/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/2021/AddEntriesFromIterable.js create mode 100644 node_modules/es-abstract/2021/AddToKeptObjects.js create mode 100644 node_modules/es-abstract/2021/AdvanceStringIndex.js create mode 100644 node_modules/es-abstract/2021/ApplyStringOrNumericBinaryOperator.js create mode 100644 node_modules/es-abstract/2021/ArrayCreate.js create mode 100644 node_modules/es-abstract/2021/ArraySetLength.js create mode 100644 node_modules/es-abstract/2021/ArraySpeciesCreate.js create mode 100644 node_modules/es-abstract/2021/BigInt/add.js create mode 100644 node_modules/es-abstract/2021/BigInt/bitwiseAND.js create mode 100644 node_modules/es-abstract/2021/BigInt/bitwiseNOT.js create mode 100644 node_modules/es-abstract/2021/BigInt/bitwiseOR.js create mode 100644 node_modules/es-abstract/2021/BigInt/bitwiseXOR.js create mode 100644 node_modules/es-abstract/2021/BigInt/divide.js create mode 100644 node_modules/es-abstract/2021/BigInt/equal.js create mode 100644 node_modules/es-abstract/2021/BigInt/exponentiate.js create mode 100644 node_modules/es-abstract/2021/BigInt/index.js create mode 100644 node_modules/es-abstract/2021/BigInt/leftShift.js create mode 100644 node_modules/es-abstract/2021/BigInt/lessThan.js create mode 100644 node_modules/es-abstract/2021/BigInt/multiply.js create mode 100644 node_modules/es-abstract/2021/BigInt/remainder.js create mode 100644 node_modules/es-abstract/2021/BigInt/sameValue.js create mode 100644 node_modules/es-abstract/2021/BigInt/sameValueZero.js create mode 100644 node_modules/es-abstract/2021/BigInt/signedRightShift.js create mode 100644 node_modules/es-abstract/2021/BigInt/subtract.js create mode 100644 node_modules/es-abstract/2021/BigInt/toString.js create mode 100644 node_modules/es-abstract/2021/BigInt/unaryMinus.js create mode 100644 node_modules/es-abstract/2021/BigInt/unsignedRightShift.js create mode 100644 node_modules/es-abstract/2021/BigIntBitwiseOp.js create mode 100644 node_modules/es-abstract/2021/BinaryAnd.js create mode 100644 node_modules/es-abstract/2021/BinaryOr.js create mode 100644 node_modules/es-abstract/2021/BinaryXor.js create mode 100644 node_modules/es-abstract/2021/ByteListBitwiseOp.js create mode 100644 node_modules/es-abstract/2021/ByteListEqual.js create mode 100644 node_modules/es-abstract/2021/Call.js create mode 100644 node_modules/es-abstract/2021/CanonicalNumericIndexString.js create mode 100644 node_modules/es-abstract/2021/CharacterRange.js create mode 100644 node_modules/es-abstract/2021/ClearKeptObjects.js create mode 100644 node_modules/es-abstract/2021/CodePointAt.js create mode 100644 node_modules/es-abstract/2021/CodePointsToString.js create mode 100644 node_modules/es-abstract/2021/CompletePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2021/CopyDataProperties.js create mode 100644 node_modules/es-abstract/2021/CreateDataProperty.js create mode 100644 node_modules/es-abstract/2021/CreateDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2021/CreateHTML.js create mode 100644 node_modules/es-abstract/2021/CreateIterResultObject.js create mode 100644 node_modules/es-abstract/2021/CreateListFromArrayLike.js create mode 100644 node_modules/es-abstract/2021/CreateMethodProperty.js create mode 100644 node_modules/es-abstract/2021/CreateRegExpStringIterator.js create mode 100644 node_modules/es-abstract/2021/DateFromTime.js create mode 100644 node_modules/es-abstract/2021/DateString.js create mode 100644 node_modules/es-abstract/2021/Day.js create mode 100644 node_modules/es-abstract/2021/DayFromYear.js create mode 100644 node_modules/es-abstract/2021/DayWithinYear.js create mode 100644 node_modules/es-abstract/2021/DaysInYear.js create mode 100644 node_modules/es-abstract/2021/DefinePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2021/DeletePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2021/EnumerableOwnPropertyNames.js create mode 100644 node_modules/es-abstract/2021/FlattenIntoArray.js create mode 100644 node_modules/es-abstract/2021/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2021/Get.js create mode 100644 node_modules/es-abstract/2021/GetIterator.js create mode 100644 node_modules/es-abstract/2021/GetMethod.js create mode 100644 node_modules/es-abstract/2021/GetOwnPropertyKeys.js create mode 100644 node_modules/es-abstract/2021/GetPromiseResolve.js create mode 100644 node_modules/es-abstract/2021/GetPrototypeFromConstructor.js create mode 100644 node_modules/es-abstract/2021/GetSubstitution.js create mode 100644 node_modules/es-abstract/2021/GetV.js create mode 100644 node_modules/es-abstract/2021/HasOwnProperty.js create mode 100644 node_modules/es-abstract/2021/HasProperty.js create mode 100644 node_modules/es-abstract/2021/HourFromTime.js create mode 100644 node_modules/es-abstract/2021/InLeapYear.js create mode 100644 node_modules/es-abstract/2021/InstanceofOperator.js create mode 100644 node_modules/es-abstract/2021/Invoke.js create mode 100644 node_modules/es-abstract/2021/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/2021/IsArray.js create mode 100644 node_modules/es-abstract/2021/IsBigIntElementType.js create mode 100644 node_modules/es-abstract/2021/IsCallable.js create mode 100644 node_modules/es-abstract/2021/IsCompatiblePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2021/IsConcatSpreadable.js create mode 100644 node_modules/es-abstract/2021/IsConstructor.js create mode 100644 node_modules/es-abstract/2021/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/2021/IsExtensible.js create mode 100644 node_modules/es-abstract/2021/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/2021/IsIntegralNumber.js create mode 100644 node_modules/es-abstract/2021/IsNoTearConfiguration.js create mode 100644 node_modules/es-abstract/2021/IsPromise.js create mode 100644 node_modules/es-abstract/2021/IsPropertyKey.js create mode 100644 node_modules/es-abstract/2021/IsRegExp.js create mode 100644 node_modules/es-abstract/2021/IsSharedArrayBuffer.js create mode 100644 node_modules/es-abstract/2021/IsStringPrefix.js create mode 100644 node_modules/es-abstract/2021/IsUnclampedIntegerElementType.js create mode 100644 node_modules/es-abstract/2021/IsUnsignedElementType.js create mode 100644 node_modules/es-abstract/2021/IterableToList.js create mode 100644 node_modules/es-abstract/2021/IteratorClose.js create mode 100644 node_modules/es-abstract/2021/IteratorComplete.js create mode 100644 node_modules/es-abstract/2021/IteratorNext.js create mode 100644 node_modules/es-abstract/2021/IteratorStep.js create mode 100644 node_modules/es-abstract/2021/IteratorValue.js create mode 100644 node_modules/es-abstract/2021/LengthOfArrayLike.js create mode 100644 node_modules/es-abstract/2021/MakeDate.js create mode 100644 node_modules/es-abstract/2021/MakeDay.js create mode 100644 node_modules/es-abstract/2021/MakeTime.js create mode 100644 node_modules/es-abstract/2021/MinFromTime.js create mode 100644 node_modules/es-abstract/2021/MonthFromTime.js create mode 100644 node_modules/es-abstract/2021/Number/add.js create mode 100644 node_modules/es-abstract/2021/Number/bitwiseAND.js create mode 100644 node_modules/es-abstract/2021/Number/bitwiseNOT.js create mode 100644 node_modules/es-abstract/2021/Number/bitwiseOR.js create mode 100644 node_modules/es-abstract/2021/Number/bitwiseXOR.js create mode 100644 node_modules/es-abstract/2021/Number/divide.js create mode 100644 node_modules/es-abstract/2021/Number/equal.js create mode 100644 node_modules/es-abstract/2021/Number/exponentiate.js create mode 100644 node_modules/es-abstract/2021/Number/index.js create mode 100644 node_modules/es-abstract/2021/Number/leftShift.js create mode 100644 node_modules/es-abstract/2021/Number/lessThan.js create mode 100644 node_modules/es-abstract/2021/Number/multiply.js create mode 100644 node_modules/es-abstract/2021/Number/remainder.js create mode 100644 node_modules/es-abstract/2021/Number/sameValue.js create mode 100644 node_modules/es-abstract/2021/Number/sameValueZero.js create mode 100644 node_modules/es-abstract/2021/Number/signedRightShift.js create mode 100644 node_modules/es-abstract/2021/Number/subtract.js create mode 100644 node_modules/es-abstract/2021/Number/toString.js create mode 100644 node_modules/es-abstract/2021/Number/unaryMinus.js create mode 100644 node_modules/es-abstract/2021/Number/unsignedRightShift.js create mode 100644 node_modules/es-abstract/2021/NumberBitwiseOp.js create mode 100644 node_modules/es-abstract/2021/NumberToBigInt.js create mode 100644 node_modules/es-abstract/2021/ObjectDefineProperties.js create mode 100644 node_modules/es-abstract/2021/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/es-abstract/2021/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/es-abstract/2021/OrdinaryGetOwnProperty.js create mode 100644 node_modules/es-abstract/2021/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/es-abstract/2021/OrdinaryHasInstance.js create mode 100644 node_modules/es-abstract/2021/OrdinaryHasProperty.js create mode 100644 node_modules/es-abstract/2021/OrdinaryObjectCreate.js create mode 100644 node_modules/es-abstract/2021/OrdinarySetPrototypeOf.js create mode 100644 node_modules/es-abstract/2021/OrdinaryToPrimitive.js create mode 100644 node_modules/es-abstract/2021/PromiseResolve.js create mode 100644 node_modules/es-abstract/2021/QuoteJSONString.js create mode 100644 node_modules/es-abstract/2021/RegExpCreate.js create mode 100644 node_modules/es-abstract/2021/RegExpExec.js create mode 100644 node_modules/es-abstract/2021/RequireObjectCoercible.js create mode 100644 node_modules/es-abstract/2021/SameValue.js create mode 100644 node_modules/es-abstract/2021/SameValueNonNumeric.js create mode 100644 node_modules/es-abstract/2021/SameValueZero.js create mode 100644 node_modules/es-abstract/2021/SecFromTime.js create mode 100644 node_modules/es-abstract/2021/Set.js create mode 100644 node_modules/es-abstract/2021/SetFunctionLength.js create mode 100644 node_modules/es-abstract/2021/SetFunctionName.js create mode 100644 node_modules/es-abstract/2021/SetIntegrityLevel.js create mode 100644 node_modules/es-abstract/2021/SpeciesConstructor.js create mode 100644 node_modules/es-abstract/2021/SplitMatch.js create mode 100644 node_modules/es-abstract/2021/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/2021/StringCreate.js create mode 100644 node_modules/es-abstract/2021/StringGetOwnProperty.js create mode 100644 node_modules/es-abstract/2021/StringIndexOf.js create mode 100644 node_modules/es-abstract/2021/StringPad.js create mode 100644 node_modules/es-abstract/2021/StringToBigInt.js create mode 100644 node_modules/es-abstract/2021/StringToCodePoints.js create mode 100644 node_modules/es-abstract/2021/SymbolDescriptiveString.js create mode 100644 node_modules/es-abstract/2021/TestIntegrityLevel.js create mode 100644 node_modules/es-abstract/2021/TimeClip.js create mode 100644 node_modules/es-abstract/2021/TimeFromYear.js create mode 100644 node_modules/es-abstract/2021/TimeString.js create mode 100644 node_modules/es-abstract/2021/TimeWithinDay.js create mode 100644 node_modules/es-abstract/2021/ToBigInt.js create mode 100644 node_modules/es-abstract/2021/ToBigInt64.js create mode 100644 node_modules/es-abstract/2021/ToBigUint64.js create mode 100644 node_modules/es-abstract/2021/ToBoolean.js create mode 100644 node_modules/es-abstract/2021/ToDateString.js create mode 100644 node_modules/es-abstract/2021/ToIndex.js create mode 100644 node_modules/es-abstract/2021/ToInt16.js create mode 100644 node_modules/es-abstract/2021/ToInt32.js create mode 100644 node_modules/es-abstract/2021/ToInt8.js create mode 100644 node_modules/es-abstract/2021/ToIntegerOrInfinity.js create mode 100644 node_modules/es-abstract/2021/ToLength.js create mode 100644 node_modules/es-abstract/2021/ToNumber.js create mode 100644 node_modules/es-abstract/2021/ToNumeric.js create mode 100644 node_modules/es-abstract/2021/ToObject.js create mode 100644 node_modules/es-abstract/2021/ToPrimitive.js create mode 100644 node_modules/es-abstract/2021/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2021/ToPropertyKey.js create mode 100644 node_modules/es-abstract/2021/ToString.js create mode 100644 node_modules/es-abstract/2021/ToUint16.js create mode 100644 node_modules/es-abstract/2021/ToUint32.js create mode 100644 node_modules/es-abstract/2021/ToUint8.js create mode 100644 node_modules/es-abstract/2021/ToUint8Clamp.js create mode 100644 node_modules/es-abstract/2021/TrimString.js create mode 100644 node_modules/es-abstract/2021/Type.js create mode 100644 node_modules/es-abstract/2021/UTF16EncodeCodePoint.js create mode 100644 node_modules/es-abstract/2021/UTF16SurrogatePairToCodePoint.js create mode 100644 node_modules/es-abstract/2021/UnicodeEscape.js create mode 100644 node_modules/es-abstract/2021/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2021/WeakRefDeref.js create mode 100644 node_modules/es-abstract/2021/WeekDay.js create mode 100644 node_modules/es-abstract/2021/YearFromTime.js create mode 100644 node_modules/es-abstract/2021/abs.js create mode 100644 node_modules/es-abstract/2021/clamp.js create mode 100644 node_modules/es-abstract/2021/floor.js create mode 100644 node_modules/es-abstract/2021/modulo.js create mode 100644 node_modules/es-abstract/2021/msFromTime.js create mode 100644 node_modules/es-abstract/2021/substring.js create mode 100644 node_modules/es-abstract/2021/thisBigIntValue.js create mode 100644 node_modules/es-abstract/2021/thisBooleanValue.js create mode 100644 node_modules/es-abstract/2021/thisNumberValue.js create mode 100644 node_modules/es-abstract/2021/thisStringValue.js create mode 100644 node_modules/es-abstract/2021/thisSymbolValue.js create mode 100644 node_modules/es-abstract/2021/thisTimeValue.js create mode 100644 node_modules/es-abstract/2022/AddEntriesFromIterable.js create mode 100644 node_modules/es-abstract/2022/AddToKeptObjects.js create mode 100644 node_modules/es-abstract/2022/AdvanceStringIndex.js create mode 100644 node_modules/es-abstract/2022/ApplyStringOrNumericBinaryOperator.js create mode 100644 node_modules/es-abstract/2022/ArrayCreate.js create mode 100644 node_modules/es-abstract/2022/ArraySetLength.js create mode 100644 node_modules/es-abstract/2022/ArraySpeciesCreate.js create mode 100644 node_modules/es-abstract/2022/BigInt/add.js create mode 100644 node_modules/es-abstract/2022/BigInt/bitwiseAND.js create mode 100644 node_modules/es-abstract/2022/BigInt/bitwiseNOT.js create mode 100644 node_modules/es-abstract/2022/BigInt/bitwiseOR.js create mode 100644 node_modules/es-abstract/2022/BigInt/bitwiseXOR.js create mode 100644 node_modules/es-abstract/2022/BigInt/divide.js create mode 100644 node_modules/es-abstract/2022/BigInt/equal.js create mode 100644 node_modules/es-abstract/2022/BigInt/exponentiate.js create mode 100644 node_modules/es-abstract/2022/BigInt/index.js create mode 100644 node_modules/es-abstract/2022/BigInt/leftShift.js create mode 100644 node_modules/es-abstract/2022/BigInt/lessThan.js create mode 100644 node_modules/es-abstract/2022/BigInt/multiply.js create mode 100644 node_modules/es-abstract/2022/BigInt/remainder.js create mode 100644 node_modules/es-abstract/2022/BigInt/sameValue.js create mode 100644 node_modules/es-abstract/2022/BigInt/sameValueZero.js create mode 100644 node_modules/es-abstract/2022/BigInt/signedRightShift.js create mode 100644 node_modules/es-abstract/2022/BigInt/subtract.js create mode 100644 node_modules/es-abstract/2022/BigInt/toString.js create mode 100644 node_modules/es-abstract/2022/BigInt/unaryMinus.js create mode 100644 node_modules/es-abstract/2022/BigInt/unsignedRightShift.js create mode 100644 node_modules/es-abstract/2022/BigIntBitwiseOp.js create mode 100644 node_modules/es-abstract/2022/BinaryAnd.js create mode 100644 node_modules/es-abstract/2022/BinaryOr.js create mode 100644 node_modules/es-abstract/2022/BinaryXor.js create mode 100644 node_modules/es-abstract/2022/ByteListBitwiseOp.js create mode 100644 node_modules/es-abstract/2022/ByteListEqual.js create mode 100644 node_modules/es-abstract/2022/Call.js create mode 100644 node_modules/es-abstract/2022/CanonicalNumericIndexString.js create mode 100644 node_modules/es-abstract/2022/CharacterRange.js create mode 100644 node_modules/es-abstract/2022/ClearKeptObjects.js create mode 100644 node_modules/es-abstract/2022/CodePointAt.js create mode 100644 node_modules/es-abstract/2022/CodePointsToString.js create mode 100644 node_modules/es-abstract/2022/CompletePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2022/CopyDataProperties.js create mode 100644 node_modules/es-abstract/2022/CreateDataProperty.js create mode 100644 node_modules/es-abstract/2022/CreateDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2022/CreateHTML.js create mode 100644 node_modules/es-abstract/2022/CreateIterResultObject.js create mode 100644 node_modules/es-abstract/2022/CreateListFromArrayLike.js create mode 100644 node_modules/es-abstract/2022/CreateMethodProperty.js create mode 100644 node_modules/es-abstract/2022/CreateNonEnumerableDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2022/CreateRegExpStringIterator.js create mode 100644 node_modules/es-abstract/2022/DateFromTime.js create mode 100644 node_modules/es-abstract/2022/DateString.js create mode 100644 node_modules/es-abstract/2022/Day.js create mode 100644 node_modules/es-abstract/2022/DayFromYear.js create mode 100644 node_modules/es-abstract/2022/DayWithinYear.js create mode 100644 node_modules/es-abstract/2022/DaysInYear.js create mode 100644 node_modules/es-abstract/2022/DefinePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2022/DeletePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2022/EnumerableOwnPropertyNames.js create mode 100644 node_modules/es-abstract/2022/FlattenIntoArray.js create mode 100644 node_modules/es-abstract/2022/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2022/Get.js create mode 100644 node_modules/es-abstract/2022/GetIterator.js create mode 100644 node_modules/es-abstract/2022/GetMatchIndexPair.js create mode 100644 node_modules/es-abstract/2022/GetMatchString.js create mode 100644 node_modules/es-abstract/2022/GetMethod.js create mode 100644 node_modules/es-abstract/2022/GetOwnPropertyKeys.js create mode 100644 node_modules/es-abstract/2022/GetPromiseResolve.js create mode 100644 node_modules/es-abstract/2022/GetPrototypeFromConstructor.js create mode 100644 node_modules/es-abstract/2022/GetStringIndex.js create mode 100644 node_modules/es-abstract/2022/GetSubstitution.js create mode 100644 node_modules/es-abstract/2022/GetV.js create mode 100644 node_modules/es-abstract/2022/HasOwnProperty.js create mode 100644 node_modules/es-abstract/2022/HasProperty.js create mode 100644 node_modules/es-abstract/2022/HourFromTime.js create mode 100644 node_modules/es-abstract/2022/InLeapYear.js create mode 100644 node_modules/es-abstract/2022/InstallErrorCause.js create mode 100644 node_modules/es-abstract/2022/InstanceofOperator.js create mode 100644 node_modules/es-abstract/2022/Invoke.js create mode 100644 node_modules/es-abstract/2022/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/2022/IsArray.js create mode 100644 node_modules/es-abstract/2022/IsBigIntElementType.js create mode 100644 node_modules/es-abstract/2022/IsCallable.js create mode 100644 node_modules/es-abstract/2022/IsCompatiblePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2022/IsConcatSpreadable.js create mode 100644 node_modules/es-abstract/2022/IsConstructor.js create mode 100644 node_modules/es-abstract/2022/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/2022/IsExtensible.js create mode 100644 node_modules/es-abstract/2022/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/2022/IsIntegralNumber.js create mode 100644 node_modules/es-abstract/2022/IsLessThan.js create mode 100644 node_modules/es-abstract/2022/IsLooselyEqual.js create mode 100644 node_modules/es-abstract/2022/IsNoTearConfiguration.js create mode 100644 node_modules/es-abstract/2022/IsPromise.js create mode 100644 node_modules/es-abstract/2022/IsPropertyKey.js create mode 100644 node_modules/es-abstract/2022/IsRegExp.js create mode 100644 node_modules/es-abstract/2022/IsSharedArrayBuffer.js create mode 100644 node_modules/es-abstract/2022/IsStrictlyEqual.js create mode 100644 node_modules/es-abstract/2022/IsStringPrefix.js create mode 100644 node_modules/es-abstract/2022/IsStringWellFormedUnicode.js create mode 100644 node_modules/es-abstract/2022/IsUnclampedIntegerElementType.js create mode 100644 node_modules/es-abstract/2022/IsUnsignedElementType.js create mode 100644 node_modules/es-abstract/2022/IterableToList.js create mode 100644 node_modules/es-abstract/2022/IteratorClose.js create mode 100644 node_modules/es-abstract/2022/IteratorComplete.js create mode 100644 node_modules/es-abstract/2022/IteratorNext.js create mode 100644 node_modules/es-abstract/2022/IteratorStep.js create mode 100644 node_modules/es-abstract/2022/IteratorValue.js create mode 100644 node_modules/es-abstract/2022/LengthOfArrayLike.js create mode 100644 node_modules/es-abstract/2022/MakeDate.js create mode 100644 node_modules/es-abstract/2022/MakeDay.js create mode 100644 node_modules/es-abstract/2022/MakeMatchIndicesIndexPairArray.js create mode 100644 node_modules/es-abstract/2022/MakeTime.js create mode 100644 node_modules/es-abstract/2022/MinFromTime.js create mode 100644 node_modules/es-abstract/2022/MonthFromTime.js create mode 100644 node_modules/es-abstract/2022/Number/add.js create mode 100644 node_modules/es-abstract/2022/Number/bitwiseAND.js create mode 100644 node_modules/es-abstract/2022/Number/bitwiseNOT.js create mode 100644 node_modules/es-abstract/2022/Number/bitwiseOR.js create mode 100644 node_modules/es-abstract/2022/Number/bitwiseXOR.js create mode 100644 node_modules/es-abstract/2022/Number/divide.js create mode 100644 node_modules/es-abstract/2022/Number/equal.js create mode 100644 node_modules/es-abstract/2022/Number/exponentiate.js create mode 100644 node_modules/es-abstract/2022/Number/index.js create mode 100644 node_modules/es-abstract/2022/Number/leftShift.js create mode 100644 node_modules/es-abstract/2022/Number/lessThan.js create mode 100644 node_modules/es-abstract/2022/Number/multiply.js create mode 100644 node_modules/es-abstract/2022/Number/remainder.js create mode 100644 node_modules/es-abstract/2022/Number/sameValue.js create mode 100644 node_modules/es-abstract/2022/Number/sameValueZero.js create mode 100644 node_modules/es-abstract/2022/Number/signedRightShift.js create mode 100644 node_modules/es-abstract/2022/Number/subtract.js create mode 100644 node_modules/es-abstract/2022/Number/toString.js create mode 100644 node_modules/es-abstract/2022/Number/unaryMinus.js create mode 100644 node_modules/es-abstract/2022/Number/unsignedRightShift.js create mode 100644 node_modules/es-abstract/2022/NumberBitwiseOp.js create mode 100644 node_modules/es-abstract/2022/NumberToBigInt.js create mode 100644 node_modules/es-abstract/2022/ObjectDefineProperties.js create mode 100644 node_modules/es-abstract/2022/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/es-abstract/2022/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/es-abstract/2022/OrdinaryGetOwnProperty.js create mode 100644 node_modules/es-abstract/2022/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/es-abstract/2022/OrdinaryHasInstance.js create mode 100644 node_modules/es-abstract/2022/OrdinaryHasProperty.js create mode 100644 node_modules/es-abstract/2022/OrdinaryObjectCreate.js create mode 100644 node_modules/es-abstract/2022/OrdinarySetPrototypeOf.js create mode 100644 node_modules/es-abstract/2022/OrdinaryToPrimitive.js create mode 100644 node_modules/es-abstract/2022/PromiseResolve.js create mode 100644 node_modules/es-abstract/2022/QuoteJSONString.js create mode 100644 node_modules/es-abstract/2022/RegExpCreate.js create mode 100644 node_modules/es-abstract/2022/RegExpExec.js create mode 100644 node_modules/es-abstract/2022/RegExpHasFlag.js create mode 100644 node_modules/es-abstract/2022/RequireObjectCoercible.js create mode 100644 node_modules/es-abstract/2022/SameValue.js create mode 100644 node_modules/es-abstract/2022/SameValueNonNumeric.js create mode 100644 node_modules/es-abstract/2022/SameValueZero.js create mode 100644 node_modules/es-abstract/2022/SecFromTime.js create mode 100644 node_modules/es-abstract/2022/Set.js create mode 100644 node_modules/es-abstract/2022/SetFunctionLength.js create mode 100644 node_modules/es-abstract/2022/SetFunctionName.js create mode 100644 node_modules/es-abstract/2022/SetIntegrityLevel.js create mode 100644 node_modules/es-abstract/2022/SortIndexedProperties.js create mode 100644 node_modules/es-abstract/2022/SpeciesConstructor.js create mode 100644 node_modules/es-abstract/2022/StringCreate.js create mode 100644 node_modules/es-abstract/2022/StringGetOwnProperty.js create mode 100644 node_modules/es-abstract/2022/StringIndexOf.js create mode 100644 node_modules/es-abstract/2022/StringPad.js create mode 100644 node_modules/es-abstract/2022/StringToBigInt.js create mode 100644 node_modules/es-abstract/2022/StringToCodePoints.js create mode 100644 node_modules/es-abstract/2022/StringToNumber.js create mode 100644 node_modules/es-abstract/2022/SymbolDescriptiveString.js create mode 100644 node_modules/es-abstract/2022/TestIntegrityLevel.js create mode 100644 node_modules/es-abstract/2022/TimeClip.js create mode 100644 node_modules/es-abstract/2022/TimeFromYear.js create mode 100644 node_modules/es-abstract/2022/TimeString.js create mode 100644 node_modules/es-abstract/2022/TimeWithinDay.js create mode 100644 node_modules/es-abstract/2022/ToBigInt.js create mode 100644 node_modules/es-abstract/2022/ToBigInt64.js create mode 100644 node_modules/es-abstract/2022/ToBigUint64.js create mode 100644 node_modules/es-abstract/2022/ToBoolean.js create mode 100644 node_modules/es-abstract/2022/ToDateString.js create mode 100644 node_modules/es-abstract/2022/ToIndex.js create mode 100644 node_modules/es-abstract/2022/ToInt16.js create mode 100644 node_modules/es-abstract/2022/ToInt32.js create mode 100644 node_modules/es-abstract/2022/ToInt8.js create mode 100644 node_modules/es-abstract/2022/ToIntegerOrInfinity.js create mode 100644 node_modules/es-abstract/2022/ToLength.js create mode 100644 node_modules/es-abstract/2022/ToNumber.js create mode 100644 node_modules/es-abstract/2022/ToNumeric.js create mode 100644 node_modules/es-abstract/2022/ToObject.js create mode 100644 node_modules/es-abstract/2022/ToPrimitive.js create mode 100644 node_modules/es-abstract/2022/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2022/ToPropertyKey.js create mode 100644 node_modules/es-abstract/2022/ToString.js create mode 100644 node_modules/es-abstract/2022/ToUint16.js create mode 100644 node_modules/es-abstract/2022/ToUint32.js create mode 100644 node_modules/es-abstract/2022/ToUint8.js create mode 100644 node_modules/es-abstract/2022/ToUint8Clamp.js create mode 100644 node_modules/es-abstract/2022/ToZeroPaddedDecimalString.js create mode 100644 node_modules/es-abstract/2022/TrimString.js create mode 100644 node_modules/es-abstract/2022/Type.js create mode 100644 node_modules/es-abstract/2022/UTF16EncodeCodePoint.js create mode 100644 node_modules/es-abstract/2022/UTF16SurrogatePairToCodePoint.js create mode 100644 node_modules/es-abstract/2022/UnicodeEscape.js create mode 100644 node_modules/es-abstract/2022/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2022/WeakRefDeref.js create mode 100644 node_modules/es-abstract/2022/WeekDay.js create mode 100644 node_modules/es-abstract/2022/YearFromTime.js create mode 100644 node_modules/es-abstract/2022/abs.js create mode 100644 node_modules/es-abstract/2022/clamp.js create mode 100644 node_modules/es-abstract/2022/floor.js create mode 100644 node_modules/es-abstract/2022/modulo.js create mode 100644 node_modules/es-abstract/2022/msFromTime.js create mode 100644 node_modules/es-abstract/2022/substring.js create mode 100644 node_modules/es-abstract/2022/thisBigIntValue.js create mode 100644 node_modules/es-abstract/2022/thisBooleanValue.js create mode 100644 node_modules/es-abstract/2022/thisNumberValue.js create mode 100644 node_modules/es-abstract/2022/thisStringValue.js create mode 100644 node_modules/es-abstract/2022/thisSymbolValue.js create mode 100644 node_modules/es-abstract/2022/thisTimeValue.js create mode 100644 node_modules/es-abstract/5/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/5/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/5/CheckObjectCoercible.js create mode 100644 node_modules/es-abstract/5/DateFromTime.js create mode 100644 node_modules/es-abstract/5/Day.js create mode 100644 node_modules/es-abstract/5/DayFromYear.js create mode 100644 node_modules/es-abstract/5/DayWithinYear.js create mode 100644 node_modules/es-abstract/5/DaysInYear.js create mode 100644 node_modules/es-abstract/5/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/5/HourFromTime.js create mode 100644 node_modules/es-abstract/5/InLeapYear.js create mode 100644 node_modules/es-abstract/5/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/5/IsCallable.js create mode 100644 node_modules/es-abstract/5/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/5/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/5/IsPropertyDescriptor.js create mode 100644 node_modules/es-abstract/5/MakeDate.js create mode 100644 node_modules/es-abstract/5/MakeDay.js create mode 100644 node_modules/es-abstract/5/MakeTime.js create mode 100644 node_modules/es-abstract/5/MinFromTime.js create mode 100644 node_modules/es-abstract/5/MonthFromTime.js create mode 100644 node_modules/es-abstract/5/SameValue.js create mode 100644 node_modules/es-abstract/5/SecFromTime.js create mode 100644 node_modules/es-abstract/5/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/5/TimeClip.js create mode 100644 node_modules/es-abstract/5/TimeFromYear.js create mode 100644 node_modules/es-abstract/5/TimeWithinDay.js create mode 100644 node_modules/es-abstract/5/ToBoolean.js create mode 100644 node_modules/es-abstract/5/ToInt32.js create mode 100644 node_modules/es-abstract/5/ToInteger.js create mode 100644 node_modules/es-abstract/5/ToNumber.js create mode 100644 node_modules/es-abstract/5/ToObject.js create mode 100644 node_modules/es-abstract/5/ToPrimitive.js create mode 100644 node_modules/es-abstract/5/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/5/ToString.js create mode 100644 node_modules/es-abstract/5/ToUint16.js create mode 100644 node_modules/es-abstract/5/ToUint32.js create mode 100644 node_modules/es-abstract/5/Type.js create mode 100644 node_modules/es-abstract/5/WeekDay.js create mode 100644 node_modules/es-abstract/5/YearFromTime.js create mode 100644 node_modules/es-abstract/5/abs.js create mode 100644 node_modules/es-abstract/5/floor.js create mode 100644 node_modules/es-abstract/5/modulo.js create mode 100644 node_modules/es-abstract/5/msFromTime.js create mode 100644 node_modules/es-abstract/CHANGELOG.md create mode 100644 node_modules/es-abstract/GetIntrinsic.js create mode 100644 node_modules/es-abstract/LICENSE create mode 100644 node_modules/es-abstract/README.md create mode 100644 node_modules/es-abstract/es2015.js create mode 100644 node_modules/es-abstract/es2016.js create mode 100644 node_modules/es-abstract/es2017.js create mode 100644 node_modules/es-abstract/es2018.js create mode 100644 node_modules/es-abstract/es2019.js create mode 100644 node_modules/es-abstract/es2020.js create mode 100644 node_modules/es-abstract/es2021.js create mode 100644 node_modules/es-abstract/es2022.js create mode 100644 node_modules/es-abstract/es5.js create mode 100644 node_modules/es-abstract/es6.js create mode 100644 node_modules/es-abstract/es7.js create mode 100644 node_modules/es-abstract/helpers/DefineOwnProperty.js create mode 100644 node_modules/es-abstract/helpers/IsArray.js create mode 100644 node_modules/es-abstract/helpers/OwnPropertyKeys.js create mode 100644 node_modules/es-abstract/helpers/assertRecord.js create mode 100644 node_modules/es-abstract/helpers/assign.js create mode 100644 node_modules/es-abstract/helpers/callBind.js create mode 100644 node_modules/es-abstract/helpers/callBound.js create mode 100644 node_modules/es-abstract/helpers/every.js create mode 100644 node_modules/es-abstract/helpers/forEach.js create mode 100644 node_modules/es-abstract/helpers/fromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/helpers/getInferredName.js create mode 100644 node_modules/es-abstract/helpers/getIteratorMethod.js create mode 100644 node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js create mode 100644 node_modules/es-abstract/helpers/getProto.js create mode 100644 node_modules/es-abstract/helpers/getSymbolDescription.js create mode 100644 node_modules/es-abstract/helpers/isAbstractClosure.js create mode 100644 node_modules/es-abstract/helpers/isByteValue.js create mode 100644 node_modules/es-abstract/helpers/isCodePoint.js create mode 100644 node_modules/es-abstract/helpers/isFinite.js create mode 100644 node_modules/es-abstract/helpers/isFullyPopulatedPropertyDescriptor.js create mode 100644 node_modules/es-abstract/helpers/isLeadingSurrogate.js create mode 100644 node_modules/es-abstract/helpers/isMatchRecord.js create mode 100644 node_modules/es-abstract/helpers/isNaN.js create mode 100644 node_modules/es-abstract/helpers/isPrefixOf.js create mode 100644 node_modules/es-abstract/helpers/isPrimitive.js create mode 100644 node_modules/es-abstract/helpers/isPropertyDescriptor.js create mode 100644 node_modules/es-abstract/helpers/isSamePropertyDescriptor.js create mode 100644 node_modules/es-abstract/helpers/isTrailingSurrogate.js create mode 100644 node_modules/es-abstract/helpers/maxSafeInteger.js create mode 100644 node_modules/es-abstract/helpers/mod.js create mode 100644 node_modules/es-abstract/helpers/modBigInt.js create mode 100644 node_modules/es-abstract/helpers/padTimeComponent.js create mode 100644 node_modules/es-abstract/helpers/regexTester.js create mode 100644 node_modules/es-abstract/helpers/setProto.js create mode 100644 node_modules/es-abstract/helpers/sign.js create mode 100644 node_modules/es-abstract/helpers/some.js create mode 100644 node_modules/es-abstract/helpers/timeConstants.js create mode 100644 node_modules/es-abstract/index.js create mode 100644 node_modules/es-abstract/operations/.eslintrc create mode 100644 node_modules/es-abstract/operations/2015.js create mode 100644 node_modules/es-abstract/operations/2016.js create mode 100644 node_modules/es-abstract/operations/2017.js create mode 100644 node_modules/es-abstract/operations/2018.js create mode 100644 node_modules/es-abstract/operations/2019.js create mode 100644 node_modules/es-abstract/operations/2020.js create mode 100644 node_modules/es-abstract/operations/2021.js create mode 100644 node_modules/es-abstract/operations/2022.js create mode 100644 node_modules/es-abstract/package.json create mode 100644 node_modules/es-shim-unscopables/.eslintrc create mode 100644 node_modules/es-shim-unscopables/.github/FUNDING.yml create mode 100644 node_modules/es-shim-unscopables/.nycrc create mode 100644 node_modules/es-shim-unscopables/CHANGELOG.md create mode 100644 node_modules/es-shim-unscopables/LICENSE create mode 100644 node_modules/es-shim-unscopables/README.md create mode 100644 node_modules/es-shim-unscopables/index.js create mode 100644 node_modules/es-shim-unscopables/package.json create mode 100644 node_modules/es-shim-unscopables/test/index.js create mode 100644 node_modules/es-shim-unscopables/test/with.js create mode 100644 node_modules/es-to-primitive/.eslintrc create mode 100644 node_modules/es-to-primitive/.github/FUNDING.yml create mode 100644 node_modules/es-to-primitive/.travis.yml create mode 100644 node_modules/es-to-primitive/CHANGELOG.md create mode 100644 node_modules/es-to-primitive/LICENSE create mode 100644 node_modules/es-to-primitive/Makefile create mode 100644 node_modules/es-to-primitive/README.md create mode 100644 node_modules/es-to-primitive/es2015.js create mode 100644 node_modules/es-to-primitive/es5.js create mode 100644 node_modules/es-to-primitive/es6.js create mode 100644 node_modules/es-to-primitive/helpers/isPrimitive.js create mode 100644 node_modules/es-to-primitive/index.js create mode 100644 node_modules/es-to-primitive/package.json create mode 100644 node_modules/es-to-primitive/test/es2015.js create mode 100644 node_modules/es-to-primitive/test/es5.js create mode 100644 node_modules/es-to-primitive/test/es6.js create mode 100644 node_modules/es-to-primitive/test/index.js create mode 100644 node_modules/escape-string-regexp/index.d.ts create mode 100644 node_modules/escape-string-regexp/index.js create mode 100644 node_modules/escape-string-regexp/license create mode 100644 node_modules/escape-string-regexp/package.json create mode 100644 node_modules/escape-string-regexp/readme.md create mode 100644 node_modules/eslint-plugin-react/LICENSE create mode 100644 node_modules/eslint-plugin-react/README.md create mode 100644 node_modules/eslint-plugin-react/index.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/boolean-prop-naming.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/button-has-type.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/default-props-match-prop-types.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/destructuring-assignment.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/display-name.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/forbid-component-props.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/forbid-dom-props.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/forbid-elements.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/forbid-foreign-prop-types.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/forbid-prop-types.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/function-component-definition.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/hook-use-state.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/iframe-missing-sandbox.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-boolean-value.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-child-element-spacing.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-closing-bracket-location.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-closing-tag-location.js create mode 100755 node_modules/eslint-plugin-react/lib/rules/jsx-curly-brace-presence.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-curly-newline.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-curly-spacing.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-equals-spacing.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-filename-extension.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-first-prop-new-line.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-fragments.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-handler-names.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-indent-props.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-indent.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-key.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-max-depth.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-max-props-per-line.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-newline.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-no-bind.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-no-comment-textnodes.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-no-constructed-context-values.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-no-duplicate-props.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-no-leaked-render.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-no-literals.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-no-script-url.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-no-target-blank.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-no-undef.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-no-useless-fragment.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-one-expression-per-line.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-pascal-case.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-props-no-multi-spaces.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-props-no-spreading.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-sort-default-props.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-sort-props.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-space-before-closing.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-tag-spacing.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-uses-react.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-uses-vars.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/jsx-wrap-multilines.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-access-state-in-setstate.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-adjacent-inline-elements.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-array-index-key.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-arrow-function-lifecycle.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-children-prop.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-danger-with-children.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-danger.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-deprecated.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-did-mount-set-state.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-did-update-set-state.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-direct-mutation-state.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-find-dom-node.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-invalid-html-attribute.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-is-mounted.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-multi-comp.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-namespace.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-redundant-should-component-update.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-render-return-value.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-set-state.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-string-refs.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-this-in-sfc.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-typos.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-unescaped-entities.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-unknown-property.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-unsafe.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-unstable-nested-components.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-unused-class-component-methods.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-unused-prop-types.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-unused-state.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/no-will-update-set-state.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/prefer-es6-class.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/prefer-exact-props.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/prefer-read-only-props.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/prefer-stateless-function.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/prop-types.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/react-in-jsx-scope.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/require-default-props.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/require-optimization.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/require-render-return.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/self-closing-comp.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/sort-comp.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/sort-prop-types.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/state-in-constructor.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/static-property-placement.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/style-prop-object.js create mode 100644 node_modules/eslint-plugin-react/lib/rules/void-dom-elements-no-children.js create mode 100644 node_modules/eslint-plugin-react/lib/types.d.ts create mode 100644 node_modules/eslint-plugin-react/lib/util/Components.js create mode 100644 node_modules/eslint-plugin-react/lib/util/annotations.js create mode 100644 node_modules/eslint-plugin-react/lib/util/ast.js create mode 100644 node_modules/eslint-plugin-react/lib/util/componentUtil.js create mode 100644 node_modules/eslint-plugin-react/lib/util/defaultProps.js create mode 100644 node_modules/eslint-plugin-react/lib/util/docsUrl.js create mode 100644 node_modules/eslint-plugin-react/lib/util/error.js create mode 100644 node_modules/eslint-plugin-react/lib/util/getTokenBeforeClosingBracket.js create mode 100644 node_modules/eslint-plugin-react/lib/util/isCreateElement.js create mode 100644 node_modules/eslint-plugin-react/lib/util/isDestructuredFromPragmaImport.js create mode 100644 node_modules/eslint-plugin-react/lib/util/isFirstLetterCapitalized.js create mode 100644 node_modules/eslint-plugin-react/lib/util/jsx.js create mode 100644 node_modules/eslint-plugin-react/lib/util/lifecycleMethods.js create mode 100644 node_modules/eslint-plugin-react/lib/util/linkComponents.js create mode 100644 node_modules/eslint-plugin-react/lib/util/log.js create mode 100644 node_modules/eslint-plugin-react/lib/util/makeNoMethodSetStateRule.js create mode 100644 node_modules/eslint-plugin-react/lib/util/pragma.js create mode 100644 node_modules/eslint-plugin-react/lib/util/propTypes.js create mode 100644 node_modules/eslint-plugin-react/lib/util/propTypesSort.js create mode 100644 node_modules/eslint-plugin-react/lib/util/propWrapper.js create mode 100644 node_modules/eslint-plugin-react/lib/util/props.js create mode 100644 node_modules/eslint-plugin-react/lib/util/report.js create mode 100644 node_modules/eslint-plugin-react/lib/util/usedPropTypes.js create mode 100644 node_modules/eslint-plugin-react/lib/util/variable.js create mode 100644 node_modules/eslint-plugin-react/lib/util/version.js create mode 100644 node_modules/eslint-plugin-react/node_modules/doctrine/CHANGELOG.md create mode 100644 node_modules/eslint-plugin-react/node_modules/doctrine/LICENSE create mode 100644 node_modules/eslint-plugin-react/node_modules/doctrine/LICENSE.closure-compiler create mode 100644 node_modules/eslint-plugin-react/node_modules/doctrine/LICENSE.esprima create mode 100644 node_modules/eslint-plugin-react/node_modules/doctrine/README.md create mode 100644 node_modules/eslint-plugin-react/node_modules/doctrine/lib/doctrine.js create mode 100644 node_modules/eslint-plugin-react/node_modules/doctrine/lib/typed.js create mode 100644 node_modules/eslint-plugin-react/node_modules/doctrine/lib/utility.js create mode 100644 node_modules/eslint-plugin-react/node_modules/doctrine/package.json create mode 100644 node_modules/eslint-plugin-react/package.json create mode 100644 node_modules/eslint-scope/LICENSE create mode 100644 node_modules/eslint-scope/README.md create mode 100644 node_modules/eslint-scope/dist/eslint-scope.cjs create mode 100644 node_modules/eslint-scope/lib/definition.js create mode 100644 node_modules/eslint-scope/lib/index.js create mode 100644 node_modules/eslint-scope/lib/pattern-visitor.js create mode 100644 node_modules/eslint-scope/lib/reference.js create mode 100644 node_modules/eslint-scope/lib/referencer.js create mode 100644 node_modules/eslint-scope/lib/scope-manager.js create mode 100644 node_modules/eslint-scope/lib/scope.js create mode 100644 node_modules/eslint-scope/lib/variable.js create mode 100644 node_modules/eslint-scope/lib/version.js create mode 100644 node_modules/eslint-scope/package.json create mode 100644 node_modules/eslint-utils/LICENSE create mode 100644 node_modules/eslint-utils/README.md create mode 100644 node_modules/eslint-utils/index.js create mode 100644 node_modules/eslint-utils/index.js.map create mode 100644 node_modules/eslint-utils/index.mjs create mode 100644 node_modules/eslint-utils/index.mjs.map create mode 100644 node_modules/eslint-utils/node_modules/eslint-visitor-keys/CHANGELOG.md create mode 100644 node_modules/eslint-utils/node_modules/eslint-visitor-keys/LICENSE create mode 100644 node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md create mode 100644 node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/index.js create mode 100644 node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.json create mode 100644 node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json create mode 100644 node_modules/eslint-utils/package.json create mode 100644 node_modules/eslint-visitor-keys/LICENSE create mode 100644 node_modules/eslint-visitor-keys/README.md create mode 100644 node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs create mode 100644 node_modules/eslint-visitor-keys/dist/index.d.ts create mode 100644 node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts create mode 100644 node_modules/eslint-visitor-keys/lib/index.js create mode 100644 node_modules/eslint-visitor-keys/lib/visitor-keys.js create mode 100644 node_modules/eslint-visitor-keys/package.json create mode 100644 node_modules/eslint/LICENSE create mode 100644 node_modules/eslint/README.md create mode 100755 node_modules/eslint/bin/eslint.js create mode 100644 node_modules/eslint/conf/config-schema.js create mode 100644 node_modules/eslint/conf/default-cli-options.js create mode 100644 node_modules/eslint/conf/eslint-all.js create mode 100644 node_modules/eslint/conf/eslint-recommended.js create mode 100644 node_modules/eslint/conf/globals.js create mode 100644 node_modules/eslint/conf/replacements.json create mode 100644 node_modules/eslint/conf/rule-type-list.json create mode 100644 node_modules/eslint/lib/api.js create mode 100644 node_modules/eslint/lib/cli-engine/cli-engine.js create mode 100644 node_modules/eslint/lib/cli-engine/file-enumerator.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/checkstyle.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/compact.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/html.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/jslint-xml.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/json.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/junit.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/stylish.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/tap.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/unix.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/visualstudio.js create mode 100644 node_modules/eslint/lib/cli-engine/hash.js create mode 100644 node_modules/eslint/lib/cli-engine/index.js create mode 100644 node_modules/eslint/lib/cli-engine/lint-result-cache.js create mode 100644 node_modules/eslint/lib/cli-engine/load-rules.js create mode 100644 node_modules/eslint/lib/cli-engine/xml-escape.js create mode 100644 node_modules/eslint/lib/cli.js create mode 100644 node_modules/eslint/lib/config/default-config.js create mode 100644 node_modules/eslint/lib/config/flat-config-array.js create mode 100644 node_modules/eslint/lib/config/flat-config-helpers.js create mode 100644 node_modules/eslint/lib/config/flat-config-schema.js create mode 100644 node_modules/eslint/lib/config/rule-validator.js create mode 100644 node_modules/eslint/lib/eslint/eslint-helpers.js create mode 100644 node_modules/eslint/lib/eslint/eslint.js create mode 100644 node_modules/eslint/lib/eslint/flat-eslint.js create mode 100644 node_modules/eslint/lib/eslint/index.js create mode 100644 node_modules/eslint/lib/linter/apply-disable-directives.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/code-path.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/fork-context.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/id-generator.js create mode 100644 node_modules/eslint/lib/linter/config-comment-parser.js create mode 100644 node_modules/eslint/lib/linter/index.js create mode 100644 node_modules/eslint/lib/linter/interpolate.js create mode 100644 node_modules/eslint/lib/linter/linter.js create mode 100644 node_modules/eslint/lib/linter/node-event-generator.js create mode 100644 node_modules/eslint/lib/linter/report-translator.js create mode 100644 node_modules/eslint/lib/linter/rule-fixer.js create mode 100644 node_modules/eslint/lib/linter/rules.js create mode 100644 node_modules/eslint/lib/linter/safe-emitter.js create mode 100644 node_modules/eslint/lib/linter/source-code-fixer.js create mode 100644 node_modules/eslint/lib/linter/timing.js create mode 100644 node_modules/eslint/lib/options.js create mode 100644 node_modules/eslint/lib/rule-tester/flat-rule-tester.js create mode 100644 node_modules/eslint/lib/rule-tester/index.js create mode 100644 node_modules/eslint/lib/rule-tester/rule-tester.js create mode 100644 node_modules/eslint/lib/rules/accessor-pairs.js create mode 100644 node_modules/eslint/lib/rules/array-bracket-newline.js create mode 100644 node_modules/eslint/lib/rules/array-bracket-spacing.js create mode 100644 node_modules/eslint/lib/rules/array-callback-return.js create mode 100644 node_modules/eslint/lib/rules/array-element-newline.js create mode 100644 node_modules/eslint/lib/rules/arrow-body-style.js create mode 100644 node_modules/eslint/lib/rules/arrow-parens.js create mode 100644 node_modules/eslint/lib/rules/arrow-spacing.js create mode 100644 node_modules/eslint/lib/rules/block-scoped-var.js create mode 100644 node_modules/eslint/lib/rules/block-spacing.js create mode 100644 node_modules/eslint/lib/rules/brace-style.js create mode 100644 node_modules/eslint/lib/rules/callback-return.js create mode 100644 node_modules/eslint/lib/rules/camelcase.js create mode 100644 node_modules/eslint/lib/rules/capitalized-comments.js create mode 100644 node_modules/eslint/lib/rules/class-methods-use-this.js create mode 100644 node_modules/eslint/lib/rules/comma-dangle.js create mode 100644 node_modules/eslint/lib/rules/comma-spacing.js create mode 100644 node_modules/eslint/lib/rules/comma-style.js create mode 100644 node_modules/eslint/lib/rules/complexity.js create mode 100644 node_modules/eslint/lib/rules/computed-property-spacing.js create mode 100644 node_modules/eslint/lib/rules/consistent-return.js create mode 100644 node_modules/eslint/lib/rules/consistent-this.js create mode 100644 node_modules/eslint/lib/rules/constructor-super.js create mode 100644 node_modules/eslint/lib/rules/curly.js create mode 100644 node_modules/eslint/lib/rules/default-case-last.js create mode 100644 node_modules/eslint/lib/rules/default-case.js create mode 100644 node_modules/eslint/lib/rules/default-param-last.js create mode 100644 node_modules/eslint/lib/rules/dot-location.js create mode 100644 node_modules/eslint/lib/rules/dot-notation.js create mode 100644 node_modules/eslint/lib/rules/eol-last.js create mode 100644 node_modules/eslint/lib/rules/eqeqeq.js create mode 100644 node_modules/eslint/lib/rules/for-direction.js create mode 100644 node_modules/eslint/lib/rules/func-call-spacing.js create mode 100644 node_modules/eslint/lib/rules/func-name-matching.js create mode 100644 node_modules/eslint/lib/rules/func-names.js create mode 100644 node_modules/eslint/lib/rules/func-style.js create mode 100644 node_modules/eslint/lib/rules/function-call-argument-newline.js create mode 100644 node_modules/eslint/lib/rules/function-paren-newline.js create mode 100644 node_modules/eslint/lib/rules/generator-star-spacing.js create mode 100644 node_modules/eslint/lib/rules/getter-return.js create mode 100644 node_modules/eslint/lib/rules/global-require.js create mode 100644 node_modules/eslint/lib/rules/grouped-accessor-pairs.js create mode 100644 node_modules/eslint/lib/rules/guard-for-in.js create mode 100644 node_modules/eslint/lib/rules/handle-callback-err.js create mode 100644 node_modules/eslint/lib/rules/id-blacklist.js create mode 100644 node_modules/eslint/lib/rules/id-denylist.js create mode 100644 node_modules/eslint/lib/rules/id-length.js create mode 100644 node_modules/eslint/lib/rules/id-match.js create mode 100644 node_modules/eslint/lib/rules/implicit-arrow-linebreak.js create mode 100644 node_modules/eslint/lib/rules/indent-legacy.js create mode 100644 node_modules/eslint/lib/rules/indent.js create mode 100644 node_modules/eslint/lib/rules/index.js create mode 100644 node_modules/eslint/lib/rules/init-declarations.js create mode 100644 node_modules/eslint/lib/rules/jsx-quotes.js create mode 100644 node_modules/eslint/lib/rules/key-spacing.js create mode 100644 node_modules/eslint/lib/rules/keyword-spacing.js create mode 100644 node_modules/eslint/lib/rules/line-comment-position.js create mode 100644 node_modules/eslint/lib/rules/linebreak-style.js create mode 100644 node_modules/eslint/lib/rules/lines-around-comment.js create mode 100644 node_modules/eslint/lib/rules/lines-around-directive.js create mode 100644 node_modules/eslint/lib/rules/lines-between-class-members.js create mode 100644 node_modules/eslint/lib/rules/logical-assignment-operators.js create mode 100644 node_modules/eslint/lib/rules/max-classes-per-file.js create mode 100644 node_modules/eslint/lib/rules/max-depth.js create mode 100644 node_modules/eslint/lib/rules/max-len.js create mode 100644 node_modules/eslint/lib/rules/max-lines-per-function.js create mode 100644 node_modules/eslint/lib/rules/max-lines.js create mode 100644 node_modules/eslint/lib/rules/max-nested-callbacks.js create mode 100644 node_modules/eslint/lib/rules/max-params.js create mode 100644 node_modules/eslint/lib/rules/max-statements-per-line.js create mode 100644 node_modules/eslint/lib/rules/max-statements.js create mode 100644 node_modules/eslint/lib/rules/multiline-comment-style.js create mode 100644 node_modules/eslint/lib/rules/multiline-ternary.js create mode 100644 node_modules/eslint/lib/rules/new-cap.js create mode 100644 node_modules/eslint/lib/rules/new-parens.js create mode 100644 node_modules/eslint/lib/rules/newline-after-var.js create mode 100644 node_modules/eslint/lib/rules/newline-before-return.js create mode 100644 node_modules/eslint/lib/rules/newline-per-chained-call.js create mode 100644 node_modules/eslint/lib/rules/no-alert.js create mode 100644 node_modules/eslint/lib/rules/no-array-constructor.js create mode 100644 node_modules/eslint/lib/rules/no-async-promise-executor.js create mode 100644 node_modules/eslint/lib/rules/no-await-in-loop.js create mode 100644 node_modules/eslint/lib/rules/no-bitwise.js create mode 100644 node_modules/eslint/lib/rules/no-buffer-constructor.js create mode 100644 node_modules/eslint/lib/rules/no-caller.js create mode 100644 node_modules/eslint/lib/rules/no-case-declarations.js create mode 100644 node_modules/eslint/lib/rules/no-catch-shadow.js create mode 100644 node_modules/eslint/lib/rules/no-class-assign.js create mode 100644 node_modules/eslint/lib/rules/no-compare-neg-zero.js create mode 100644 node_modules/eslint/lib/rules/no-cond-assign.js create mode 100644 node_modules/eslint/lib/rules/no-confusing-arrow.js create mode 100644 node_modules/eslint/lib/rules/no-console.js create mode 100644 node_modules/eslint/lib/rules/no-const-assign.js create mode 100644 node_modules/eslint/lib/rules/no-constant-binary-expression.js create mode 100644 node_modules/eslint/lib/rules/no-constant-condition.js create mode 100644 node_modules/eslint/lib/rules/no-constructor-return.js create mode 100644 node_modules/eslint/lib/rules/no-continue.js create mode 100644 node_modules/eslint/lib/rules/no-control-regex.js create mode 100644 node_modules/eslint/lib/rules/no-debugger.js create mode 100644 node_modules/eslint/lib/rules/no-delete-var.js create mode 100644 node_modules/eslint/lib/rules/no-div-regex.js create mode 100644 node_modules/eslint/lib/rules/no-dupe-args.js create mode 100644 node_modules/eslint/lib/rules/no-dupe-class-members.js create mode 100644 node_modules/eslint/lib/rules/no-dupe-else-if.js create mode 100644 node_modules/eslint/lib/rules/no-dupe-keys.js create mode 100644 node_modules/eslint/lib/rules/no-duplicate-case.js create mode 100644 node_modules/eslint/lib/rules/no-duplicate-imports.js create mode 100644 node_modules/eslint/lib/rules/no-else-return.js create mode 100644 node_modules/eslint/lib/rules/no-empty-character-class.js create mode 100644 node_modules/eslint/lib/rules/no-empty-function.js create mode 100644 node_modules/eslint/lib/rules/no-empty-pattern.js create mode 100644 node_modules/eslint/lib/rules/no-empty.js create mode 100644 node_modules/eslint/lib/rules/no-eq-null.js create mode 100644 node_modules/eslint/lib/rules/no-eval.js create mode 100644 node_modules/eslint/lib/rules/no-ex-assign.js create mode 100644 node_modules/eslint/lib/rules/no-extend-native.js create mode 100644 node_modules/eslint/lib/rules/no-extra-bind.js create mode 100644 node_modules/eslint/lib/rules/no-extra-boolean-cast.js create mode 100644 node_modules/eslint/lib/rules/no-extra-label.js create mode 100644 node_modules/eslint/lib/rules/no-extra-parens.js create mode 100644 node_modules/eslint/lib/rules/no-extra-semi.js create mode 100644 node_modules/eslint/lib/rules/no-fallthrough.js create mode 100644 node_modules/eslint/lib/rules/no-floating-decimal.js create mode 100644 node_modules/eslint/lib/rules/no-func-assign.js create mode 100644 node_modules/eslint/lib/rules/no-global-assign.js create mode 100644 node_modules/eslint/lib/rules/no-implicit-coercion.js create mode 100644 node_modules/eslint/lib/rules/no-implicit-globals.js create mode 100644 node_modules/eslint/lib/rules/no-implied-eval.js create mode 100644 node_modules/eslint/lib/rules/no-import-assign.js create mode 100644 node_modules/eslint/lib/rules/no-inline-comments.js create mode 100644 node_modules/eslint/lib/rules/no-inner-declarations.js create mode 100644 node_modules/eslint/lib/rules/no-invalid-regexp.js create mode 100644 node_modules/eslint/lib/rules/no-invalid-this.js create mode 100644 node_modules/eslint/lib/rules/no-irregular-whitespace.js create mode 100644 node_modules/eslint/lib/rules/no-iterator.js create mode 100644 node_modules/eslint/lib/rules/no-label-var.js create mode 100644 node_modules/eslint/lib/rules/no-labels.js create mode 100644 node_modules/eslint/lib/rules/no-lone-blocks.js create mode 100644 node_modules/eslint/lib/rules/no-lonely-if.js create mode 100644 node_modules/eslint/lib/rules/no-loop-func.js create mode 100644 node_modules/eslint/lib/rules/no-loss-of-precision.js create mode 100644 node_modules/eslint/lib/rules/no-magic-numbers.js create mode 100644 node_modules/eslint/lib/rules/no-misleading-character-class.js create mode 100644 node_modules/eslint/lib/rules/no-mixed-operators.js create mode 100644 node_modules/eslint/lib/rules/no-mixed-requires.js create mode 100644 node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js create mode 100644 node_modules/eslint/lib/rules/no-multi-assign.js create mode 100644 node_modules/eslint/lib/rules/no-multi-spaces.js create mode 100644 node_modules/eslint/lib/rules/no-multi-str.js create mode 100644 node_modules/eslint/lib/rules/no-multiple-empty-lines.js create mode 100644 node_modules/eslint/lib/rules/no-native-reassign.js create mode 100644 node_modules/eslint/lib/rules/no-negated-condition.js create mode 100644 node_modules/eslint/lib/rules/no-negated-in-lhs.js create mode 100644 node_modules/eslint/lib/rules/no-nested-ternary.js create mode 100644 node_modules/eslint/lib/rules/no-new-func.js create mode 100644 node_modules/eslint/lib/rules/no-new-object.js create mode 100644 node_modules/eslint/lib/rules/no-new-require.js create mode 100644 node_modules/eslint/lib/rules/no-new-symbol.js create mode 100644 node_modules/eslint/lib/rules/no-new-wrappers.js create mode 100644 node_modules/eslint/lib/rules/no-new.js create mode 100644 node_modules/eslint/lib/rules/no-nonoctal-decimal-escape.js create mode 100644 node_modules/eslint/lib/rules/no-obj-calls.js create mode 100644 node_modules/eslint/lib/rules/no-octal-escape.js create mode 100644 node_modules/eslint/lib/rules/no-octal.js create mode 100644 node_modules/eslint/lib/rules/no-param-reassign.js create mode 100644 node_modules/eslint/lib/rules/no-path-concat.js create mode 100644 node_modules/eslint/lib/rules/no-plusplus.js create mode 100644 node_modules/eslint/lib/rules/no-process-env.js create mode 100644 node_modules/eslint/lib/rules/no-process-exit.js create mode 100644 node_modules/eslint/lib/rules/no-promise-executor-return.js create mode 100644 node_modules/eslint/lib/rules/no-proto.js create mode 100644 node_modules/eslint/lib/rules/no-prototype-builtins.js create mode 100644 node_modules/eslint/lib/rules/no-redeclare.js create mode 100644 node_modules/eslint/lib/rules/no-regex-spaces.js create mode 100644 node_modules/eslint/lib/rules/no-restricted-exports.js create mode 100644 node_modules/eslint/lib/rules/no-restricted-globals.js create mode 100644 node_modules/eslint/lib/rules/no-restricted-imports.js create mode 100644 node_modules/eslint/lib/rules/no-restricted-modules.js create mode 100644 node_modules/eslint/lib/rules/no-restricted-properties.js create mode 100644 node_modules/eslint/lib/rules/no-restricted-syntax.js create mode 100644 node_modules/eslint/lib/rules/no-return-assign.js create mode 100644 node_modules/eslint/lib/rules/no-return-await.js create mode 100644 node_modules/eslint/lib/rules/no-script-url.js create mode 100644 node_modules/eslint/lib/rules/no-self-assign.js create mode 100644 node_modules/eslint/lib/rules/no-self-compare.js create mode 100644 node_modules/eslint/lib/rules/no-sequences.js create mode 100644 node_modules/eslint/lib/rules/no-setter-return.js create mode 100644 node_modules/eslint/lib/rules/no-shadow-restricted-names.js create mode 100644 node_modules/eslint/lib/rules/no-shadow.js create mode 100644 node_modules/eslint/lib/rules/no-spaced-func.js create mode 100644 node_modules/eslint/lib/rules/no-sparse-arrays.js create mode 100644 node_modules/eslint/lib/rules/no-sync.js create mode 100644 node_modules/eslint/lib/rules/no-tabs.js create mode 100644 node_modules/eslint/lib/rules/no-template-curly-in-string.js create mode 100644 node_modules/eslint/lib/rules/no-ternary.js create mode 100644 node_modules/eslint/lib/rules/no-this-before-super.js create mode 100644 node_modules/eslint/lib/rules/no-throw-literal.js create mode 100644 node_modules/eslint/lib/rules/no-trailing-spaces.js create mode 100644 node_modules/eslint/lib/rules/no-undef-init.js create mode 100644 node_modules/eslint/lib/rules/no-undef.js create mode 100644 node_modules/eslint/lib/rules/no-undefined.js create mode 100644 node_modules/eslint/lib/rules/no-underscore-dangle.js create mode 100644 node_modules/eslint/lib/rules/no-unexpected-multiline.js create mode 100644 node_modules/eslint/lib/rules/no-unmodified-loop-condition.js create mode 100644 node_modules/eslint/lib/rules/no-unneeded-ternary.js create mode 100644 node_modules/eslint/lib/rules/no-unreachable-loop.js create mode 100644 node_modules/eslint/lib/rules/no-unreachable.js create mode 100644 node_modules/eslint/lib/rules/no-unsafe-finally.js create mode 100644 node_modules/eslint/lib/rules/no-unsafe-negation.js create mode 100644 node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js create mode 100644 node_modules/eslint/lib/rules/no-unused-expressions.js create mode 100644 node_modules/eslint/lib/rules/no-unused-labels.js create mode 100644 node_modules/eslint/lib/rules/no-unused-private-class-members.js create mode 100644 node_modules/eslint/lib/rules/no-unused-vars.js create mode 100644 node_modules/eslint/lib/rules/no-use-before-define.js create mode 100644 node_modules/eslint/lib/rules/no-useless-backreference.js create mode 100644 node_modules/eslint/lib/rules/no-useless-call.js create mode 100644 node_modules/eslint/lib/rules/no-useless-catch.js create mode 100644 node_modules/eslint/lib/rules/no-useless-computed-key.js create mode 100644 node_modules/eslint/lib/rules/no-useless-concat.js create mode 100644 node_modules/eslint/lib/rules/no-useless-constructor.js create mode 100644 node_modules/eslint/lib/rules/no-useless-escape.js create mode 100644 node_modules/eslint/lib/rules/no-useless-rename.js create mode 100644 node_modules/eslint/lib/rules/no-useless-return.js create mode 100644 node_modules/eslint/lib/rules/no-var.js create mode 100644 node_modules/eslint/lib/rules/no-void.js create mode 100644 node_modules/eslint/lib/rules/no-warning-comments.js create mode 100644 node_modules/eslint/lib/rules/no-whitespace-before-property.js create mode 100644 node_modules/eslint/lib/rules/no-with.js create mode 100644 node_modules/eslint/lib/rules/nonblock-statement-body-position.js create mode 100644 node_modules/eslint/lib/rules/object-curly-newline.js create mode 100644 node_modules/eslint/lib/rules/object-curly-spacing.js create mode 100644 node_modules/eslint/lib/rules/object-property-newline.js create mode 100644 node_modules/eslint/lib/rules/object-shorthand.js create mode 100644 node_modules/eslint/lib/rules/one-var-declaration-per-line.js create mode 100644 node_modules/eslint/lib/rules/one-var.js create mode 100644 node_modules/eslint/lib/rules/operator-assignment.js create mode 100644 node_modules/eslint/lib/rules/operator-linebreak.js create mode 100644 node_modules/eslint/lib/rules/padded-blocks.js create mode 100644 node_modules/eslint/lib/rules/padding-line-between-statements.js create mode 100644 node_modules/eslint/lib/rules/prefer-arrow-callback.js create mode 100644 node_modules/eslint/lib/rules/prefer-const.js create mode 100644 node_modules/eslint/lib/rules/prefer-destructuring.js create mode 100644 node_modules/eslint/lib/rules/prefer-exponentiation-operator.js create mode 100644 node_modules/eslint/lib/rules/prefer-named-capture-group.js create mode 100644 node_modules/eslint/lib/rules/prefer-numeric-literals.js create mode 100644 node_modules/eslint/lib/rules/prefer-object-has-own.js create mode 100644 node_modules/eslint/lib/rules/prefer-object-spread.js create mode 100644 node_modules/eslint/lib/rules/prefer-promise-reject-errors.js create mode 100644 node_modules/eslint/lib/rules/prefer-reflect.js create mode 100644 node_modules/eslint/lib/rules/prefer-regex-literals.js create mode 100644 node_modules/eslint/lib/rules/prefer-rest-params.js create mode 100644 node_modules/eslint/lib/rules/prefer-spread.js create mode 100644 node_modules/eslint/lib/rules/prefer-template.js create mode 100644 node_modules/eslint/lib/rules/quote-props.js create mode 100644 node_modules/eslint/lib/rules/quotes.js create mode 100644 node_modules/eslint/lib/rules/radix.js create mode 100644 node_modules/eslint/lib/rules/require-atomic-updates.js create mode 100644 node_modules/eslint/lib/rules/require-await.js create mode 100644 node_modules/eslint/lib/rules/require-jsdoc.js create mode 100644 node_modules/eslint/lib/rules/require-unicode-regexp.js create mode 100644 node_modules/eslint/lib/rules/require-yield.js create mode 100644 node_modules/eslint/lib/rules/rest-spread-spacing.js create mode 100644 node_modules/eslint/lib/rules/semi-spacing.js create mode 100644 node_modules/eslint/lib/rules/semi-style.js create mode 100644 node_modules/eslint/lib/rules/semi.js create mode 100644 node_modules/eslint/lib/rules/sort-imports.js create mode 100644 node_modules/eslint/lib/rules/sort-keys.js create mode 100644 node_modules/eslint/lib/rules/sort-vars.js create mode 100644 node_modules/eslint/lib/rules/space-before-blocks.js create mode 100644 node_modules/eslint/lib/rules/space-before-function-paren.js create mode 100644 node_modules/eslint/lib/rules/space-in-parens.js create mode 100644 node_modules/eslint/lib/rules/space-infix-ops.js create mode 100644 node_modules/eslint/lib/rules/space-unary-ops.js create mode 100644 node_modules/eslint/lib/rules/spaced-comment.js create mode 100644 node_modules/eslint/lib/rules/strict.js create mode 100644 node_modules/eslint/lib/rules/switch-colon-spacing.js create mode 100644 node_modules/eslint/lib/rules/symbol-description.js create mode 100644 node_modules/eslint/lib/rules/template-curly-spacing.js create mode 100644 node_modules/eslint/lib/rules/template-tag-spacing.js create mode 100644 node_modules/eslint/lib/rules/unicode-bom.js create mode 100644 node_modules/eslint/lib/rules/use-isnan.js create mode 100644 node_modules/eslint/lib/rules/utils/ast-utils.js create mode 100644 node_modules/eslint/lib/rules/utils/fix-tracker.js create mode 100644 node_modules/eslint/lib/rules/utils/keywords.js create mode 100644 node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js create mode 100644 node_modules/eslint/lib/rules/utils/patterns/letters.js create mode 100644 node_modules/eslint/lib/rules/utils/unicode/index.js create mode 100644 node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js create mode 100644 node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js create mode 100644 node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js create mode 100644 node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js create mode 100644 node_modules/eslint/lib/rules/valid-jsdoc.js create mode 100644 node_modules/eslint/lib/rules/valid-typeof.js create mode 100644 node_modules/eslint/lib/rules/vars-on-top.js create mode 100644 node_modules/eslint/lib/rules/wrap-iife.js create mode 100644 node_modules/eslint/lib/rules/wrap-regex.js create mode 100644 node_modules/eslint/lib/rules/yield-star-spacing.js create mode 100644 node_modules/eslint/lib/rules/yoda.js create mode 100644 node_modules/eslint/lib/shared/ajv.js create mode 100644 node_modules/eslint/lib/shared/ast-utils.js create mode 100644 node_modules/eslint/lib/shared/config-validator.js create mode 100644 node_modules/eslint/lib/shared/deprecation-warnings.js create mode 100644 node_modules/eslint/lib/shared/logging.js create mode 100644 node_modules/eslint/lib/shared/relative-module-resolver.js create mode 100644 node_modules/eslint/lib/shared/runtime-info.js create mode 100644 node_modules/eslint/lib/shared/string-utils.js create mode 100644 node_modules/eslint/lib/shared/traverser.js create mode 100644 node_modules/eslint/lib/shared/types.js create mode 100644 node_modules/eslint/lib/source-code/index.js create mode 100644 node_modules/eslint/lib/source-code/source-code.js create mode 100644 node_modules/eslint/lib/source-code/token-store/backward-token-comment-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/backward-token-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/cursors.js create mode 100644 node_modules/eslint/lib/source-code/token-store/decorative-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/filter-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/forward-token-comment-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/forward-token-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/index.js create mode 100644 node_modules/eslint/lib/source-code/token-store/limit-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/padded-token-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/skip-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/utils.js create mode 100644 node_modules/eslint/lib/unsupported-api.js create mode 100644 node_modules/eslint/messages/all-files-ignored.js create mode 100644 node_modules/eslint/messages/extend-config-missing.js create mode 100644 node_modules/eslint/messages/failed-to-read-json.js create mode 100644 node_modules/eslint/messages/file-not-found.js create mode 100644 node_modules/eslint/messages/no-config-found.js create mode 100644 node_modules/eslint/messages/plugin-conflict.js create mode 100644 node_modules/eslint/messages/plugin-invalid.js create mode 100644 node_modules/eslint/messages/plugin-missing.js create mode 100644 node_modules/eslint/messages/print-config-with-directory-path.js create mode 100644 node_modules/eslint/messages/whitespace-found.js create mode 100644 node_modules/eslint/package.json create mode 100644 node_modules/espree/LICENSE create mode 100644 node_modules/espree/README.md create mode 100644 node_modules/espree/dist/espree.cjs create mode 100644 node_modules/espree/espree.js create mode 100644 node_modules/espree/lib/espree.js create mode 100644 node_modules/espree/lib/features.js create mode 100644 node_modules/espree/lib/options.js create mode 100644 node_modules/espree/lib/token-translator.js create mode 100644 node_modules/espree/lib/version.js create mode 100644 node_modules/espree/package.json create mode 100644 node_modules/esquery/README.md create mode 100644 node_modules/esquery/dist/esquery.esm.js create mode 100644 node_modules/esquery/dist/esquery.esm.min.js create mode 100644 node_modules/esquery/dist/esquery.esm.min.js.map create mode 100644 node_modules/esquery/dist/esquery.js create mode 100644 node_modules/esquery/dist/esquery.lite.js create mode 100644 node_modules/esquery/dist/esquery.lite.min.js create mode 100644 node_modules/esquery/dist/esquery.lite.min.js.map create mode 100644 node_modules/esquery/dist/esquery.min.js create mode 100644 node_modules/esquery/dist/esquery.min.js.map create mode 100644 node_modules/esquery/license.txt create mode 100644 node_modules/esquery/package.json create mode 100644 node_modules/esquery/parser.js create mode 100644 node_modules/esrecurse/.babelrc create mode 100644 node_modules/esrecurse/README.md create mode 100644 node_modules/esrecurse/esrecurse.js create mode 100644 node_modules/esrecurse/gulpfile.babel.js create mode 100755 node_modules/esrecurse/package.json create mode 100644 node_modules/estraverse/.jshintrc create mode 100644 node_modules/estraverse/LICENSE.BSD create mode 100644 node_modules/estraverse/README.md create mode 100644 node_modules/estraverse/estraverse.js create mode 100644 node_modules/estraverse/gulpfile.js create mode 100644 node_modules/estraverse/package.json create mode 100644 node_modules/esutils/LICENSE.BSD create mode 100644 node_modules/esutils/README.md create mode 100644 node_modules/esutils/lib/ast.js create mode 100644 node_modules/esutils/lib/code.js create mode 100644 node_modules/esutils/lib/keyword.js create mode 100644 node_modules/esutils/lib/utils.js create mode 100644 node_modules/esutils/package.json create mode 100644 node_modules/fast-deep-equal/LICENSE create mode 100644 node_modules/fast-deep-equal/README.md create mode 100644 node_modules/fast-deep-equal/es6/index.d.ts create mode 100644 node_modules/fast-deep-equal/es6/index.js create mode 100644 node_modules/fast-deep-equal/es6/react.d.ts create mode 100644 node_modules/fast-deep-equal/es6/react.js create mode 100644 node_modules/fast-deep-equal/index.d.ts create mode 100644 node_modules/fast-deep-equal/index.js create mode 100644 node_modules/fast-deep-equal/package.json create mode 100644 node_modules/fast-deep-equal/react.d.ts create mode 100644 node_modules/fast-deep-equal/react.js create mode 100644 node_modules/fast-glob/LICENSE create mode 100644 node_modules/fast-glob/README.md create mode 100644 node_modules/fast-glob/node_modules/glob-parent/CHANGELOG.md create mode 100644 node_modules/fast-glob/node_modules/glob-parent/LICENSE create mode 100644 node_modules/fast-glob/node_modules/glob-parent/README.md create mode 100644 node_modules/fast-glob/node_modules/glob-parent/index.js create mode 100644 node_modules/fast-glob/node_modules/glob-parent/package.json create mode 100644 node_modules/fast-glob/out/index.d.ts create mode 100644 node_modules/fast-glob/out/index.js create mode 100644 node_modules/fast-glob/out/managers/patterns.d.ts create mode 100644 node_modules/fast-glob/out/managers/patterns.js create mode 100644 node_modules/fast-glob/out/managers/tasks.d.ts create mode 100644 node_modules/fast-glob/out/managers/tasks.js create mode 100644 node_modules/fast-glob/out/providers/async.d.ts create mode 100644 node_modules/fast-glob/out/providers/async.js create mode 100644 node_modules/fast-glob/out/providers/filters/deep.d.ts create mode 100644 node_modules/fast-glob/out/providers/filters/deep.js create mode 100644 node_modules/fast-glob/out/providers/filters/entry.d.ts create mode 100644 node_modules/fast-glob/out/providers/filters/entry.js create mode 100644 node_modules/fast-glob/out/providers/filters/error.d.ts create mode 100644 node_modules/fast-glob/out/providers/filters/error.js create mode 100644 node_modules/fast-glob/out/providers/matchers/matcher.d.ts create mode 100644 node_modules/fast-glob/out/providers/matchers/matcher.js create mode 100644 node_modules/fast-glob/out/providers/matchers/partial.d.ts create mode 100644 node_modules/fast-glob/out/providers/matchers/partial.js create mode 100644 node_modules/fast-glob/out/providers/provider.d.ts create mode 100644 node_modules/fast-glob/out/providers/provider.js create mode 100644 node_modules/fast-glob/out/providers/stream.d.ts create mode 100644 node_modules/fast-glob/out/providers/stream.js create mode 100644 node_modules/fast-glob/out/providers/sync.d.ts create mode 100644 node_modules/fast-glob/out/providers/sync.js create mode 100644 node_modules/fast-glob/out/providers/transformers/entry.d.ts create mode 100644 node_modules/fast-glob/out/providers/transformers/entry.js create mode 100644 node_modules/fast-glob/out/readers/async.d.ts create mode 100644 node_modules/fast-glob/out/readers/async.js create mode 100644 node_modules/fast-glob/out/readers/reader.d.ts create mode 100644 node_modules/fast-glob/out/readers/reader.js create mode 100644 node_modules/fast-glob/out/readers/stream.d.ts create mode 100644 node_modules/fast-glob/out/readers/stream.js create mode 100644 node_modules/fast-glob/out/readers/sync.d.ts create mode 100644 node_modules/fast-glob/out/readers/sync.js create mode 100644 node_modules/fast-glob/out/settings.d.ts create mode 100644 node_modules/fast-glob/out/settings.js create mode 100644 node_modules/fast-glob/out/types/index.d.ts create mode 100644 node_modules/fast-glob/out/types/index.js create mode 100644 node_modules/fast-glob/out/utils/array.d.ts create mode 100644 node_modules/fast-glob/out/utils/array.js create mode 100644 node_modules/fast-glob/out/utils/errno.d.ts create mode 100644 node_modules/fast-glob/out/utils/errno.js create mode 100644 node_modules/fast-glob/out/utils/fs.d.ts create mode 100644 node_modules/fast-glob/out/utils/fs.js create mode 100644 node_modules/fast-glob/out/utils/index.d.ts create mode 100644 node_modules/fast-glob/out/utils/index.js create mode 100644 node_modules/fast-glob/out/utils/path.d.ts create mode 100644 node_modules/fast-glob/out/utils/path.js create mode 100644 node_modules/fast-glob/out/utils/pattern.d.ts create mode 100644 node_modules/fast-glob/out/utils/pattern.js create mode 100644 node_modules/fast-glob/out/utils/stream.d.ts create mode 100644 node_modules/fast-glob/out/utils/stream.js create mode 100644 node_modules/fast-glob/out/utils/string.d.ts create mode 100644 node_modules/fast-glob/out/utils/string.js create mode 100644 node_modules/fast-glob/package.json create mode 100644 node_modules/fast-json-stable-stringify/.eslintrc.yml create mode 100644 node_modules/fast-json-stable-stringify/.github/FUNDING.yml create mode 100644 node_modules/fast-json-stable-stringify/.travis.yml create mode 100644 node_modules/fast-json-stable-stringify/LICENSE create mode 100644 node_modules/fast-json-stable-stringify/README.md create mode 100644 node_modules/fast-json-stable-stringify/benchmark/index.js create mode 100644 node_modules/fast-json-stable-stringify/benchmark/test.json create mode 100644 node_modules/fast-json-stable-stringify/example/key_cmp.js create mode 100644 node_modules/fast-json-stable-stringify/example/nested.js create mode 100644 node_modules/fast-json-stable-stringify/example/str.js create mode 100644 node_modules/fast-json-stable-stringify/example/value_cmp.js create mode 100644 node_modules/fast-json-stable-stringify/index.d.ts create mode 100644 node_modules/fast-json-stable-stringify/index.js create mode 100644 node_modules/fast-json-stable-stringify/package.json create mode 100644 node_modules/fast-json-stable-stringify/test/cmp.js create mode 100644 node_modules/fast-json-stable-stringify/test/nested.js create mode 100644 node_modules/fast-json-stable-stringify/test/str.js create mode 100644 node_modules/fast-json-stable-stringify/test/to-json.js create mode 100644 node_modules/fast-levenshtein/LICENSE.md create mode 100644 node_modules/fast-levenshtein/README.md create mode 100644 node_modules/fast-levenshtein/levenshtein.js create mode 100644 node_modules/fast-levenshtein/package.json create mode 100644 node_modules/fastq/.github/dependabot.yml create mode 100644 node_modules/fastq/.github/workflows/ci.yml create mode 100644 node_modules/fastq/LICENSE create mode 100644 node_modules/fastq/README.md create mode 100644 node_modules/fastq/bench.js create mode 100644 node_modules/fastq/example.js create mode 100644 node_modules/fastq/example.mjs create mode 100644 node_modules/fastq/index.d.ts create mode 100644 node_modules/fastq/package.json create mode 100644 node_modules/fastq/queue.js create mode 100644 node_modules/fastq/test/example.ts create mode 100644 node_modules/fastq/test/promise.js create mode 100644 node_modules/fastq/test/test.js create mode 100644 node_modules/fastq/test/tsconfig.json create mode 100644 node_modules/file-entry-cache/LICENSE create mode 100644 node_modules/file-entry-cache/README.md create mode 100644 node_modules/file-entry-cache/cache.js create mode 100644 node_modules/file-entry-cache/changelog.md create mode 100644 node_modules/file-entry-cache/package.json create mode 100644 node_modules/fill-range/LICENSE create mode 100644 node_modules/fill-range/README.md create mode 100644 node_modules/fill-range/index.js create mode 100644 node_modules/fill-range/package.json create mode 100644 node_modules/find-up/index.d.ts create mode 100644 node_modules/find-up/index.js create mode 100644 node_modules/find-up/license create mode 100644 node_modules/find-up/package.json create mode 100644 node_modules/find-up/readme.md create mode 100644 node_modules/flat-cache/LICENSE create mode 100644 node_modules/flat-cache/README.md create mode 100644 node_modules/flat-cache/changelog.md create mode 100644 node_modules/flat-cache/package.json create mode 100644 node_modules/flat-cache/src/cache.js create mode 100644 node_modules/flat-cache/src/del.js create mode 100644 node_modules/flat-cache/src/utils.js create mode 100644 node_modules/flatted/LICENSE create mode 100644 node_modules/flatted/README.md create mode 100644 node_modules/flatted/cjs/index.js create mode 100644 node_modules/flatted/cjs/package.json create mode 100644 node_modules/flatted/es.js create mode 100644 node_modules/flatted/esm.js create mode 100644 node_modules/flatted/esm/index.js create mode 100644 node_modules/flatted/index.js create mode 100644 node_modules/flatted/min.js create mode 100644 node_modules/flatted/package.json create mode 100644 node_modules/flatted/php/flatted.php create mode 100644 node_modules/flatted/types.d.ts create mode 100644 node_modules/fs.realpath/LICENSE create mode 100644 node_modules/fs.realpath/README.md create mode 100644 node_modules/fs.realpath/index.js create mode 100644 node_modules/fs.realpath/old.js create mode 100644 node_modules/fs.realpath/package.json create mode 100644 node_modules/function-bind/.editorconfig create mode 100644 node_modules/function-bind/.eslintrc create mode 100644 node_modules/function-bind/.jscs.json create mode 100644 node_modules/function-bind/.npmignore create mode 100644 node_modules/function-bind/.travis.yml create mode 100644 node_modules/function-bind/LICENSE create mode 100644 node_modules/function-bind/README.md create mode 100644 node_modules/function-bind/implementation.js create mode 100644 node_modules/function-bind/index.js create mode 100644 node_modules/function-bind/package.json create mode 100644 node_modules/function-bind/test/.eslintrc create mode 100644 node_modules/function-bind/test/index.js create mode 100644 node_modules/function.prototype.name/.editorconfig create mode 100644 node_modules/function.prototype.name/.eslintignore create mode 100644 node_modules/function.prototype.name/.eslintrc create mode 100644 node_modules/function.prototype.name/.github/FUNDING.yml create mode 100644 node_modules/function.prototype.name/.nycrc create mode 100644 node_modules/function.prototype.name/CHANGELOG.md create mode 100644 node_modules/function.prototype.name/LICENSE create mode 100644 node_modules/function.prototype.name/README.md create mode 100644 node_modules/function.prototype.name/auto.js create mode 100644 node_modules/function.prototype.name/helpers/functionsHaveNames.js create mode 100644 node_modules/function.prototype.name/implementation.js create mode 100644 node_modules/function.prototype.name/index.js create mode 100644 node_modules/function.prototype.name/package.json create mode 100644 node_modules/function.prototype.name/polyfill.js create mode 100644 node_modules/function.prototype.name/shim.js create mode 100644 node_modules/function.prototype.name/test/implementation.js create mode 100644 node_modules/function.prototype.name/test/index.js create mode 100644 node_modules/function.prototype.name/test/shimmed.js create mode 100644 node_modules/function.prototype.name/test/tests.js create mode 100644 node_modules/function.prototype.name/test/uglified.js create mode 100644 node_modules/functions-have-names/.editorconfig create mode 100644 node_modules/functions-have-names/.eslintrc create mode 100644 node_modules/functions-have-names/.github/FUNDING.yml create mode 100644 node_modules/functions-have-names/.nycrc create mode 100644 node_modules/functions-have-names/CHANGELOG.md create mode 100644 node_modules/functions-have-names/LICENSE create mode 100644 node_modules/functions-have-names/README.md create mode 100644 node_modules/functions-have-names/index.js create mode 100644 node_modules/functions-have-names/package.json create mode 100644 node_modules/functions-have-names/test/index.js create mode 100644 node_modules/get-intrinsic/.eslintrc create mode 100644 node_modules/get-intrinsic/.github/FUNDING.yml create mode 100644 node_modules/get-intrinsic/.nycrc create mode 100644 node_modules/get-intrinsic/CHANGELOG.md create mode 100644 node_modules/get-intrinsic/LICENSE create mode 100644 node_modules/get-intrinsic/README.md create mode 100644 node_modules/get-intrinsic/index.js create mode 100644 node_modules/get-intrinsic/package.json create mode 100644 node_modules/get-intrinsic/test/GetIntrinsic.js create mode 100644 node_modules/get-symbol-description/.eslintignore create mode 100644 node_modules/get-symbol-description/.eslintrc create mode 100644 node_modules/get-symbol-description/.github/FUNDING.yml create mode 100644 node_modules/get-symbol-description/.nycrc create mode 100644 node_modules/get-symbol-description/CHANGELOG.md create mode 100644 node_modules/get-symbol-description/LICENSE create mode 100644 node_modules/get-symbol-description/README.md create mode 100644 node_modules/get-symbol-description/getInferredName.js create mode 100644 node_modules/get-symbol-description/index.js create mode 100644 node_modules/get-symbol-description/package.json create mode 100644 node_modules/get-symbol-description/test/index.js create mode 100644 node_modules/glob-parent/LICENSE create mode 100644 node_modules/glob-parent/README.md create mode 100644 node_modules/glob-parent/index.js create mode 100644 node_modules/glob-parent/package.json create mode 100644 node_modules/glob/LICENSE create mode 100644 node_modules/glob/README.md create mode 100644 node_modules/glob/common.js create mode 100644 node_modules/glob/glob.js create mode 100644 node_modules/glob/package.json create mode 100644 node_modules/glob/sync.js create mode 100644 node_modules/globals/globals.json create mode 100644 node_modules/globals/index.d.ts create mode 100644 node_modules/globals/index.js create mode 100644 node_modules/globals/license create mode 100644 node_modules/globals/package.json create mode 100644 node_modules/globals/readme.md create mode 100644 node_modules/globby/gitignore.js create mode 100644 node_modules/globby/index.d.ts create mode 100644 node_modules/globby/index.js create mode 100644 node_modules/globby/license create mode 100644 node_modules/globby/package.json create mode 100644 node_modules/globby/readme.md create mode 100644 node_modules/globby/stream-utils.js create mode 100644 node_modules/grapheme-splitter/LICENSE create mode 100644 node_modules/grapheme-splitter/README.md create mode 100644 node_modules/grapheme-splitter/index.d.ts create mode 100644 node_modules/grapheme-splitter/index.js create mode 100644 node_modules/grapheme-splitter/package.json create mode 100644 node_modules/grapheme-splitter/tests/GraphemeBreakTest.txt create mode 100644 node_modules/grapheme-splitter/tests/grapheme_splitter_tests.js create mode 100644 node_modules/has-bigints/.eslintrc create mode 100644 node_modules/has-bigints/.github/FUNDING.yml create mode 100644 node_modules/has-bigints/.nycrc create mode 100644 node_modules/has-bigints/CHANGELOG.md create mode 100644 node_modules/has-bigints/LICENSE create mode 100644 node_modules/has-bigints/README.md create mode 100644 node_modules/has-bigints/index.js create mode 100644 node_modules/has-bigints/package.json create mode 100644 node_modules/has-bigints/test/index.js create mode 100644 node_modules/has-flag/index.d.ts create mode 100644 node_modules/has-flag/index.js create mode 100644 node_modules/has-flag/license create mode 100644 node_modules/has-flag/package.json create mode 100644 node_modules/has-flag/readme.md create mode 100644 node_modules/has-property-descriptors/.eslintrc create mode 100644 node_modules/has-property-descriptors/.github/FUNDING.yml create mode 100644 node_modules/has-property-descriptors/.nycrc create mode 100644 node_modules/has-property-descriptors/CHANGELOG.md create mode 100644 node_modules/has-property-descriptors/LICENSE create mode 100644 node_modules/has-property-descriptors/README.md create mode 100644 node_modules/has-property-descriptors/index.js create mode 100644 node_modules/has-property-descriptors/package.json create mode 100644 node_modules/has-property-descriptors/test/index.js create mode 100644 node_modules/has-symbols/.eslintrc create mode 100644 node_modules/has-symbols/.github/FUNDING.yml create mode 100644 node_modules/has-symbols/.nycrc create mode 100644 node_modules/has-symbols/CHANGELOG.md create mode 100644 node_modules/has-symbols/LICENSE create mode 100644 node_modules/has-symbols/README.md create mode 100644 node_modules/has-symbols/index.js create mode 100644 node_modules/has-symbols/package.json create mode 100644 node_modules/has-symbols/shams.js create mode 100644 node_modules/has-symbols/test/index.js create mode 100644 node_modules/has-symbols/test/shams/core-js.js create mode 100644 node_modules/has-symbols/test/shams/get-own-property-symbols.js create mode 100644 node_modules/has-symbols/test/tests.js create mode 100644 node_modules/has-tostringtag/.eslintrc create mode 100644 node_modules/has-tostringtag/.github/FUNDING.yml create mode 100644 node_modules/has-tostringtag/CHANGELOG.md create mode 100644 node_modules/has-tostringtag/LICENSE create mode 100644 node_modules/has-tostringtag/README.md create mode 100644 node_modules/has-tostringtag/index.js create mode 100644 node_modules/has-tostringtag/package.json create mode 100644 node_modules/has-tostringtag/shams.js create mode 100644 node_modules/has-tostringtag/test/index.js create mode 100644 node_modules/has-tostringtag/test/shams/core-js.js create mode 100644 node_modules/has-tostringtag/test/shams/get-own-property-symbols.js create mode 100644 node_modules/has-tostringtag/test/tests.js create mode 100644 node_modules/has/LICENSE-MIT create mode 100644 node_modules/has/README.md create mode 100644 node_modules/has/package.json create mode 100644 node_modules/has/src/index.js create mode 100644 node_modules/has/test/index.js create mode 100644 node_modules/ignore/LICENSE-MIT create mode 100644 node_modules/ignore/README.md create mode 100644 node_modules/ignore/index.d.ts create mode 100644 node_modules/ignore/index.js create mode 100644 node_modules/ignore/legacy.js create mode 100644 node_modules/ignore/package.json create mode 100644 node_modules/import-fresh/index.d.ts create mode 100644 node_modules/import-fresh/index.js create mode 100644 node_modules/import-fresh/license create mode 100644 node_modules/import-fresh/package.json create mode 100644 node_modules/import-fresh/readme.md create mode 100644 node_modules/imurmurhash/README.md create mode 100644 node_modules/imurmurhash/imurmurhash.js create mode 100644 node_modules/imurmurhash/imurmurhash.min.js create mode 100644 node_modules/imurmurhash/package.json create mode 100644 node_modules/inflight/LICENSE create mode 100644 node_modules/inflight/README.md create mode 100644 node_modules/inflight/inflight.js create mode 100644 node_modules/inflight/package.json create mode 100644 node_modules/inherits/LICENSE create mode 100644 node_modules/inherits/README.md create mode 100644 node_modules/inherits/inherits.js create mode 100644 node_modules/inherits/inherits_browser.js create mode 100644 node_modules/inherits/package.json create mode 100644 node_modules/internal-slot/.editorconfig create mode 100644 node_modules/internal-slot/.eslintignore create mode 100644 node_modules/internal-slot/.eslintrc create mode 100644 node_modules/internal-slot/.github/FUNDING.yml create mode 100644 node_modules/internal-slot/.nycrc create mode 100644 node_modules/internal-slot/CHANGELOG.md create mode 100644 node_modules/internal-slot/LICENSE create mode 100644 node_modules/internal-slot/README.md create mode 100644 node_modules/internal-slot/index.js create mode 100644 node_modules/internal-slot/package.json create mode 100644 node_modules/internal-slot/test/index.js create mode 100644 node_modules/is-bigint/.eslintignore create mode 100644 node_modules/is-bigint/.eslintrc create mode 100644 node_modules/is-bigint/.github/FUNDING.yml create mode 100644 node_modules/is-bigint/.nycrc create mode 100644 node_modules/is-bigint/CHANGELOG.md create mode 100644 node_modules/is-bigint/LICENSE create mode 100644 node_modules/is-bigint/README.md create mode 100644 node_modules/is-bigint/index.js create mode 100644 node_modules/is-bigint/package.json create mode 100644 node_modules/is-bigint/test/index.js create mode 100644 node_modules/is-boolean-object/.editorconfig create mode 100644 node_modules/is-boolean-object/.eslintignore create mode 100644 node_modules/is-boolean-object/.eslintrc create mode 100644 node_modules/is-boolean-object/.github/FUNDING.yml create mode 100644 node_modules/is-boolean-object/.nycrc create mode 100644 node_modules/is-boolean-object/CHANGELOG.md create mode 100644 node_modules/is-boolean-object/LICENSE create mode 100644 node_modules/is-boolean-object/README.md create mode 100644 node_modules/is-boolean-object/index.js create mode 100644 node_modules/is-boolean-object/package.json create mode 100644 node_modules/is-boolean-object/test/index.js create mode 100644 node_modules/is-callable/.editorconfig create mode 100644 node_modules/is-callable/.eslintrc create mode 100644 node_modules/is-callable/.github/FUNDING.yml create mode 100644 node_modules/is-callable/.nycrc create mode 100644 node_modules/is-callable/CHANGELOG.md create mode 100644 node_modules/is-callable/LICENSE create mode 100644 node_modules/is-callable/README.md create mode 100644 node_modules/is-callable/index.js create mode 100644 node_modules/is-callable/package.json create mode 100644 node_modules/is-callable/test/index.js create mode 100644 node_modules/is-core-module/.eslintrc create mode 100644 node_modules/is-core-module/.nycrc create mode 100644 node_modules/is-core-module/CHANGELOG.md create mode 100644 node_modules/is-core-module/LICENSE create mode 100644 node_modules/is-core-module/README.md create mode 100644 node_modules/is-core-module/core.json create mode 100644 node_modules/is-core-module/index.js create mode 100644 node_modules/is-core-module/package.json create mode 100644 node_modules/is-core-module/test/index.js create mode 100644 node_modules/is-date-object/.editorconfig create mode 100644 node_modules/is-date-object/.eslintignore create mode 100644 node_modules/is-date-object/.eslintrc create mode 100644 node_modules/is-date-object/.github/FUNDING.yml create mode 100644 node_modules/is-date-object/.nycrc create mode 100644 node_modules/is-date-object/CHANGELOG.md create mode 100644 node_modules/is-date-object/LICENSE create mode 100644 node_modules/is-date-object/README.md create mode 100644 node_modules/is-date-object/index.js create mode 100644 node_modules/is-date-object/package.json create mode 100644 node_modules/is-date-object/test/index.js create mode 100644 node_modules/is-extglob/LICENSE create mode 100644 node_modules/is-extglob/README.md create mode 100644 node_modules/is-extglob/index.js create mode 100644 node_modules/is-extglob/package.json create mode 100644 node_modules/is-glob/LICENSE create mode 100644 node_modules/is-glob/README.md create mode 100644 node_modules/is-glob/index.js create mode 100644 node_modules/is-glob/package.json create mode 100644 node_modules/is-negative-zero/.editorconfig create mode 100644 node_modules/is-negative-zero/.eslintignore create mode 100644 node_modules/is-negative-zero/.eslintrc create mode 100644 node_modules/is-negative-zero/.github/FUNDING.yml create mode 100644 node_modules/is-negative-zero/.nycrc create mode 100644 node_modules/is-negative-zero/CHANGELOG.md create mode 100644 node_modules/is-negative-zero/LICENSE create mode 100644 node_modules/is-negative-zero/README.md create mode 100644 node_modules/is-negative-zero/index.js create mode 100644 node_modules/is-negative-zero/package.json create mode 100644 node_modules/is-negative-zero/test/index.js create mode 100644 node_modules/is-number-object/.editorconfig create mode 100644 node_modules/is-number-object/.eslintrc create mode 100644 node_modules/is-number-object/.github/FUNDING.yml create mode 100644 node_modules/is-number-object/.nycrc create mode 100644 node_modules/is-number-object/CHANGELOG.md create mode 100644 node_modules/is-number-object/LICENSE create mode 100644 node_modules/is-number-object/README.md create mode 100644 node_modules/is-number-object/index.js create mode 100644 node_modules/is-number-object/package.json create mode 100644 node_modules/is-number-object/test/index.js create mode 100644 node_modules/is-number/LICENSE create mode 100644 node_modules/is-number/README.md create mode 100644 node_modules/is-number/index.js create mode 100644 node_modules/is-number/package.json create mode 100644 node_modules/is-regex/.editorconfig create mode 100644 node_modules/is-regex/.eslintignore create mode 100644 node_modules/is-regex/.eslintrc create mode 100644 node_modules/is-regex/.nycrc create mode 100644 node_modules/is-regex/CHANGELOG.md create mode 100644 node_modules/is-regex/LICENSE create mode 100644 node_modules/is-regex/README.md create mode 100644 node_modules/is-regex/index.js create mode 100644 node_modules/is-regex/package.json create mode 100644 node_modules/is-regex/test/index.js create mode 100644 node_modules/is-shared-array-buffer/.eslintignore create mode 100644 node_modules/is-shared-array-buffer/.eslintrc create mode 100644 node_modules/is-shared-array-buffer/.github/FUNDING.yml create mode 100644 node_modules/is-shared-array-buffer/.nycrc create mode 100644 node_modules/is-shared-array-buffer/CHANGELOG.md create mode 100644 node_modules/is-shared-array-buffer/LICENSE create mode 100644 node_modules/is-shared-array-buffer/README.md create mode 100644 node_modules/is-shared-array-buffer/index.js create mode 100644 node_modules/is-shared-array-buffer/package.json create mode 100644 node_modules/is-shared-array-buffer/test/index.js create mode 100644 node_modules/is-string/.eslintignore create mode 100644 node_modules/is-string/.eslintrc create mode 100644 node_modules/is-string/.github/FUNDING.yml create mode 100644 node_modules/is-string/.nycrc create mode 100644 node_modules/is-string/CHANGELOG.md create mode 100644 node_modules/is-string/LICENSE create mode 100644 node_modules/is-string/README.md create mode 100644 node_modules/is-string/index.js create mode 100644 node_modules/is-string/package.json create mode 100644 node_modules/is-string/test/index.js create mode 100644 node_modules/is-symbol/.editorconfig create mode 100644 node_modules/is-symbol/.eslintignore create mode 100644 node_modules/is-symbol/.eslintrc create mode 100644 node_modules/is-symbol/.github/FUNDING.yml create mode 100644 node_modules/is-symbol/.nycrc create mode 100644 node_modules/is-symbol/CHANGELOG.md create mode 100644 node_modules/is-symbol/LICENSE create mode 100644 node_modules/is-symbol/README.md create mode 100644 node_modules/is-symbol/index.js create mode 100644 node_modules/is-symbol/package.json create mode 100644 node_modules/is-symbol/test/index.js create mode 100644 node_modules/is-weakref/.eslintignore create mode 100644 node_modules/is-weakref/.eslintrc create mode 100644 node_modules/is-weakref/.github/FUNDING.yml create mode 100644 node_modules/is-weakref/.nycrc create mode 100644 node_modules/is-weakref/CHANGELOG.md create mode 100644 node_modules/is-weakref/LICENSE create mode 100644 node_modules/is-weakref/README.md create mode 100644 node_modules/is-weakref/index.js create mode 100644 node_modules/is-weakref/package.json create mode 100644 node_modules/is-weakref/test/index.js create mode 100644 node_modules/isexe/.npmignore create mode 100644 node_modules/isexe/LICENSE create mode 100644 node_modules/isexe/README.md create mode 100644 node_modules/isexe/index.js create mode 100644 node_modules/isexe/mode.js create mode 100644 node_modules/isexe/package.json create mode 100644 node_modules/isexe/test/basic.js create mode 100644 node_modules/isexe/windows.js create mode 100644 node_modules/js-sdsl/CHANGELOG.md create mode 100644 node_modules/js-sdsl/LICENSE create mode 100644 node_modules/js-sdsl/README.md create mode 100644 node_modules/js-sdsl/README.zh-CN.md create mode 100644 node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.js create mode 100644 node_modules/js-sdsl/dist/cjs/index.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/index.js create mode 100644 node_modules/js-sdsl/dist/esm/container/ContainerBase/index.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/ContainerBase/index.js create mode 100644 node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.js create mode 100644 node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.js create mode 100644 node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.js create mode 100644 node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.js create mode 100644 node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.js create mode 100644 node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.js create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.js create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.js create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.js create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.js create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.js create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.js create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.js create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.js create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.js create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.js create mode 100644 node_modules/js-sdsl/dist/esm/index.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/index.js create mode 100644 node_modules/js-sdsl/dist/umd/js-sdsl.js create mode 100644 node_modules/js-sdsl/dist/umd/js-sdsl.min.js create mode 100644 node_modules/js-sdsl/dist/umd/js-sdsl.min.js.map create mode 100644 node_modules/js-sdsl/package.json create mode 100644 node_modules/js-tokens/CHANGELOG.md create mode 100644 node_modules/js-tokens/LICENSE create mode 100644 node_modules/js-tokens/README.md create mode 100644 node_modules/js-tokens/index.js create mode 100644 node_modules/js-tokens/package.json create mode 100644 node_modules/js-yaml/CHANGELOG.md create mode 100644 node_modules/js-yaml/LICENSE create mode 100644 node_modules/js-yaml/README.md create mode 100755 node_modules/js-yaml/bin/js-yaml.js create mode 100644 node_modules/js-yaml/dist/js-yaml.js create mode 100644 node_modules/js-yaml/dist/js-yaml.min.js create mode 100644 node_modules/js-yaml/dist/js-yaml.mjs create mode 100644 node_modules/js-yaml/index.js create mode 100644 node_modules/js-yaml/lib/common.js create mode 100644 node_modules/js-yaml/lib/dumper.js create mode 100644 node_modules/js-yaml/lib/exception.js create mode 100644 node_modules/js-yaml/lib/loader.js create mode 100644 node_modules/js-yaml/lib/schema.js create mode 100644 node_modules/js-yaml/lib/schema/core.js create mode 100644 node_modules/js-yaml/lib/schema/default.js create mode 100644 node_modules/js-yaml/lib/schema/failsafe.js create mode 100644 node_modules/js-yaml/lib/schema/json.js create mode 100644 node_modules/js-yaml/lib/snippet.js create mode 100644 node_modules/js-yaml/lib/type.js create mode 100644 node_modules/js-yaml/lib/type/binary.js create mode 100644 node_modules/js-yaml/lib/type/bool.js create mode 100644 node_modules/js-yaml/lib/type/float.js create mode 100644 node_modules/js-yaml/lib/type/int.js create mode 100644 node_modules/js-yaml/lib/type/map.js create mode 100644 node_modules/js-yaml/lib/type/merge.js create mode 100644 node_modules/js-yaml/lib/type/null.js create mode 100644 node_modules/js-yaml/lib/type/omap.js create mode 100644 node_modules/js-yaml/lib/type/pairs.js create mode 100644 node_modules/js-yaml/lib/type/seq.js create mode 100644 node_modules/js-yaml/lib/type/set.js create mode 100644 node_modules/js-yaml/lib/type/str.js create mode 100644 node_modules/js-yaml/lib/type/timestamp.js create mode 100644 node_modules/js-yaml/package.json create mode 100644 node_modules/json-schema-traverse/.eslintrc.yml create mode 100644 node_modules/json-schema-traverse/.travis.yml create mode 100644 node_modules/json-schema-traverse/LICENSE create mode 100644 node_modules/json-schema-traverse/README.md create mode 100644 node_modules/json-schema-traverse/index.js create mode 100644 node_modules/json-schema-traverse/package.json create mode 100644 node_modules/json-schema-traverse/spec/.eslintrc.yml create mode 100644 node_modules/json-schema-traverse/spec/fixtures/schema.js create mode 100644 node_modules/json-schema-traverse/spec/index.spec.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/.npmignore create mode 100644 node_modules/json-stable-stringify-without-jsonify/.travis.yml create mode 100644 node_modules/json-stable-stringify-without-jsonify/LICENSE create mode 100644 node_modules/json-stable-stringify-without-jsonify/example/key_cmp.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/example/nested.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/example/str.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/example/value_cmp.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/index.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/package.json create mode 100644 node_modules/json-stable-stringify-without-jsonify/readme.markdown create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/cmp.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/nested.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/replacer.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/space.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/str.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/to-json.js create mode 100644 node_modules/jsx-ast-utils/.babelrc create mode 100644 node_modules/jsx-ast-utils/.eslintignore create mode 100644 node_modules/jsx-ast-utils/.eslintrc create mode 100644 node_modules/jsx-ast-utils/.github/FUNDING.yml create mode 100644 node_modules/jsx-ast-utils/CHANGELOG.md create mode 100644 node_modules/jsx-ast-utils/LICENSE.md create mode 100644 node_modules/jsx-ast-utils/README.md create mode 100644 node_modules/jsx-ast-utils/__tests__/helper.js create mode 100644 node_modules/jsx-ast-utils/__tests__/src/elementType-test.js create mode 100644 node_modules/jsx-ast-utils/__tests__/src/eventHandlers-test.js create mode 100644 node_modules/jsx-ast-utils/__tests__/src/getProp-parser-test.js create mode 100644 node_modules/jsx-ast-utils/__tests__/src/getProp-test.js create mode 100644 node_modules/jsx-ast-utils/__tests__/src/getPropLiteralValue-babelparser-test.js create mode 100644 node_modules/jsx-ast-utils/__tests__/src/getPropLiteralValue-flowparser-test.js create mode 100644 node_modules/jsx-ast-utils/__tests__/src/getPropValue-babelparser-test.js create mode 100644 node_modules/jsx-ast-utils/__tests__/src/getPropValue-flowparser-test.js create mode 100644 node_modules/jsx-ast-utils/__tests__/src/hasProp-test.js create mode 100644 node_modules/jsx-ast-utils/__tests__/src/index-test.js create mode 100644 node_modules/jsx-ast-utils/__tests__/src/propName-test.js create mode 100644 node_modules/jsx-ast-utils/elementType.js create mode 100644 node_modules/jsx-ast-utils/eventHandlers.js create mode 100644 node_modules/jsx-ast-utils/eventHandlersByType.js create mode 100644 node_modules/jsx-ast-utils/getLiteralPropValue.js create mode 100644 node_modules/jsx-ast-utils/getProp.js create mode 100644 node_modules/jsx-ast-utils/getPropValue.js create mode 100644 node_modules/jsx-ast-utils/hasAnyProp.js create mode 100644 node_modules/jsx-ast-utils/hasEveryProp.js create mode 100644 node_modules/jsx-ast-utils/hasProp.js create mode 100644 node_modules/jsx-ast-utils/lib/elementType.js create mode 100644 node_modules/jsx-ast-utils/lib/eventHandlers.js create mode 100644 node_modules/jsx-ast-utils/lib/getProp.js create mode 100644 node_modules/jsx-ast-utils/lib/getPropValue.js create mode 100644 node_modules/jsx-ast-utils/lib/hasProp.js create mode 100644 node_modules/jsx-ast-utils/lib/index.js create mode 100644 node_modules/jsx-ast-utils/lib/propName.js create mode 100644 node_modules/jsx-ast-utils/lib/values/JSXElement.js create mode 100644 node_modules/jsx-ast-utils/lib/values/JSXFragment.js create mode 100644 node_modules/jsx-ast-utils/lib/values/JSXText.js create mode 100644 node_modules/jsx-ast-utils/lib/values/Literal.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/ArrayExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/AssignmentExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/BinaryExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/BindExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/CallExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/ChainExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/ConditionalExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/FunctionExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/Identifier.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/LogicalExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/MemberExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/NewExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/ObjectExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/OptionalCallExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/OptionalMemberExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/SequenceExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/SpreadElement.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/TSNonNullExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/TaggedTemplateExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/TemplateLiteral.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/ThisExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/TypeCastExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/UnaryExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/UpdateExpression.js create mode 100644 node_modules/jsx-ast-utils/lib/values/expressions/index.js create mode 100644 node_modules/jsx-ast-utils/lib/values/index.js create mode 100644 node_modules/jsx-ast-utils/package.json create mode 100644 node_modules/jsx-ast-utils/propName.js create mode 100644 node_modules/jsx-ast-utils/src/elementType.js create mode 100644 node_modules/jsx-ast-utils/src/eventHandlers.js create mode 100644 node_modules/jsx-ast-utils/src/getProp.js create mode 100644 node_modules/jsx-ast-utils/src/getPropValue.js create mode 100644 node_modules/jsx-ast-utils/src/hasProp.js create mode 100644 node_modules/jsx-ast-utils/src/index.js create mode 100644 node_modules/jsx-ast-utils/src/propName.js create mode 100644 node_modules/jsx-ast-utils/src/values/JSXElement.js create mode 100644 node_modules/jsx-ast-utils/src/values/JSXFragment.js create mode 100644 node_modules/jsx-ast-utils/src/values/JSXText.js create mode 100644 node_modules/jsx-ast-utils/src/values/Literal.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/ArrayExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/AssignmentExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/BinaryExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/BindExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/CallExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/ChainExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/ConditionalExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/FunctionExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/Identifier.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/LogicalExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/MemberExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/NewExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/ObjectExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/OptionalCallExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/OptionalMemberExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/SequenceExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/SpreadElement.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/TSNonNullExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/TaggedTemplateExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/TemplateLiteral.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/ThisExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/TypeCastExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/UnaryExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/UpdateExpression.js create mode 100644 node_modules/jsx-ast-utils/src/values/expressions/index.js create mode 100644 node_modules/jsx-ast-utils/src/values/index.js create mode 100644 node_modules/levn/LICENSE create mode 100644 node_modules/levn/README.md create mode 100644 node_modules/levn/lib/cast.js create mode 100644 node_modules/levn/lib/index.js create mode 100644 node_modules/levn/lib/parse-string.js create mode 100644 node_modules/levn/package.json create mode 100644 node_modules/locate-path/index.d.ts create mode 100644 node_modules/locate-path/index.js create mode 100644 node_modules/locate-path/license create mode 100644 node_modules/locate-path/package.json create mode 100644 node_modules/locate-path/readme.md create mode 100644 node_modules/lodash.merge/LICENSE create mode 100644 node_modules/lodash.merge/README.md create mode 100644 node_modules/lodash.merge/index.js create mode 100644 node_modules/lodash.merge/package.json create mode 100644 node_modules/loose-envify/LICENSE create mode 100644 node_modules/loose-envify/README.md create mode 100755 node_modules/loose-envify/cli.js create mode 100644 node_modules/loose-envify/custom.js create mode 100644 node_modules/loose-envify/index.js create mode 100644 node_modules/loose-envify/loose-envify.js create mode 100644 node_modules/loose-envify/package.json create mode 100644 node_modules/loose-envify/replace.js create mode 100644 node_modules/merge2/LICENSE create mode 100644 node_modules/merge2/README.md create mode 100644 node_modules/merge2/index.js create mode 100644 node_modules/merge2/package.json create mode 100755 node_modules/micromatch/LICENSE create mode 100644 node_modules/micromatch/README.md create mode 100644 node_modules/micromatch/index.js create mode 100644 node_modules/micromatch/package.json create mode 100644 node_modules/minimatch/LICENSE create mode 100644 node_modules/minimatch/README.md create mode 100644 node_modules/minimatch/minimatch.js create mode 100644 node_modules/minimatch/package.json create mode 100644 node_modules/ms/index.js create mode 100644 node_modules/ms/license.md create mode 100644 node_modules/ms/package.json create mode 100644 node_modules/ms/readme.md create mode 100644 node_modules/natural-compare/README.md create mode 100644 node_modules/natural-compare/index.js create mode 100644 node_modules/natural-compare/package.json create mode 100644 node_modules/object-assign/index.js create mode 100644 node_modules/object-assign/license create mode 100644 node_modules/object-assign/package.json create mode 100644 node_modules/object-assign/readme.md create mode 100644 node_modules/object-inspect/.eslintrc create mode 100644 node_modules/object-inspect/.github/FUNDING.yml create mode 100644 node_modules/object-inspect/.nycrc create mode 100644 node_modules/object-inspect/CHANGELOG.md create mode 100644 node_modules/object-inspect/LICENSE create mode 100644 node_modules/object-inspect/example/all.js create mode 100644 node_modules/object-inspect/example/circular.js create mode 100644 node_modules/object-inspect/example/fn.js create mode 100644 node_modules/object-inspect/example/inspect.js create mode 100644 node_modules/object-inspect/index.js create mode 100644 node_modules/object-inspect/package-support.json create mode 100644 node_modules/object-inspect/package.json create mode 100644 node_modules/object-inspect/readme.markdown create mode 100644 node_modules/object-inspect/test-core-js.js create mode 100644 node_modules/object-inspect/test/bigint.js create mode 100644 node_modules/object-inspect/test/browser/dom.js create mode 100644 node_modules/object-inspect/test/circular.js create mode 100644 node_modules/object-inspect/test/deep.js create mode 100644 node_modules/object-inspect/test/element.js create mode 100644 node_modules/object-inspect/test/err.js create mode 100644 node_modules/object-inspect/test/fakes.js create mode 100644 node_modules/object-inspect/test/fn.js create mode 100644 node_modules/object-inspect/test/has.js create mode 100644 node_modules/object-inspect/test/holes.js create mode 100644 node_modules/object-inspect/test/indent-option.js create mode 100644 node_modules/object-inspect/test/inspect.js create mode 100644 node_modules/object-inspect/test/lowbyte.js create mode 100644 node_modules/object-inspect/test/number.js create mode 100644 node_modules/object-inspect/test/quoteStyle.js create mode 100644 node_modules/object-inspect/test/toStringTag.js create mode 100644 node_modules/object-inspect/test/undef.js create mode 100644 node_modules/object-inspect/test/values.js create mode 100644 node_modules/object-inspect/util.inspect.js create mode 100644 node_modules/object-keys/.editorconfig create mode 100644 node_modules/object-keys/.eslintrc create mode 100644 node_modules/object-keys/.travis.yml create mode 100644 node_modules/object-keys/CHANGELOG.md create mode 100644 node_modules/object-keys/LICENSE create mode 100644 node_modules/object-keys/README.md create mode 100644 node_modules/object-keys/implementation.js create mode 100644 node_modules/object-keys/index.js create mode 100644 node_modules/object-keys/isArguments.js create mode 100644 node_modules/object-keys/package.json create mode 100644 node_modules/object-keys/test/index.js create mode 100644 node_modules/object.assign/.editorconfig create mode 100644 node_modules/object.assign/.eslintrc create mode 100644 node_modules/object.assign/.github/FUNDING.yml create mode 100644 node_modules/object.assign/.nycrc create mode 100644 node_modules/object.assign/CHANGELOG.md create mode 100644 node_modules/object.assign/LICENSE create mode 100644 node_modules/object.assign/README.md create mode 100644 node_modules/object.assign/auto.js create mode 100644 node_modules/object.assign/dist/browser.js create mode 100644 node_modules/object.assign/hasSymbols.js create mode 100644 node_modules/object.assign/implementation.js create mode 100644 node_modules/object.assign/index.js create mode 100644 node_modules/object.assign/package.json create mode 100644 node_modules/object.assign/polyfill.js create mode 100644 node_modules/object.assign/shim.js create mode 100644 node_modules/object.assign/test.html create mode 100644 node_modules/object.assign/test/implementation.js create mode 100644 node_modules/object.assign/test/index.js create mode 100644 node_modules/object.assign/test/native.js create mode 100644 node_modules/object.assign/test/ses-compat.js create mode 100644 node_modules/object.assign/test/shimmed.js create mode 100644 node_modules/object.assign/test/tests.js create mode 100644 node_modules/object.entries/.editorconfig create mode 100644 node_modules/object.entries/.eslintignore create mode 100644 node_modules/object.entries/.eslintrc create mode 100644 node_modules/object.entries/.nycrc create mode 100644 node_modules/object.entries/CHANGELOG.md create mode 100644 node_modules/object.entries/LICENSE create mode 100644 node_modules/object.entries/README.md create mode 100644 node_modules/object.entries/auto.js create mode 100644 node_modules/object.entries/implementation.js create mode 100644 node_modules/object.entries/index.js create mode 100644 node_modules/object.entries/package.json create mode 100644 node_modules/object.entries/polyfill.js create mode 100644 node_modules/object.entries/shim.js create mode 100644 node_modules/object.entries/test/.eslintrc create mode 100644 node_modules/object.entries/test/implementation.js create mode 100644 node_modules/object.entries/test/index.js create mode 100644 node_modules/object.entries/test/shimmed.js create mode 100644 node_modules/object.entries/test/tests.js create mode 100644 node_modules/object.fromentries/.editorconfig create mode 100644 node_modules/object.fromentries/.eslintignore create mode 100644 node_modules/object.fromentries/.eslintrc create mode 100644 node_modules/object.fromentries/.nycrc create mode 100644 node_modules/object.fromentries/CHANGELOG.md create mode 100644 node_modules/object.fromentries/LICENSE create mode 100644 node_modules/object.fromentries/README.md create mode 100644 node_modules/object.fromentries/auto.js create mode 100644 node_modules/object.fromentries/implementation.js create mode 100644 node_modules/object.fromentries/index.js create mode 100644 node_modules/object.fromentries/package.json create mode 100644 node_modules/object.fromentries/polyfill.js create mode 100644 node_modules/object.fromentries/shim.js create mode 100644 node_modules/object.fromentries/test/implementation.js create mode 100644 node_modules/object.fromentries/test/index.js create mode 100644 node_modules/object.fromentries/test/shimmed.js create mode 100644 node_modules/object.fromentries/test/tests.js create mode 100644 node_modules/object.hasown/.eslintrc create mode 100644 node_modules/object.hasown/.github/FUNDING.yml create mode 100644 node_modules/object.hasown/.nycrc create mode 100644 node_modules/object.hasown/CHANGELOG.md create mode 100644 node_modules/object.hasown/LICENSE create mode 100644 node_modules/object.hasown/README.md create mode 100644 node_modules/object.hasown/auto.js create mode 100644 node_modules/object.hasown/implementation.js create mode 100644 node_modules/object.hasown/index.js create mode 100644 node_modules/object.hasown/index.mjs create mode 100644 node_modules/object.hasown/package.json create mode 100644 node_modules/object.hasown/polyfill.js create mode 100644 node_modules/object.hasown/shim.js create mode 100644 node_modules/object.hasown/test/implementation.js create mode 100644 node_modules/object.hasown/test/index.js create mode 100644 node_modules/object.hasown/test/index.mjs create mode 100644 node_modules/object.hasown/test/shimmed.js create mode 100644 node_modules/object.hasown/test/tests.js create mode 100644 node_modules/object.values/.editorconfig create mode 100644 node_modules/object.values/.eslintignore create mode 100644 node_modules/object.values/.eslintrc create mode 100644 node_modules/object.values/.nycrc create mode 100644 node_modules/object.values/CHANGELOG.md create mode 100644 node_modules/object.values/LICENSE create mode 100644 node_modules/object.values/README.md create mode 100644 node_modules/object.values/auto.js create mode 100644 node_modules/object.values/implementation.js create mode 100644 node_modules/object.values/index.js create mode 100644 node_modules/object.values/package.json create mode 100644 node_modules/object.values/polyfill.js create mode 100644 node_modules/object.values/shim.js create mode 100644 node_modules/object.values/test/.eslintrc create mode 100644 node_modules/object.values/test/implementation.js create mode 100644 node_modules/object.values/test/index.js create mode 100644 node_modules/object.values/test/shimmed.js create mode 100644 node_modules/object.values/test/tests.js create mode 100644 node_modules/once/LICENSE create mode 100644 node_modules/once/README.md create mode 100644 node_modules/once/once.js create mode 100644 node_modules/once/package.json create mode 100644 node_modules/optionator/CHANGELOG.md create mode 100644 node_modules/optionator/LICENSE create mode 100644 node_modules/optionator/README.md create mode 100644 node_modules/optionator/lib/help.js create mode 100644 node_modules/optionator/lib/index.js create mode 100644 node_modules/optionator/lib/util.js create mode 100644 node_modules/optionator/package.json create mode 100644 node_modules/p-limit/index.d.ts create mode 100644 node_modules/p-limit/index.js create mode 100644 node_modules/p-limit/license create mode 100644 node_modules/p-limit/package.json create mode 100644 node_modules/p-limit/readme.md create mode 100644 node_modules/p-locate/index.d.ts create mode 100644 node_modules/p-locate/index.js create mode 100644 node_modules/p-locate/license create mode 100644 node_modules/p-locate/package.json create mode 100644 node_modules/p-locate/readme.md create mode 100644 node_modules/parent-module/index.js create mode 100644 node_modules/parent-module/license create mode 100644 node_modules/parent-module/package.json create mode 100644 node_modules/parent-module/readme.md create mode 100644 node_modules/path-exists/index.d.ts create mode 100644 node_modules/path-exists/index.js create mode 100644 node_modules/path-exists/license create mode 100644 node_modules/path-exists/package.json create mode 100644 node_modules/path-exists/readme.md create mode 100644 node_modules/path-is-absolute/index.js create mode 100644 node_modules/path-is-absolute/license create mode 100644 node_modules/path-is-absolute/package.json create mode 100644 node_modules/path-is-absolute/readme.md create mode 100644 node_modules/path-key/index.d.ts create mode 100644 node_modules/path-key/index.js create mode 100644 node_modules/path-key/license create mode 100644 node_modules/path-key/package.json create mode 100644 node_modules/path-key/readme.md create mode 100644 node_modules/path-parse/LICENSE create mode 100644 node_modules/path-parse/README.md create mode 100644 node_modules/path-parse/index.js create mode 100644 node_modules/path-parse/package.json create mode 100644 node_modules/path-type/index.d.ts create mode 100644 node_modules/path-type/index.js create mode 100644 node_modules/path-type/license create mode 100644 node_modules/path-type/package.json create mode 100644 node_modules/path-type/readme.md create mode 100644 node_modules/picomatch/CHANGELOG.md create mode 100644 node_modules/picomatch/LICENSE create mode 100644 node_modules/picomatch/README.md create mode 100644 node_modules/picomatch/index.js create mode 100644 node_modules/picomatch/lib/constants.js create mode 100644 node_modules/picomatch/lib/parse.js create mode 100644 node_modules/picomatch/lib/picomatch.js create mode 100644 node_modules/picomatch/lib/scan.js create mode 100644 node_modules/picomatch/lib/utils.js create mode 100644 node_modules/picomatch/package.json create mode 100644 node_modules/prelude-ls/CHANGELOG.md create mode 100644 node_modules/prelude-ls/LICENSE create mode 100644 node_modules/prelude-ls/README.md create mode 100644 node_modules/prelude-ls/lib/Func.js create mode 100644 node_modules/prelude-ls/lib/List.js create mode 100644 node_modules/prelude-ls/lib/Num.js create mode 100644 node_modules/prelude-ls/lib/Obj.js create mode 100644 node_modules/prelude-ls/lib/Str.js create mode 100644 node_modules/prelude-ls/lib/index.js create mode 100644 node_modules/prelude-ls/package.json create mode 100644 node_modules/prop-types/LICENSE create mode 100644 node_modules/prop-types/README.md create mode 100644 node_modules/prop-types/checkPropTypes.js create mode 100644 node_modules/prop-types/factory.js create mode 100644 node_modules/prop-types/factoryWithThrowingShims.js create mode 100644 node_modules/prop-types/factoryWithTypeCheckers.js create mode 100644 node_modules/prop-types/index.js create mode 100644 node_modules/prop-types/lib/ReactPropTypesSecret.js create mode 100644 node_modules/prop-types/lib/has.js create mode 100644 node_modules/prop-types/package.json create mode 100644 node_modules/prop-types/prop-types.js create mode 100644 node_modules/prop-types/prop-types.min.js create mode 100644 node_modules/punycode/LICENSE-MIT.txt create mode 100644 node_modules/punycode/README.md create mode 100644 node_modules/punycode/package.json create mode 100644 node_modules/punycode/punycode.es6.js create mode 100644 node_modules/punycode/punycode.js create mode 100755 node_modules/queue-microtask/LICENSE create mode 100644 node_modules/queue-microtask/README.md create mode 100644 node_modules/queue-microtask/index.d.ts create mode 100644 node_modules/queue-microtask/index.js create mode 100644 node_modules/queue-microtask/package.json create mode 100644 node_modules/react-is/LICENSE create mode 100644 node_modules/react-is/README.md create mode 100644 node_modules/react-is/build-info.json create mode 100644 node_modules/react-is/cjs/react-is.development.js create mode 100644 node_modules/react-is/cjs/react-is.production.min.js create mode 100644 node_modules/react-is/index.js create mode 100644 node_modules/react-is/package.json create mode 100644 node_modules/react-is/umd/react-is.development.js create mode 100644 node_modules/react-is/umd/react-is.production.min.js create mode 100644 node_modules/regexp.prototype.flags/.editorconfig create mode 100644 node_modules/regexp.prototype.flags/.eslintrc create mode 100644 node_modules/regexp.prototype.flags/.nycrc create mode 100644 node_modules/regexp.prototype.flags/CHANGELOG.md create mode 100644 node_modules/regexp.prototype.flags/LICENSE create mode 100644 node_modules/regexp.prototype.flags/README.md create mode 100644 node_modules/regexp.prototype.flags/auto.js create mode 100644 node_modules/regexp.prototype.flags/implementation.js create mode 100644 node_modules/regexp.prototype.flags/index.js create mode 100644 node_modules/regexp.prototype.flags/package.json create mode 100644 node_modules/regexp.prototype.flags/polyfill.js create mode 100644 node_modules/regexp.prototype.flags/shim.js create mode 100644 node_modules/regexp.prototype.flags/test/implementation.js create mode 100644 node_modules/regexp.prototype.flags/test/index.js create mode 100644 node_modules/regexp.prototype.flags/test/shimmed.js create mode 100644 node_modules/regexp.prototype.flags/test/tests.js create mode 100644 node_modules/regexpp/LICENSE create mode 100644 node_modules/regexpp/README.md create mode 100644 node_modules/regexpp/index.d.ts create mode 100644 node_modules/regexpp/index.js create mode 100644 node_modules/regexpp/index.js.map create mode 100644 node_modules/regexpp/index.mjs create mode 100644 node_modules/regexpp/index.mjs.map create mode 100644 node_modules/regexpp/package.json create mode 100644 node_modules/resolve-from/index.js create mode 100644 node_modules/resolve-from/license create mode 100644 node_modules/resolve-from/package.json create mode 100644 node_modules/resolve-from/readme.md create mode 100644 node_modules/resolve/.editorconfig create mode 100644 node_modules/resolve/.eslintrc create mode 100644 node_modules/resolve/.github/FUNDING.yml create mode 100644 node_modules/resolve/LICENSE create mode 100644 node_modules/resolve/SECURITY.md create mode 100644 node_modules/resolve/async.js create mode 100755 node_modules/resolve/bin/resolve create mode 100644 node_modules/resolve/example/async.js create mode 100644 node_modules/resolve/example/sync.js create mode 100644 node_modules/resolve/index.js create mode 100644 node_modules/resolve/index.mjs create mode 100644 node_modules/resolve/lib/async.js create mode 100644 node_modules/resolve/lib/caller.js create mode 100644 node_modules/resolve/lib/homedir.js create mode 100644 node_modules/resolve/lib/node-modules-paths.js create mode 100644 node_modules/resolve/lib/normalize-options.js create mode 100644 node_modules/resolve/lib/sync.js create mode 100644 node_modules/resolve/package.json create mode 100644 node_modules/resolve/readme.markdown create mode 100644 node_modules/resolve/sync.js create mode 100644 node_modules/resolve/test/dotdot.js create mode 100644 node_modules/resolve/test/dotdot/abc/index.js create mode 100644 node_modules/resolve/test/dotdot/index.js create mode 100644 node_modules/resolve/test/faulty_basedir.js create mode 100644 node_modules/resolve/test/filter.js create mode 100644 node_modules/resolve/test/filter_sync.js create mode 100644 node_modules/resolve/test/home_paths.js create mode 100644 node_modules/resolve/test/home_paths_sync.js create mode 100644 node_modules/resolve/test/mock.js create mode 100644 node_modules/resolve/test/mock_sync.js create mode 100644 node_modules/resolve/test/module_dir.js create mode 100644 node_modules/resolve/test/module_dir/xmodules/aaa/index.js create mode 100644 node_modules/resolve/test/module_dir/ymodules/aaa/index.js create mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/main.js create mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/package.json create mode 100644 node_modules/resolve/test/node-modules-paths.js create mode 100644 node_modules/resolve/test/node_path.js create mode 100644 node_modules/resolve/test/node_path/x/aaa/index.js create mode 100644 node_modules/resolve/test/node_path/x/ccc/index.js create mode 100644 node_modules/resolve/test/node_path/y/bbb/index.js create mode 100644 node_modules/resolve/test/node_path/y/ccc/index.js create mode 100644 node_modules/resolve/test/nonstring.js create mode 100644 node_modules/resolve/test/pathfilter.js create mode 100644 node_modules/resolve/test/pathfilter/deep_ref/main.js create mode 100644 node_modules/resolve/test/pathfilter_sync.js create mode 100644 node_modules/resolve/test/precedence.js create mode 100644 node_modules/resolve/test/precedence/aaa.js create mode 100644 node_modules/resolve/test/precedence/aaa/index.js create mode 100644 node_modules/resolve/test/precedence/aaa/main.js create mode 100644 node_modules/resolve/test/precedence/bbb.js create mode 100644 node_modules/resolve/test/precedence/bbb/main.js create mode 100644 node_modules/resolve/test/resolver.js create mode 100644 node_modules/resolve/test/resolver/baz/doom.js create mode 100644 node_modules/resolve/test/resolver/baz/package.json create mode 100644 node_modules/resolve/test/resolver/baz/quux.js create mode 100644 node_modules/resolve/test/resolver/browser_field/a.js create mode 100644 node_modules/resolve/test/resolver/browser_field/b.js create mode 100644 node_modules/resolve/test/resolver/browser_field/package.json create mode 100644 node_modules/resolve/test/resolver/cup.coffee create mode 100644 node_modules/resolve/test/resolver/dot_main/index.js create mode 100644 node_modules/resolve/test/resolver/dot_main/package.json create mode 100644 node_modules/resolve/test/resolver/dot_slash_main/index.js create mode 100644 node_modules/resolve/test/resolver/dot_slash_main/package.json create mode 100644 node_modules/resolve/test/resolver/empty_main/index.js create mode 100644 node_modules/resolve/test/resolver/empty_main/package.json create mode 100644 node_modules/resolve/test/resolver/false_main/index.js create mode 100644 node_modules/resolve/test/resolver/false_main/package.json create mode 100644 node_modules/resolve/test/resolver/foo.js create mode 100644 node_modules/resolve/test/resolver/incorrect_main/index.js create mode 100644 node_modules/resolve/test/resolver/incorrect_main/package.json create mode 100644 node_modules/resolve/test/resolver/invalid_main/package.json create mode 100644 node_modules/resolve/test/resolver/malformed_package_json/index.js create mode 100644 node_modules/resolve/test/resolver/malformed_package_json/package.json create mode 100644 node_modules/resolve/test/resolver/missing_index/package.json create mode 100644 node_modules/resolve/test/resolver/missing_main/index.js create mode 100644 node_modules/resolve/test/resolver/missing_main/package.json create mode 100644 node_modules/resolve/test/resolver/mug.coffee create mode 100644 node_modules/resolve/test/resolver/mug.js create mode 100644 node_modules/resolve/test/resolver/multirepo/lerna.json create mode 100644 node_modules/resolve/test/resolver/multirepo/package.json create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json create mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js create mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json create mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js create mode 100644 node_modules/resolve/test/resolver/null_main/index.js create mode 100644 node_modules/resolve/test/resolver/null_main/package.json create mode 100644 node_modules/resolve/test/resolver/other_path/lib/other-lib.js create mode 100644 node_modules/resolve/test/resolver/other_path/root.js create mode 100644 node_modules/resolve/test/resolver/quux/foo/index.js create mode 100644 node_modules/resolve/test/resolver/same_names/foo.js create mode 100644 node_modules/resolve/test/resolver/same_names/foo/index.js create mode 100644 node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js create mode 100644 node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep create mode 100644 node_modules/resolve/test/resolver/symlinked/package/bar.js create mode 100644 node_modules/resolve/test/resolver/symlinked/package/package.json create mode 100644 node_modules/resolve/test/resolver/without_basedir/main.js create mode 100644 node_modules/resolve/test/resolver_sync.js create mode 100644 node_modules/resolve/test/shadowed_core.js create mode 100644 node_modules/resolve/test/shadowed_core/node_modules/util/index.js create mode 100644 node_modules/resolve/test/subdirs.js create mode 100644 node_modules/resolve/test/symlinks.js create mode 100644 node_modules/reusify/.coveralls.yml create mode 100644 node_modules/reusify/.travis.yml create mode 100644 node_modules/reusify/LICENSE create mode 100644 node_modules/reusify/README.md create mode 100644 node_modules/reusify/benchmarks/createNoCodeFunction.js create mode 100644 node_modules/reusify/benchmarks/fib.js create mode 100644 node_modules/reusify/benchmarks/reuseNoCodeFunction.js create mode 100644 node_modules/reusify/package.json create mode 100644 node_modules/reusify/reusify.js create mode 100644 node_modules/reusify/test.js create mode 100644 node_modules/rimraf/CHANGELOG.md create mode 100644 node_modules/rimraf/LICENSE create mode 100644 node_modules/rimraf/README.md create mode 100755 node_modules/rimraf/bin.js create mode 100644 node_modules/rimraf/package.json create mode 100644 node_modules/rimraf/rimraf.js create mode 100644 node_modules/run-parallel/LICENSE create mode 100644 node_modules/run-parallel/README.md create mode 100644 node_modules/run-parallel/index.js create mode 100644 node_modules/run-parallel/package.json create mode 100644 node_modules/safe-regex-test/.eslintrc create mode 100644 node_modules/safe-regex-test/.github/FUNDING.yml create mode 100644 node_modules/safe-regex-test/CHANGELOG.md create mode 100644 node_modules/safe-regex-test/LICENSE create mode 100644 node_modules/safe-regex-test/README.md create mode 100644 node_modules/safe-regex-test/index.js create mode 100644 node_modules/safe-regex-test/package.json create mode 100644 node_modules/safe-regex-test/test/index.js create mode 100644 node_modules/semver/CHANGELOG.md create mode 100644 node_modules/semver/LICENSE create mode 100644 node_modules/semver/README.md create mode 100755 node_modules/semver/bin/semver.js create mode 100644 node_modules/semver/package.json create mode 100644 node_modules/semver/range.bnf create mode 100644 node_modules/semver/semver.js create mode 100644 node_modules/shebang-command/index.js create mode 100644 node_modules/shebang-command/license create mode 100644 node_modules/shebang-command/package.json create mode 100644 node_modules/shebang-command/readme.md create mode 100644 node_modules/shebang-regex/index.d.ts create mode 100644 node_modules/shebang-regex/index.js create mode 100644 node_modules/shebang-regex/license create mode 100644 node_modules/shebang-regex/package.json create mode 100644 node_modules/shebang-regex/readme.md create mode 100644 node_modules/side-channel/.eslintignore create mode 100644 node_modules/side-channel/.eslintrc create mode 100644 node_modules/side-channel/.github/FUNDING.yml create mode 100644 node_modules/side-channel/.nycrc create mode 100644 node_modules/side-channel/CHANGELOG.md create mode 100644 node_modules/side-channel/LICENSE create mode 100644 node_modules/side-channel/README.md create mode 100644 node_modules/side-channel/index.js create mode 100644 node_modules/side-channel/package.json create mode 100644 node_modules/side-channel/test/index.js create mode 100644 node_modules/slash/index.d.ts create mode 100644 node_modules/slash/index.js create mode 100644 node_modules/slash/license create mode 100644 node_modules/slash/package.json create mode 100644 node_modules/slash/readme.md create mode 100644 node_modules/string.prototype.matchall/.editorconfig create mode 100644 node_modules/string.prototype.matchall/.eslintrc create mode 100644 node_modules/string.prototype.matchall/.github/FUNDING.yml create mode 100644 node_modules/string.prototype.matchall/.nycrc create mode 100644 node_modules/string.prototype.matchall/CHANGELOG.md create mode 100644 node_modules/string.prototype.matchall/LICENSE create mode 100644 node_modules/string.prototype.matchall/README.md create mode 100644 node_modules/string.prototype.matchall/auto.js create mode 100644 node_modules/string.prototype.matchall/implementation.js create mode 100644 node_modules/string.prototype.matchall/index.js create mode 100644 node_modules/string.prototype.matchall/package.json create mode 100644 node_modules/string.prototype.matchall/polyfill-regexp-matchall.js create mode 100644 node_modules/string.prototype.matchall/polyfill.js create mode 100644 node_modules/string.prototype.matchall/regexp-matchall.js create mode 100644 node_modules/string.prototype.matchall/shim.js create mode 100644 node_modules/string.prototype.matchall/test/index.js create mode 100644 node_modules/string.prototype.matchall/test/shimmed.js create mode 100644 node_modules/string.prototype.matchall/test/tests.js create mode 100644 node_modules/string.prototype.trimend/.editorconfig create mode 100644 node_modules/string.prototype.trimend/.eslintrc create mode 100644 node_modules/string.prototype.trimend/.nycrc create mode 100644 node_modules/string.prototype.trimend/CHANGELOG.md create mode 100644 node_modules/string.prototype.trimend/LICENSE create mode 100644 node_modules/string.prototype.trimend/README.md create mode 100644 node_modules/string.prototype.trimend/auto.js create mode 100644 node_modules/string.prototype.trimend/implementation.js create mode 100644 node_modules/string.prototype.trimend/index.js create mode 100644 node_modules/string.prototype.trimend/package.json create mode 100644 node_modules/string.prototype.trimend/polyfill.js create mode 100644 node_modules/string.prototype.trimend/shim.js create mode 100644 node_modules/string.prototype.trimend/test/implementation.js create mode 100644 node_modules/string.prototype.trimend/test/index.js create mode 100644 node_modules/string.prototype.trimend/test/shimmed.js create mode 100644 node_modules/string.prototype.trimend/test/tests.js create mode 100644 node_modules/string.prototype.trimstart/.editorconfig create mode 100644 node_modules/string.prototype.trimstart/.eslintrc create mode 100644 node_modules/string.prototype.trimstart/.nycrc create mode 100644 node_modules/string.prototype.trimstart/CHANGELOG.md create mode 100644 node_modules/string.prototype.trimstart/LICENSE create mode 100644 node_modules/string.prototype.trimstart/README.md create mode 100644 node_modules/string.prototype.trimstart/auto.js create mode 100644 node_modules/string.prototype.trimstart/implementation.js create mode 100644 node_modules/string.prototype.trimstart/index.js create mode 100644 node_modules/string.prototype.trimstart/package.json create mode 100644 node_modules/string.prototype.trimstart/polyfill.js create mode 100644 node_modules/string.prototype.trimstart/shim.js create mode 100644 node_modules/string.prototype.trimstart/test/implementation.js create mode 100644 node_modules/string.prototype.trimstart/test/index.js create mode 100644 node_modules/string.prototype.trimstart/test/shimmed.js create mode 100644 node_modules/string.prototype.trimstart/test/tests.js create mode 100644 node_modules/strip-ansi/index.d.ts create mode 100644 node_modules/strip-ansi/index.js create mode 100644 node_modules/strip-ansi/license create mode 100644 node_modules/strip-ansi/package.json create mode 100644 node_modules/strip-ansi/readme.md create mode 100644 node_modules/strip-json-comments/index.d.ts create mode 100644 node_modules/strip-json-comments/index.js create mode 100644 node_modules/strip-json-comments/license create mode 100644 node_modules/strip-json-comments/package.json create mode 100644 node_modules/strip-json-comments/readme.md create mode 100644 node_modules/supports-color/browser.js create mode 100644 node_modules/supports-color/index.js create mode 100644 node_modules/supports-color/license create mode 100644 node_modules/supports-color/package.json create mode 100644 node_modules/supports-color/readme.md create mode 100644 node_modules/supports-preserve-symlinks-flag/.eslintrc create mode 100644 node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml create mode 100644 node_modules/supports-preserve-symlinks-flag/.nycrc create mode 100644 node_modules/supports-preserve-symlinks-flag/CHANGELOG.md create mode 100644 node_modules/supports-preserve-symlinks-flag/LICENSE create mode 100644 node_modules/supports-preserve-symlinks-flag/README.md create mode 100644 node_modules/supports-preserve-symlinks-flag/browser.js create mode 100644 node_modules/supports-preserve-symlinks-flag/index.js create mode 100644 node_modules/supports-preserve-symlinks-flag/package.json create mode 100644 node_modules/supports-preserve-symlinks-flag/test/index.js create mode 100644 node_modules/text-table/.travis.yml create mode 100644 node_modules/text-table/LICENSE create mode 100644 node_modules/text-table/example/align.js create mode 100644 node_modules/text-table/example/center.js create mode 100644 node_modules/text-table/example/dotalign.js create mode 100644 node_modules/text-table/example/doubledot.js create mode 100644 node_modules/text-table/example/table.js create mode 100644 node_modules/text-table/index.js create mode 100644 node_modules/text-table/package.json create mode 100644 node_modules/text-table/readme.markdown create mode 100644 node_modules/text-table/test/align.js create mode 100644 node_modules/text-table/test/ansi-colors.js create mode 100644 node_modules/text-table/test/center.js create mode 100644 node_modules/text-table/test/dotalign.js create mode 100644 node_modules/text-table/test/doubledot.js create mode 100644 node_modules/text-table/test/table.js create mode 100644 node_modules/to-regex-range/LICENSE create mode 100644 node_modules/to-regex-range/README.md create mode 100644 node_modules/to-regex-range/index.js create mode 100644 node_modules/to-regex-range/package.json create mode 100644 node_modules/type-check/LICENSE create mode 100644 node_modules/type-check/README.md create mode 100644 node_modules/type-check/lib/check.js create mode 100644 node_modules/type-check/lib/index.js create mode 100644 node_modules/type-check/lib/parse-type.js create mode 100644 node_modules/type-check/package.json create mode 100644 node_modules/type-fest/base.d.ts create mode 100644 node_modules/type-fest/index.d.ts create mode 100644 node_modules/type-fest/license create mode 100644 node_modules/type-fest/package.json create mode 100644 node_modules/type-fest/readme.md create mode 100644 node_modules/type-fest/source/async-return-type.d.ts create mode 100644 node_modules/type-fest/source/asyncify.d.ts create mode 100644 node_modules/type-fest/source/basic.d.ts create mode 100644 node_modules/type-fest/source/conditional-except.d.ts create mode 100644 node_modules/type-fest/source/conditional-keys.d.ts create mode 100644 node_modules/type-fest/source/conditional-pick.d.ts create mode 100644 node_modules/type-fest/source/entries.d.ts create mode 100644 node_modules/type-fest/source/entry.d.ts create mode 100644 node_modules/type-fest/source/except.d.ts create mode 100644 node_modules/type-fest/source/fixed-length-array.d.ts create mode 100644 node_modules/type-fest/source/iterable-element.d.ts create mode 100644 node_modules/type-fest/source/literal-union.d.ts create mode 100644 node_modules/type-fest/source/merge-exclusive.d.ts create mode 100644 node_modules/type-fest/source/merge.d.ts create mode 100644 node_modules/type-fest/source/mutable.d.ts create mode 100644 node_modules/type-fest/source/opaque.d.ts create mode 100644 node_modules/type-fest/source/package-json.d.ts create mode 100644 node_modules/type-fest/source/partial-deep.d.ts create mode 100644 node_modules/type-fest/source/promisable.d.ts create mode 100644 node_modules/type-fest/source/promise-value.d.ts create mode 100644 node_modules/type-fest/source/readonly-deep.d.ts create mode 100644 node_modules/type-fest/source/require-at-least-one.d.ts create mode 100644 node_modules/type-fest/source/require-exactly-one.d.ts create mode 100644 node_modules/type-fest/source/set-optional.d.ts create mode 100644 node_modules/type-fest/source/set-required.d.ts create mode 100644 node_modules/type-fest/source/set-return-type.d.ts create mode 100644 node_modules/type-fest/source/stringified.d.ts create mode 100644 node_modules/type-fest/source/tsconfig-json.d.ts create mode 100644 node_modules/type-fest/source/union-to-intersection.d.ts create mode 100644 node_modules/type-fest/source/utilities.d.ts create mode 100644 node_modules/type-fest/source/value-of.d.ts create mode 100644 node_modules/type-fest/ts41/camel-case.d.ts create mode 100644 node_modules/type-fest/ts41/delimiter-case.d.ts create mode 100644 node_modules/type-fest/ts41/index.d.ts create mode 100644 node_modules/type-fest/ts41/kebab-case.d.ts create mode 100644 node_modules/type-fest/ts41/pascal-case.d.ts create mode 100644 node_modules/type-fest/ts41/snake-case.d.ts create mode 100644 node_modules/unbox-primitive/.editorconfig create mode 100644 node_modules/unbox-primitive/.eslintrc create mode 100644 node_modules/unbox-primitive/.github/FUNDING.yml create mode 100644 node_modules/unbox-primitive/.nycrc create mode 100644 node_modules/unbox-primitive/CHANGELOG.md create mode 100644 node_modules/unbox-primitive/LICENSE create mode 100644 node_modules/unbox-primitive/README.md create mode 100644 node_modules/unbox-primitive/index.js create mode 100644 node_modules/unbox-primitive/package.json create mode 100644 node_modules/unbox-primitive/test/index.js create mode 100755 node_modules/uri-js/LICENSE create mode 100755 node_modules/uri-js/README.md create mode 100755 node_modules/uri-js/dist/es5/uri.all.d.ts create mode 100755 node_modules/uri-js/dist/es5/uri.all.js create mode 100755 node_modules/uri-js/dist/es5/uri.all.js.map create mode 100755 node_modules/uri-js/dist/es5/uri.all.min.d.ts create mode 100755 node_modules/uri-js/dist/es5/uri.all.min.js create mode 100755 node_modules/uri-js/dist/es5/uri.all.min.js.map create mode 100755 node_modules/uri-js/dist/esnext/index.d.ts create mode 100755 node_modules/uri-js/dist/esnext/index.js create mode 100755 node_modules/uri-js/dist/esnext/index.js.map create mode 100755 node_modules/uri-js/dist/esnext/regexps-iri.d.ts create mode 100755 node_modules/uri-js/dist/esnext/regexps-iri.js create mode 100755 node_modules/uri-js/dist/esnext/regexps-iri.js.map create mode 100755 node_modules/uri-js/dist/esnext/regexps-uri.d.ts create mode 100755 node_modules/uri-js/dist/esnext/regexps-uri.js create mode 100755 node_modules/uri-js/dist/esnext/regexps-uri.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/http.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/http.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/http.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/https.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/https.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/https.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/mailto.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/mailto.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/mailto.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/urn-uuid.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/urn.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/urn.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/urn.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/ws.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/ws.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/ws.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/wss.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/wss.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/wss.js.map create mode 100755 node_modules/uri-js/dist/esnext/uri.d.ts create mode 100755 node_modules/uri-js/dist/esnext/uri.js create mode 100755 node_modules/uri-js/dist/esnext/uri.js.map create mode 100755 node_modules/uri-js/dist/esnext/util.d.ts create mode 100755 node_modules/uri-js/dist/esnext/util.js create mode 100755 node_modules/uri-js/dist/esnext/util.js.map create mode 100755 node_modules/uri-js/package.json create mode 100755 node_modules/uri-js/yarn.lock create mode 100644 node_modules/which-boxed-primitive/.editorconfig create mode 100644 node_modules/which-boxed-primitive/.eslintignore create mode 100644 node_modules/which-boxed-primitive/.eslintrc create mode 100644 node_modules/which-boxed-primitive/.github/FUNDING.yml create mode 100644 node_modules/which-boxed-primitive/.nycrc create mode 100644 node_modules/which-boxed-primitive/CHANGELOG.md create mode 100644 node_modules/which-boxed-primitive/LICENSE create mode 100644 node_modules/which-boxed-primitive/README.md create mode 100644 node_modules/which-boxed-primitive/index.js create mode 100644 node_modules/which-boxed-primitive/package.json create mode 100644 node_modules/which-boxed-primitive/test/index.js create mode 100644 node_modules/which/CHANGELOG.md create mode 100644 node_modules/which/LICENSE create mode 100644 node_modules/which/README.md create mode 100755 node_modules/which/bin/node-which create mode 100644 node_modules/which/package.json create mode 100644 node_modules/which/which.js create mode 100644 node_modules/word-wrap/LICENSE create mode 100644 node_modules/word-wrap/README.md create mode 100644 node_modules/word-wrap/index.d.ts create mode 100644 node_modules/word-wrap/index.js create mode 100644 node_modules/word-wrap/package.json create mode 100644 node_modules/wrappy/LICENSE create mode 100644 node_modules/wrappy/README.md create mode 100644 node_modules/wrappy/package.json create mode 100644 node_modules/wrappy/wrappy.js create mode 100644 node_modules/yocto-queue/index.d.ts create mode 100644 node_modules/yocto-queue/index.js create mode 100644 node_modules/yocto-queue/license create mode 100644 node_modules/yocto-queue/package.json create mode 100644 node_modules/yocto-queue/readme.md create mode 100644 package-lock.json create mode 100644 package.json diff --git a/codalab/model/bundle_model.py b/codalab/model/bundle_model.py index e7ac5e44e..e8d71209d 100644 --- a/codalab/model/bundle_model.py +++ b/codalab/model/bundle_model.py @@ -13,8 +13,9 @@ from dateutil import parser from uuid import uuid4 -from sqlalchemy import and_, or_, not_, select, union, desc, func +from sqlalchemy import and_, or_, not_, select, union, desc, func, Table from sqlalchemy.sql.expression import literal, true +from sqlalchemy.sql.elements import BinaryExpression from sqlalchemy.orm import aliased from codalab.bundles import get_bundle_subclass @@ -379,13 +380,16 @@ def search_bundles(self, user_id, keywords): Bare keywords: sugar for uuid_name=.*.* Search only bundles which are readable by user_id. """ - offset = 0 - limit = SEARCH_RESULTS_LIMIT - format_func = None - count = False - sort_key = [None] - sum_key = [None] - aux_fields = [] # Fields (e.g., sorting) that we need to include in the query + offset: int = 0 + limit: Optional[int] = SEARCH_RESULTS_LIMIT + format_func: Optional[Callable[str, str]] = None + count: bool = False + sort_key: List[Optional[str]] = [None] + sum_key: List[Optional[BinaryExpression]] = [None] + aux_fields: List[str] = [] # Fields (e.g., sorting) that we need to include in the query + + inner_joins: List[Tuple[Table, BinaryExpression]] = list() + where_clause_conjuncts: List[BinaryExpression] = list() # Number nested subqueries subquery_index = [0] @@ -421,16 +425,13 @@ def make_condition(key, field, value): return None def add_join(join_table, join_condition): - join_tables.append(join_table) - join_conditions.append(join_condition) + inner_joins.append((join_table, join_condition)) shortcuts = {'type': 'bundle_type', 'size': 'data_size', 'worksheet': 'host_worksheet'} - join_tables = [] - join_conditions = [] - where_clauses = [] - for keyword in keywords: + conjunct = None # Conjunct to add to final where_clause. + keyword = keyword.replace('.*', '%') # Sugar if keyword == '.mine': @@ -450,8 +451,8 @@ def add_join(join_table, join_condition): cl_bundle.c.uuid == cl_worksheet_item.c.bundle_uuid ) ) - clause = not_(cl_bundle.c.uuid.in_(with_hosts)) - where_clauses.append(clause) + conjunct = not_(cl_bundle.c.uuid.in_(with_hosts)) + where_clause_conjuncts.append(clause) continue m = SEARCH_KEYWORD_REGEX.match(keyword) # key=value @@ -463,7 +464,7 @@ def add_join(join_table, join_condition): else: key, value = 'uuid_name', keyword - where_clause = None + conjunct = None # Special functions if key == '.offset': offset = int(value) @@ -473,7 +474,7 @@ def add_join(join_table, join_condition): format_func = value # Bundle fields elif key in ('bundle_type', 'id', 'uuid', 'data_hash', 'state', 'command', 'owner_id'): - where_clause = make_condition(key, getattr(cl_bundle.c, key), value) + conjunct = make_condition(key, getattr(cl_bundle.c, key), value) elif key == '.shared': # shared with any group I am in with read permission add_join( cl_group_bundle_permission, @@ -484,7 +485,7 @@ def add_join(join_table, join_condition): cl_group_bundle_permission.c.group_uuid == cl_user_group.c.group_uuid, ) - where_clause = and_( + conjunct = and_( cl_user_group.c.user_id == user_id, cl_group_bundle_permission.c.permission >= GROUP_OBJECT_PERMISSION_READ, ) @@ -494,7 +495,7 @@ def add_join(join_table, join_condition): cl_bundle.c.uuid == cl_group_bundle_permission.c.object_uuid, ) group_uuid = get_group_info(value, False)['uuid'] - where_clause = and_( + conjunct = and_( cl_group_bundle_permission.c.group_uuid == group_uuid, cl_group_bundle_permission.c.permission >= GROUP_OBJECT_PERMISSION_READ, ) @@ -503,17 +504,17 @@ def add_join(join_table, join_condition): # Match uuid of dependency condition = make_condition(key, cl_bundle_dependency.c.parent_uuid, value) if condition is None: # top-level - where_clause = cl_bundle_dependency.c.child_uuid == cl_bundle.c.uuid + conjunct = cl_bundle_dependency.c.child_uuid == cl_bundle.c.uuid else: # embedded add_join( cl_bundle_dependency, cl_bundle.c.uuid == cl_bundle_dependency.c.child_uuid ) - where_clause = condition + conjunct = condition elif key.startswith('dependency/'): _, name = key.split('/', 1) condition = make_condition(key, cl_bundle_dependency.c.parent_uuid, value) if condition is None: # top-level - where_clause = and_( + conjunct = and_( cl_bundle_dependency.c.child_uuid == cl_bundle.c.uuid, # Join constraint cl_bundle_dependency.c.child_path == name, # Match the 'type' of dependent (child_path) @@ -522,7 +523,7 @@ def add_join(join_table, join_condition): add_join( cl_bundle_dependency, cl_bundle.c.uuid == cl_bundle_dependency.c.child_uuid ) - where_clause = and_( + conjunct = and_( cl_bundle_dependency.c.child_path == name, # Match the 'type' of dependent (child_path) condition, @@ -533,7 +534,7 @@ def add_join(join_table, join_condition): clause = cl_worksheet_item.c.bundle_uuid == cl_bundle.c.uuid # Join constraint else: add_join(cl_worksheet_item, cl_bundle.c.uuid == cl_worksheet_item.c.bundle_uuid) - where_clause = condition + conjunct = condition elif key in ('.before', '.after'): try: target_datetime = parser.isoparse(value) @@ -556,7 +557,7 @@ def add_join(join_table, join_condition): aliased_bundle_metadata, cl_bundle.c.uuid == aliased_bundle_metadata.c.bundle_uuid, ) - where_clause = and_(aliased_bundle_metadata.c.metadata_key == 'created', subclause) + conjunct = and_(aliased_bundle_metadata.c.metadata_key == 'created', subclause) elif key == 'uuid_name': # Search uuid and name by default aliased_bundle_metadata = aliased(cl_bundle_metadata) add_join( @@ -564,15 +565,13 @@ def add_join(join_table, join_condition): cl_bundle.c.uuid == aliased_bundle_metadata.c.bundle_uuid, ) - where_clause = [] - where_clause.append(cl_bundle.c.uuid.like('%' + value + '%')) - where_clause.append( + conjunct = or_( + cl_bundle.c.uuid.like('%' + value + '%'), and_( aliased_bundle_metadata.c.metadata_key == 'name', aliased_bundle_metadata.c.metadata_value.like('%' + value + '%'), - ) + ), ) - where_clause = or_(*where_clause) elif key == '': # Match any field aliased_bundle_metadata = aliased(cl_bundle_metadata) add_join( @@ -580,19 +579,17 @@ def add_join(join_table, join_condition): cl_bundle.c.uuid == aliased_bundle_metadata.c.bundle_uuid, ) - where_clause = [] - where_clause.append(cl_bundle.c.uuid.like('%' + value + '%')) - where_clause.append(cl_bundle.c.command.like('%' + value + '%')) - where_clause.append( - aliased_bundle_metadata.c.metadata_value.like('%' + value + '%') + conjunct = or_( + cl_bundle.c.uuid.like('%' + value + '%'), + cl_bundle.c.command.like('%' + value + '%'), + aliased_bundle_metadata.c.metadata_value.like('%' + value + '%'), ) - where_clause = or_(*where_clause) # Otherwise, assume metadata. else: aliased_bundle_metadata = aliased(cl_bundle_metadata) condition = make_condition(key, aliased_bundle_metadata.c.metadata_value, value) if condition is None: # top-level - where_clause = and_( + conjunct = and_( cl_bundle.c.uuid == aliased_bundle_metadata.c.bundle_uuid, aliased_bundle_metadata.c.metadata_key == key, ) @@ -602,12 +599,12 @@ def add_join(join_table, join_condition): cl_bundle.c.uuid == aliased_bundle_metadata.c.bundle_uuid, ) - where_clause = and_(aliased_bundle_metadata.c.metadata_key == key, condition) + conjunct = and_(aliased_bundle_metadata.c.metadata_key == key, condition) - if where_clause is not None: - where_clauses.append(where_clause) + if conjunct is not None: + where_clause_conjuncts.append(conjunct) - where_clause = and_(*where_clauses) + where_clause = and_(*where_clause_conjuncts) if user_id != self.root_user_id: # Restrict to the bundles that we have access to. @@ -615,6 +612,7 @@ def add_join(join_table, join_condition): cl_group_bundle_permission, cl_bundle.c.uuid == cl_group_bundle_permission.c.object_uuid, ) + # add_join(cl_user_group, None) #COME BACK TO THIS!!!! access_via_owner = cl_bundle.c.owner_id == user_id access_via_group = and_( or_( # Join constraint (group) @@ -635,8 +633,8 @@ def add_join(join_table, join_condition): where_clause = and_(where_clause, or_(access_via_owner, access_via_group)) table = cl_bundle - for join_table, join_condition in zip(join_tables, join_conditions): - table = table.join(join_table, join_condition) + for inner_join in inner_joins: + table = table.join(*inner_join) # Aggregate (sum) if sum_key[0] is not None: # Construct a table with only the uuid and the num (and make sure it's distinct!) diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn new file mode 120000 index 000000000..cf7676038 --- /dev/null +++ b/node_modules/.bin/acorn @@ -0,0 +1 @@ +../acorn/bin/acorn \ No newline at end of file diff --git a/node_modules/.bin/eslint b/node_modules/.bin/eslint new file mode 120000 index 000000000..810e4bcb3 --- /dev/null +++ b/node_modules/.bin/eslint @@ -0,0 +1 @@ +../eslint/bin/eslint.js \ No newline at end of file diff --git a/node_modules/.bin/js-yaml b/node_modules/.bin/js-yaml new file mode 120000 index 000000000..9dbd010d4 --- /dev/null +++ b/node_modules/.bin/js-yaml @@ -0,0 +1 @@ +../js-yaml/bin/js-yaml.js \ No newline at end of file diff --git a/node_modules/.bin/loose-envify b/node_modules/.bin/loose-envify new file mode 120000 index 000000000..ed9009c5a --- /dev/null +++ b/node_modules/.bin/loose-envify @@ -0,0 +1 @@ +../loose-envify/cli.js \ No newline at end of file diff --git a/node_modules/.bin/node-which b/node_modules/.bin/node-which new file mode 120000 index 000000000..6f8415ec5 --- /dev/null +++ b/node_modules/.bin/node-which @@ -0,0 +1 @@ +../which/bin/node-which \ No newline at end of file diff --git a/node_modules/.bin/resolve b/node_modules/.bin/resolve new file mode 120000 index 000000000..b6afda6c7 --- /dev/null +++ b/node_modules/.bin/resolve @@ -0,0 +1 @@ +../resolve/bin/resolve \ No newline at end of file diff --git a/node_modules/.bin/rimraf b/node_modules/.bin/rimraf new file mode 120000 index 000000000..4cd49a49d --- /dev/null +++ b/node_modules/.bin/rimraf @@ -0,0 +1 @@ +../rimraf/bin.js \ No newline at end of file diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver new file mode 120000 index 000000000..5aaadf42c --- /dev/null +++ b/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver.js \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 000000000..1530f7a27 --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,2163 @@ +{ + "name": "codalab-worksheets", + "lockfileVersion": 2, + "requires": true, + "packages": { + "node_modules/@eslint/eslintrc": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", + "integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==", + "dev": true, + "peer": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.4.0", + "globals": "^13.15.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.10.7", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.7.tgz", + "integrity": "sha512-MDl6D6sBsaV452/QSdX+4CXIjZhIcI0PELsxUjk4U828yd58vk3bTIvk/6w5FY+4hIy9sLW0sfrV7K7Kc++j/w==", + "dev": true, + "peer": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true, + "peer": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "peer": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "peer": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/acorn": { + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", + "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "dev": true, + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peer": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "peer": true + }, + "node_modules/array-includes": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.5.tgz", + "integrity": "sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5", + "get-intrinsic": "^1.1.1", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.0.tgz", + "integrity": "sha512-PZC9/8TKAIxcWKdyeb77EzULHPrIX/tIZebLJUQOMR1OwYosT8yggdfWScfTBCDj5utONvOuPQQumYsU2ULbkg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.2", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "peer": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "peer": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "peer": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "peer": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "peer": true + }, + "node_modules/define-properties": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", + "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "dev": true, + "dependencies": { + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "peer": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "peer": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/es-abstract": { + "version": "1.20.4", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.4.tgz", + "integrity": "sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "function.prototype.name": "^1.1.5", + "get-intrinsic": "^1.1.3", + "get-symbol-description": "^1.0.0", + "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.3", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.2", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.4.3", + "safe-regex-test": "^1.0.0", + "string.prototype.trimend": "^1.0.5", + "string.prototype.trimstart": "^1.0.5", + "unbox-primitive": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.25.0.tgz", + "integrity": "sha512-DVlJOZ4Pn50zcKW5bYH7GQK/9MsoQG2d5eDH0ebEkE8PbgzTTmtt/VTH9GGJ4BfeZCpBLqFfvsjX35UacUL83A==", + "dev": true, + "peer": true, + "dependencies": { + "@eslint/eslintrc": "^1.3.3", + "@humanwhocodes/config-array": "^0.10.5", + "@humanwhocodes/module-importer": "^1.0.1", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.4.0", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.1", + "globals": "^13.15.0", + "globby": "^11.1.0", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-sdsl": "^4.1.4", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-plugin-react": { + "version": "7.31.8", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.31.8.tgz", + "integrity": "sha512-5lBTZmgQmARLLSYiwI71tiGVTLUuqXantZM6vlSY39OaDSV0M7+32K5DnLkmFrwTe+Ksz0ffuLUC91RUviVZfw==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.5", + "array.prototype.flatmap": "^1.3.0", + "doctrine": "^2.1.0", + "estraverse": "^5.3.0", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.5", + "object.fromentries": "^2.0.5", + "object.hasown": "^1.1.1", + "object.values": "^1.1.5", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.3", + "semver": "^6.3.0", + "string.prototype.matchall": "^4.0.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" + } + }, + "node_modules/eslint-plugin-react/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-scope": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "dev": true, + "peer": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "peer": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/espree": { + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", + "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", + "dev": true, + "peer": true, + "dependencies": { + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "peer": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "peer": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "peer": true + }, + "node_modules/fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dev": true, + "peer": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "peer": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "peer": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "peer": true + }, + "node_modules/fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, + "peer": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "peer": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "peer": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "peer": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "peer": true, + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "dev": true, + "peer": true + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "peer": true + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/function.prototype.name": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", + "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "peer": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "peer": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "13.17.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", + "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", + "dev": true, + "peer": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "peer": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true, + "peer": true + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "peer": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "peer": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "peer": true + }, + "node_modules/internal-slot": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", + "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", + "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "peer": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "peer": true + }, + "node_modules/js-sdsl": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz", + "integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==", + "dev": true, + "peer": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "peer": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "peer": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "peer": true + }, + "node_modules/jsx-ast-utils": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz", + "integrity": "sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.5", + "object.assign": "^4.1.3" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "peer": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "peer": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "peer": true + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "peer": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "peer": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "peer": true + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.entries": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.5.tgz", + "integrity": "sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.5.tgz", + "integrity": "sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.hasown": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.1.tgz", + "integrity": "sha512-LYLe4tivNQzq4JdaWW6WO3HMZZJWzkkH8fnI6EebWl0VZth2wL2Lovm74ep2/gZzlaTdV62JZHEqHQ2yVn8Q/A==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.values": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", + "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "peer": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "peer": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "peer": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "peer": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "peer": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dev": true, + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true + }, + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true + }, + "node_modules/regexp.prototype.flags": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", + "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/resolve": { + "version": "2.0.0-next.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", + "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==", + "dev": true, + "dependencies": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "peer": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "peer": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true, + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "peer": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string.prototype.matchall": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.7.tgz", + "integrity": "sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1", + "get-intrinsic": "^1.1.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.3", + "regexp.prototype.flags": "^1.4.1", + "side-channel": "^1.0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", + "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", + "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true, + "peer": true + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "peer": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "peer": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "peer": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "peer": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "peer": true + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/node_modules/@eslint/eslintrc/LICENSE b/node_modules/@eslint/eslintrc/LICENSE new file mode 100644 index 000000000..b607bb36e --- /dev/null +++ b/node_modules/@eslint/eslintrc/LICENSE @@ -0,0 +1,19 @@ +Copyright OpenJS Foundation and other contributors, + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/@eslint/eslintrc/README.md b/node_modules/@eslint/eslintrc/README.md new file mode 100644 index 000000000..b33279485 --- /dev/null +++ b/node_modules/@eslint/eslintrc/README.md @@ -0,0 +1,68 @@ +# ESLintRC Library + +This repository contains the legacy ESLintRC configuration file format for ESLint. This package is not intended for use outside of the ESLint ecosystem. It is ESLint-specific and not intended for use in other programs. + +**Note:** This package is frozen except for critical bug fixes as ESLint moves to a new config system. + +## Installation + +You can install the package as follows: + +``` +npm install @eslint/eslintrc --save-dev + +# or + +yarn add @eslint/eslintrc -D +``` + +## Usage + +The primary class in this package is `FlatCompat`, which is a utility to translate ESLintRC-style configs into flat configs. Here's how you use it inside of your `eslint.config.js` file: + +```js +import { FlatCompat } from "@eslint/eslintrc"; +import path from "path"; +import { fileURLToPath } from "url"; + +// mimic CommonJS variables -- not needed if using CommonJS +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const compat = new FlatCompat({ + baseDirectory: __dirname, // optional; default: process.cwd() + resolvePluginsRelativeTo: __dirname // optional +}); + +export default [ + + // mimic ESLintRC-style extends + compat.extends("standard", "example"), + + // mimic environments + compat.env({ + es2020: true, + node: true + }), + + // mimic plugins + compat.plugins("airbnb", "react"), + + // translate an entire config + compat.config({ + plugins: ["airbnb", "react"], + extends: "standard", + env: { + es2020: true, + node: true + }, + rules: { + semi: "error" + } + }) +]; +``` + +## License + +MIT License diff --git a/node_modules/@eslint/eslintrc/conf/config-schema.js b/node_modules/@eslint/eslintrc/conf/config-schema.js new file mode 100644 index 000000000..ada90e135 --- /dev/null +++ b/node_modules/@eslint/eslintrc/conf/config-schema.js @@ -0,0 +1,79 @@ +/** + * @fileoverview Defines a schema for configs. + * @author Sylvan Mably + */ + +const baseConfigProperties = { + $schema: { type: "string" }, + env: { type: "object" }, + extends: { $ref: "#/definitions/stringOrStrings" }, + globals: { type: "object" }, + overrides: { + type: "array", + items: { $ref: "#/definitions/overrideConfig" }, + additionalItems: false + }, + parser: { type: ["string", "null"] }, + parserOptions: { type: "object" }, + plugins: { type: "array" }, + processor: { type: "string" }, + rules: { type: "object" }, + settings: { type: "object" }, + noInlineConfig: { type: "boolean" }, + reportUnusedDisableDirectives: { type: "boolean" }, + + ecmaFeatures: { type: "object" } // deprecated; logs a warning when used +}; + +const configSchema = { + definitions: { + stringOrStrings: { + oneOf: [ + { type: "string" }, + { + type: "array", + items: { type: "string" }, + additionalItems: false + } + ] + }, + stringOrStringsRequired: { + oneOf: [ + { type: "string" }, + { + type: "array", + items: { type: "string" }, + additionalItems: false, + minItems: 1 + } + ] + }, + + // Config at top-level. + objectConfig: { + type: "object", + properties: { + root: { type: "boolean" }, + ignorePatterns: { $ref: "#/definitions/stringOrStrings" }, + ...baseConfigProperties + }, + additionalProperties: false + }, + + // Config in `overrides`. + overrideConfig: { + type: "object", + properties: { + excludedFiles: { $ref: "#/definitions/stringOrStrings" }, + files: { $ref: "#/definitions/stringOrStringsRequired" }, + ...baseConfigProperties + }, + required: ["files"], + additionalProperties: false + } + }, + + $ref: "#/definitions/objectConfig" +}; + +export default configSchema; diff --git a/node_modules/@eslint/eslintrc/conf/environments.js b/node_modules/@eslint/eslintrc/conf/environments.js new file mode 100644 index 000000000..f84285256 --- /dev/null +++ b/node_modules/@eslint/eslintrc/conf/environments.js @@ -0,0 +1,203 @@ +/** + * @fileoverview Defines environment settings and globals. + * @author Elan Shanker + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import globals from "globals"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the object that has difference. + * @param {Record} current The newer object. + * @param {Record} prev The older object. + * @returns {Record} The difference object. + */ +function getDiff(current, prev) { + const retv = {}; + + for (const [key, value] of Object.entries(current)) { + if (!Object.hasOwnProperty.call(prev, key)) { + retv[key] = value; + } + } + + return retv; +} + +const newGlobals2015 = getDiff(globals.es2015, globals.es5); // 19 variables such as Promise, Map, ... +const newGlobals2017 = { + Atomics: false, + SharedArrayBuffer: false +}; +const newGlobals2020 = { + BigInt: false, + BigInt64Array: false, + BigUint64Array: false, + globalThis: false +}; + +const newGlobals2021 = { + AggregateError: false, + FinalizationRegistry: false, + WeakRef: false +}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** @type {Map} */ +export default new Map(Object.entries({ + + // Language + builtin: { + globals: globals.es5 + }, + es6: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2015: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2016: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 7 + } + }, + es2017: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 8 + } + }, + es2018: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 9 + } + }, + es2019: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 10 + } + }, + es2020: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 }, + parserOptions: { + ecmaVersion: 11 + } + }, + es2021: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 12 + } + }, + es2022: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 13 + } + }, + + // Platforms + browser: { + globals: globals.browser + }, + node: { + globals: globals.node, + parserOptions: { + ecmaFeatures: { + globalReturn: true + } + } + }, + "shared-node-browser": { + globals: globals["shared-node-browser"] + }, + worker: { + globals: globals.worker + }, + serviceworker: { + globals: globals.serviceworker + }, + + // Frameworks + commonjs: { + globals: globals.commonjs, + parserOptions: { + ecmaFeatures: { + globalReturn: true + } + } + }, + amd: { + globals: globals.amd + }, + mocha: { + globals: globals.mocha + }, + jasmine: { + globals: globals.jasmine + }, + jest: { + globals: globals.jest + }, + phantomjs: { + globals: globals.phantomjs + }, + jquery: { + globals: globals.jquery + }, + qunit: { + globals: globals.qunit + }, + prototypejs: { + globals: globals.prototypejs + }, + shelljs: { + globals: globals.shelljs + }, + meteor: { + globals: globals.meteor + }, + mongo: { + globals: globals.mongo + }, + protractor: { + globals: globals.protractor + }, + applescript: { + globals: globals.applescript + }, + nashorn: { + globals: globals.nashorn + }, + atomtest: { + globals: globals.atomtest + }, + embertest: { + globals: globals.embertest + }, + webextensions: { + globals: globals.webextensions + }, + greasemonkey: { + globals: globals.greasemonkey + } +})); diff --git a/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs b/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs new file mode 100644 index 000000000..b1b755306 --- /dev/null +++ b/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs @@ -0,0 +1,1092 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var util = require('util'); +var path = require('path'); +var Ajv = require('ajv'); +var globals = require('globals'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +var util__default = /*#__PURE__*/_interopDefaultLegacy(util); +var path__default = /*#__PURE__*/_interopDefaultLegacy(path); +var Ajv__default = /*#__PURE__*/_interopDefaultLegacy(Ajv); +var globals__default = /*#__PURE__*/_interopDefaultLegacy(globals); + +/** + * @fileoverview Config file operations. This file must be usable in the browser, + * so no Node-specific code can be here. + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +const RULE_SEVERITY_STRINGS = ["off", "warn", "error"], + RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => { + map[value] = index; + return map; + }, {}), + VALID_SEVERITIES = [0, 1, 2, "off", "warn", "error"]; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Normalizes the severity value of a rule's configuration to a number + * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally + * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0), + * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array + * whose first element is one of the above values. Strings are matched case-insensitively. + * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0. + */ +function getRuleSeverity(ruleConfig) { + const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (severityValue === 0 || severityValue === 1 || severityValue === 2) { + return severityValue; + } + + if (typeof severityValue === "string") { + return RULE_SEVERITY[severityValue.toLowerCase()] || 0; + } + + return 0; +} + +/** + * Converts old-style severity settings (0, 1, 2) into new-style + * severity settings (off, warn, error) for all rules. Assumption is that severity + * values have already been validated as correct. + * @param {Object} config The config object to normalize. + * @returns {void} + */ +function normalizeToStrings(config) { + + if (config.rules) { + Object.keys(config.rules).forEach(ruleId => { + const ruleConfig = config.rules[ruleId]; + + if (typeof ruleConfig === "number") { + config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0]; + } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") { + ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0]; + } + }); + } +} + +/** + * Determines if the severity for the given rule configuration represents an error. + * @param {int|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} True if the rule represents an error, false if not. + */ +function isErrorSeverity(ruleConfig) { + return getRuleSeverity(ruleConfig) === 2; +} + +/** + * Checks whether a given config has valid severity or not. + * @param {number|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} `true` if the configuration has valid severity. + */ +function isValidSeverity(ruleConfig) { + let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (typeof severity === "string") { + severity = severity.toLowerCase(); + } + return VALID_SEVERITIES.indexOf(severity) !== -1; +} + +/** + * Checks whether every rule of a given config has valid severity or not. + * @param {Object} config The configuration for rules. + * @returns {boolean} `true` if the configuration has valid severity. + */ +function isEverySeverityValid(config) { + return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId])); +} + +/** + * Normalizes a value for a global in a config + * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in + * a global directive comment + * @returns {("readable"|"writeable"|"off")} The value normalized as a string + * @throws Error if global value is invalid + */ +function normalizeConfigGlobal(configuredValue) { + switch (configuredValue) { + case "off": + return "off"; + + case true: + case "true": + case "writeable": + case "writable": + return "writable"; + + case null: + case false: + case "false": + case "readable": + case "readonly": + return "readonly"; + + default: + throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`); + } +} + +var ConfigOps = { + __proto__: null, + getRuleSeverity: getRuleSeverity, + normalizeToStrings: normalizeToStrings, + isErrorSeverity: isErrorSeverity, + isValidSeverity: isValidSeverity, + isEverySeverityValid: isEverySeverityValid, + normalizeConfigGlobal: normalizeConfigGlobal +}; + +/** + * @fileoverview Provide the function that emits deprecation warnings. + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +// Defitions for deprecation warnings. +const deprecationWarningMessages = { + ESLINT_LEGACY_ECMAFEATURES: + "The 'ecmaFeatures' config file property is deprecated and has no effect.", + ESLINT_PERSONAL_CONFIG_LOAD: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please use a config file per project or the '--config' option.", + ESLINT_PERSONAL_CONFIG_SUPPRESS: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please remove it or add 'root:true' to the config files in your " + + "projects in order to avoid loading '~/.eslintrc.*' accidentally." +}; + +const sourceFileErrorCache = new Set(); + +/** + * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted + * for each unique file path, but repeated invocations with the same file path have no effect. + * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active. + * @param {string} source The name of the configuration source to report the warning for. + * @param {string} errorCode The warning message to show. + * @returns {void} + */ +function emitDeprecationWarning(source, errorCode) { + const cacheKey = JSON.stringify({ source, errorCode }); + + if (sourceFileErrorCache.has(cacheKey)) { + return; + } + sourceFileErrorCache.add(cacheKey); + + const rel = path__default["default"].relative(process.cwd(), source); + const message = deprecationWarningMessages[errorCode]; + + process.emitWarning( + `${message} (found in "${rel}")`, + "DeprecationWarning", + errorCode + ); +} + +/** + * @fileoverview The instance of Ajv validator. + * @author Evgeny Poberezkin + */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/* + * Copied from ajv/lib/refs/json-schema-draft-04.json + * The MIT License (MIT) + * Copyright (c) 2015-2017 Evgeny Poberezkin + */ +const metaSchema = { + id: "http://json-schema.org/draft-04/schema#", + $schema: "http://json-schema.org/draft-04/schema#", + description: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { $ref: "#" } + }, + positiveInteger: { + type: "integer", + minimum: 0 + }, + positiveIntegerDefault0: { + allOf: [{ $ref: "#/definitions/positiveInteger" }, { default: 0 }] + }, + simpleTypes: { + enum: ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + stringArray: { + type: "array", + items: { type: "string" }, + minItems: 1, + uniqueItems: true + } + }, + type: "object", + properties: { + id: { + type: "string" + }, + $schema: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: { }, + multipleOf: { + type: "number", + minimum: 0, + exclusiveMinimum: true + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { $ref: "#/definitions/positiveInteger" }, + minLength: { $ref: "#/definitions/positiveIntegerDefault0" }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + anyOf: [ + { type: "boolean" }, + { $ref: "#" } + ], + default: { } + }, + items: { + anyOf: [ + { $ref: "#" }, + { $ref: "#/definitions/schemaArray" } + ], + default: { } + }, + maxItems: { $ref: "#/definitions/positiveInteger" }, + minItems: { $ref: "#/definitions/positiveIntegerDefault0" }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { $ref: "#/definitions/positiveInteger" }, + minProperties: { $ref: "#/definitions/positiveIntegerDefault0" }, + required: { $ref: "#/definitions/stringArray" }, + additionalProperties: { + anyOf: [ + { type: "boolean" }, + { $ref: "#" } + ], + default: { } + }, + definitions: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + properties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + patternProperties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { $ref: "#" }, + { $ref: "#/definitions/stringArray" } + ] + } + }, + enum: { + type: "array", + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { $ref: "#/definitions/simpleTypes" }, + { + type: "array", + items: { $ref: "#/definitions/simpleTypes" }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { type: "string" }, + allOf: { $ref: "#/definitions/schemaArray" }, + anyOf: { $ref: "#/definitions/schemaArray" }, + oneOf: { $ref: "#/definitions/schemaArray" }, + not: { $ref: "#" } + }, + dependencies: { + exclusiveMaximum: ["maximum"], + exclusiveMinimum: ["minimum"] + }, + default: { } +}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +var ajvOrig = (additionalOptions = {}) => { + const ajv = new Ajv__default["default"]({ + meta: false, + useDefaults: true, + validateSchema: false, + missingRefs: "ignore", + verbose: true, + schemaId: "auto", + ...additionalOptions + }); + + ajv.addMetaSchema(metaSchema); + // eslint-disable-next-line no-underscore-dangle + ajv._opts.defaultMeta = metaSchema.id; + + return ajv; +}; + +/** + * @fileoverview Defines a schema for configs. + * @author Sylvan Mably + */ + +const baseConfigProperties = { + $schema: { type: "string" }, + env: { type: "object" }, + extends: { $ref: "#/definitions/stringOrStrings" }, + globals: { type: "object" }, + overrides: { + type: "array", + items: { $ref: "#/definitions/overrideConfig" }, + additionalItems: false + }, + parser: { type: ["string", "null"] }, + parserOptions: { type: "object" }, + plugins: { type: "array" }, + processor: { type: "string" }, + rules: { type: "object" }, + settings: { type: "object" }, + noInlineConfig: { type: "boolean" }, + reportUnusedDisableDirectives: { type: "boolean" }, + + ecmaFeatures: { type: "object" } // deprecated; logs a warning when used +}; + +const configSchema = { + definitions: { + stringOrStrings: { + oneOf: [ + { type: "string" }, + { + type: "array", + items: { type: "string" }, + additionalItems: false + } + ] + }, + stringOrStringsRequired: { + oneOf: [ + { type: "string" }, + { + type: "array", + items: { type: "string" }, + additionalItems: false, + minItems: 1 + } + ] + }, + + // Config at top-level. + objectConfig: { + type: "object", + properties: { + root: { type: "boolean" }, + ignorePatterns: { $ref: "#/definitions/stringOrStrings" }, + ...baseConfigProperties + }, + additionalProperties: false + }, + + // Config in `overrides`. + overrideConfig: { + type: "object", + properties: { + excludedFiles: { $ref: "#/definitions/stringOrStrings" }, + files: { $ref: "#/definitions/stringOrStringsRequired" }, + ...baseConfigProperties + }, + required: ["files"], + additionalProperties: false + } + }, + + $ref: "#/definitions/objectConfig" +}; + +/** + * @fileoverview Defines environment settings and globals. + * @author Elan Shanker + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the object that has difference. + * @param {Record} current The newer object. + * @param {Record} prev The older object. + * @returns {Record} The difference object. + */ +function getDiff(current, prev) { + const retv = {}; + + for (const [key, value] of Object.entries(current)) { + if (!Object.hasOwnProperty.call(prev, key)) { + retv[key] = value; + } + } + + return retv; +} + +const newGlobals2015 = getDiff(globals__default["default"].es2015, globals__default["default"].es5); // 19 variables such as Promise, Map, ... +const newGlobals2017 = { + Atomics: false, + SharedArrayBuffer: false +}; +const newGlobals2020 = { + BigInt: false, + BigInt64Array: false, + BigUint64Array: false, + globalThis: false +}; + +const newGlobals2021 = { + AggregateError: false, + FinalizationRegistry: false, + WeakRef: false +}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** @type {Map} */ +var environments = new Map(Object.entries({ + + // Language + builtin: { + globals: globals__default["default"].es5 + }, + es6: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2015: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2016: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 7 + } + }, + es2017: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 8 + } + }, + es2018: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 9 + } + }, + es2019: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 10 + } + }, + es2020: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 }, + parserOptions: { + ecmaVersion: 11 + } + }, + es2021: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 12 + } + }, + es2022: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 13 + } + }, + + // Platforms + browser: { + globals: globals__default["default"].browser + }, + node: { + globals: globals__default["default"].node, + parserOptions: { + ecmaFeatures: { + globalReturn: true + } + } + }, + "shared-node-browser": { + globals: globals__default["default"]["shared-node-browser"] + }, + worker: { + globals: globals__default["default"].worker + }, + serviceworker: { + globals: globals__default["default"].serviceworker + }, + + // Frameworks + commonjs: { + globals: globals__default["default"].commonjs, + parserOptions: { + ecmaFeatures: { + globalReturn: true + } + } + }, + amd: { + globals: globals__default["default"].amd + }, + mocha: { + globals: globals__default["default"].mocha + }, + jasmine: { + globals: globals__default["default"].jasmine + }, + jest: { + globals: globals__default["default"].jest + }, + phantomjs: { + globals: globals__default["default"].phantomjs + }, + jquery: { + globals: globals__default["default"].jquery + }, + qunit: { + globals: globals__default["default"].qunit + }, + prototypejs: { + globals: globals__default["default"].prototypejs + }, + shelljs: { + globals: globals__default["default"].shelljs + }, + meteor: { + globals: globals__default["default"].meteor + }, + mongo: { + globals: globals__default["default"].mongo + }, + protractor: { + globals: globals__default["default"].protractor + }, + applescript: { + globals: globals__default["default"].applescript + }, + nashorn: { + globals: globals__default["default"].nashorn + }, + atomtest: { + globals: globals__default["default"].atomtest + }, + embertest: { + globals: globals__default["default"].embertest + }, + webextensions: { + globals: globals__default["default"].webextensions + }, + greasemonkey: { + globals: globals__default["default"].greasemonkey + } +})); + +/** + * @fileoverview Validates configs. + * @author Brandon Mills + */ + +const ajv = ajvOrig(); + +const ruleValidators = new WeakMap(); +const noop = Function.prototype; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ +let validateSchema; +const severityMap = { + error: 2, + warn: 1, + off: 0 +}; + +const validated = new WeakSet(); + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +class ConfigValidator { + constructor({ builtInRules = new Map() } = {}) { + this.builtInRules = builtInRules; + } + + /** + * Gets a complete options schema for a rule. + * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object + * @returns {Object} JSON Schema for the rule's options. + */ + getRuleOptionsSchema(rule) { + if (!rule) { + return null; + } + + const schema = rule.schema || rule.meta && rule.meta.schema; + + // Given a tuple of schemas, insert warning level at the beginning + if (Array.isArray(schema)) { + if (schema.length) { + return { + type: "array", + items: schema, + minItems: 0, + maxItems: schema.length + }; + } + return { + type: "array", + minItems: 0, + maxItems: 0 + }; + + } + + // Given a full schema, leave it alone + return schema || null; + } + + /** + * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid. + * @param {options} options The given options for the rule. + * @returns {number|string} The rule's severity value + */ + validateRuleSeverity(options) { + const severity = Array.isArray(options) ? options[0] : options; + const normSeverity = typeof severity === "string" ? severityMap[severity.toLowerCase()] : severity; + + if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) { + return normSeverity; + } + + throw new Error(`\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util__default["default"].inspect(severity).replace(/'/gu, "\"").replace(/\n/gu, "")}').\n`); + + } + + /** + * Validates the non-severity options passed to a rule, based on its schema. + * @param {{create: Function}} rule The rule to validate + * @param {Array} localOptions The options for the rule, excluding severity + * @returns {void} + */ + validateRuleSchema(rule, localOptions) { + if (!ruleValidators.has(rule)) { + const schema = this.getRuleOptionsSchema(rule); + + if (schema) { + ruleValidators.set(rule, ajv.compile(schema)); + } + } + + const validateRule = ruleValidators.get(rule); + + if (validateRule) { + validateRule(localOptions); + if (validateRule.errors) { + throw new Error(validateRule.errors.map( + error => `\tValue ${JSON.stringify(error.data)} ${error.message}.\n` + ).join("")); + } + } + } + + /** + * Validates a rule's options against its schema. + * @param {{create: Function}|null} rule The rule that the config is being validated for + * @param {string} ruleId The rule's unique name. + * @param {Array|number} options The given options for the rule. + * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined, + * no source is prepended to the message. + * @returns {void} + */ + validateRuleOptions(rule, ruleId, options, source = null) { + try { + const severity = this.validateRuleSeverity(options); + + if (severity !== 0) { + this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []); + } + } catch (err) { + const enhancedMessage = `Configuration for rule "${ruleId}" is invalid:\n${err.message}`; + + if (typeof source === "string") { + throw new Error(`${source}:\n\t${enhancedMessage}`); + } else { + throw new Error(enhancedMessage); + } + } + } + + /** + * Validates an environment object + * @param {Object} environment The environment config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded environments. + * @returns {void} + */ + validateEnvironment( + environment, + source, + getAdditionalEnv = noop + ) { + + // not having an environment is ok + if (!environment) { + return; + } + + Object.keys(environment).forEach(id => { + const env = getAdditionalEnv(id) || environments.get(id) || null; + + if (!env) { + const message = `${source}:\n\tEnvironment key "${id}" is unknown\n`; + + throw new Error(message); + } + }); + } + + /** + * Validates a rules config object + * @param {Object} rulesConfig The rules config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(ruleId:string): Object} getAdditionalRule A map from strings to loaded rules + * @returns {void} + */ + validateRules( + rulesConfig, + source, + getAdditionalRule = noop + ) { + if (!rulesConfig) { + return; + } + + Object.keys(rulesConfig).forEach(id => { + const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null; + + this.validateRuleOptions(rule, id, rulesConfig[id], source); + }); + } + + /** + * Validates a `globals` section of a config file + * @param {Object} globalsConfig The `globals` section + * @param {string|null} source The name of the configuration source to report in the event of an error. + * @returns {void} + */ + validateGlobals(globalsConfig, source = null) { + if (!globalsConfig) { + return; + } + + Object.entries(globalsConfig) + .forEach(([configuredGlobal, configuredValue]) => { + try { + normalizeConfigGlobal(configuredValue); + } catch (err) { + throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\n${err.message}`); + } + }); + } + + /** + * Validate `processor` configuration. + * @param {string|undefined} processorName The processor name. + * @param {string} source The name of config file. + * @param {function(id:string): Processor} getProcessor The getter of defined processors. + * @returns {void} + */ + validateProcessor(processorName, source, getProcessor) { + if (processorName && !getProcessor(processorName)) { + throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`); + } + } + + /** + * Formats an array of schema validation errors. + * @param {Array} errors An array of error messages to format. + * @returns {string} Formatted error message + */ + formatErrors(errors) { + return errors.map(error => { + if (error.keyword === "additionalProperties") { + const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty; + + return `Unexpected top-level property "${formattedPropertyPath}"`; + } + if (error.keyword === "type") { + const formattedField = error.dataPath.slice(1); + const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join("/") : error.schema; + const formattedValue = JSON.stringify(error.data); + + return `Property "${formattedField}" is the wrong type (expected ${formattedExpectedType} but got \`${formattedValue}\`)`; + } + + const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath; + + return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`; + }).map(message => `\t- ${message}.\n`).join(""); + } + + /** + * Validates the top level properties of the config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @returns {void} + */ + validateConfigSchema(config, source = null) { + validateSchema = validateSchema || ajv.compile(configSchema); + + if (!validateSchema(config)) { + throw new Error(`ESLint configuration in ${source} is invalid:\n${this.formatErrors(validateSchema.errors)}`); + } + + if (Object.hasOwnProperty.call(config, "ecmaFeatures")) { + emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES"); + } + } + + /** + * Validates an entire config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(ruleId:string): Object} [getAdditionalRule] A map from strings to loaded rules. + * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded envs. + * @returns {void} + */ + validate(config, source, getAdditionalRule, getAdditionalEnv) { + this.validateConfigSchema(config, source); + this.validateRules(config.rules, source, getAdditionalRule); + this.validateEnvironment(config.env, source, getAdditionalEnv); + this.validateGlobals(config.globals, source); + + for (const override of config.overrides || []) { + this.validateRules(override.rules, source, getAdditionalRule); + this.validateEnvironment(override.env, source, getAdditionalEnv); + this.validateGlobals(config.globals, source); + } + } + + /** + * Validate config array object. + * @param {ConfigArray} configArray The config array to validate. + * @returns {void} + */ + validateConfigArray(configArray) { + const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments); + const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors); + const getPluginRule = Map.prototype.get.bind(configArray.pluginRules); + + // Validate. + for (const element of configArray) { + if (validated.has(element)) { + continue; + } + validated.add(element); + + this.validateEnvironment(element.env, element.name, getPluginEnv); + this.validateGlobals(element.globals, element.name); + this.validateProcessor(element.processor, element.name, getPluginProcessor); + this.validateRules(element.rules, element.name, getPluginRule); + } + } + +} + +/** + * @fileoverview Common helpers for naming of plugins, formatters and configs + */ + +const NAMESPACE_REGEX = /^@.*\//iu; + +/** + * Brings package name to correct format based on prefix + * @param {string} name The name of the package. + * @param {string} prefix Can be either "eslint-plugin", "eslint-config" or "eslint-formatter" + * @returns {string} Normalized name of the package + * @private + */ +function normalizePackageName(name, prefix) { + let normalizedName = name; + + /** + * On Windows, name can come in with Windows slashes instead of Unix slashes. + * Normalize to Unix first to avoid errors later on. + * https://github.com/eslint/eslint/issues/5644 + */ + if (normalizedName.includes("\\")) { + normalizedName = normalizedName.replace(/\\/gu, "/"); + } + + if (normalizedName.charAt(0) === "@") { + + /** + * it's a scoped package + * package name is the prefix, or just a username + */ + const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, "u"), + scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, "u"); + + if (scopedPackageShortcutRegex.test(normalizedName)) { + normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`); + } else if (!scopedPackageNameRegex.test(normalizedName.split("/")[1])) { + + /** + * for scoped packages, insert the prefix after the first / unless + * the path is already @scope/eslint or @scope/eslint-xxx-yyy + */ + normalizedName = normalizedName.replace(/^@([^/]+)\/(.*)$/u, `@$1/${prefix}-$2`); + } + } else if (!normalizedName.startsWith(`${prefix}-`)) { + normalizedName = `${prefix}-${normalizedName}`; + } + + return normalizedName; +} + +/** + * Removes the prefix from a fullname. + * @param {string} fullname The term which may have the prefix. + * @param {string} prefix The prefix to remove. + * @returns {string} The term without prefix. + */ +function getShorthandName(fullname, prefix) { + if (fullname[0] === "@") { + let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, "u").exec(fullname); + + if (matchResult) { + return matchResult[1]; + } + + matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, "u").exec(fullname); + if (matchResult) { + return `${matchResult[1]}/${matchResult[2]}`; + } + } else if (fullname.startsWith(`${prefix}-`)) { + return fullname.slice(prefix.length + 1); + } + + return fullname; +} + +/** + * Gets the scope (namespace) of a term. + * @param {string} term The term which may have the namespace. + * @returns {string} The namespace of the term if it has one. + */ +function getNamespaceFromTerm(term) { + const match = term.match(NAMESPACE_REGEX); + + return match ? match[0] : ""; +} + +var naming = { + __proto__: null, + normalizePackageName: normalizePackageName, + getShorthandName: getShorthandName, + getNamespaceFromTerm: getNamespaceFromTerm +}; + +/** + * @fileoverview Package exports for @eslint/eslintrc + * @author Nicholas C. Zakas + */ + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +const Legacy = { + environments, + + // shared + ConfigOps, + ConfigValidator, + naming +}; + +exports.Legacy = Legacy; +//# sourceMappingURL=eslintrc-universal.cjs.map diff --git a/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map b/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map new file mode 100644 index 000000000..72665f644 --- /dev/null +++ b/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"eslintrc-universal.cjs","sources":["../lib/shared/config-ops.js","../lib/shared/deprecation-warnings.js","../lib/shared/ajv.js","../conf/config-schema.js","../conf/environments.js","../lib/shared/config-validator.js","../lib/shared/naming.js","../lib/index-universal.js"],"sourcesContent":["/**\n * @fileoverview Config file operations. This file must be usable in the browser,\n * so no Node-specific code can be here.\n * @author Nicholas C. Zakas\n */\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\nconst RULE_SEVERITY_STRINGS = [\"off\", \"warn\", \"error\"],\n RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => {\n map[value] = index;\n return map;\n }, {}),\n VALID_SEVERITIES = [0, 1, 2, \"off\", \"warn\", \"error\"];\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * Normalizes the severity value of a rule's configuration to a number\n * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally\n * received from the user. A valid config value is either 0, 1, 2, the string \"off\" (treated the same as 0),\n * the string \"warn\" (treated the same as 1), the string \"error\" (treated the same as 2), or an array\n * whose first element is one of the above values. Strings are matched case-insensitively.\n * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0.\n */\nfunction getRuleSeverity(ruleConfig) {\n const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (severityValue === 0 || severityValue === 1 || severityValue === 2) {\n return severityValue;\n }\n\n if (typeof severityValue === \"string\") {\n return RULE_SEVERITY[severityValue.toLowerCase()] || 0;\n }\n\n return 0;\n}\n\n/**\n * Converts old-style severity settings (0, 1, 2) into new-style\n * severity settings (off, warn, error) for all rules. Assumption is that severity\n * values have already been validated as correct.\n * @param {Object} config The config object to normalize.\n * @returns {void}\n */\nfunction normalizeToStrings(config) {\n\n if (config.rules) {\n Object.keys(config.rules).forEach(ruleId => {\n const ruleConfig = config.rules[ruleId];\n\n if (typeof ruleConfig === \"number\") {\n config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0];\n } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === \"number\") {\n ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0];\n }\n });\n }\n}\n\n/**\n * Determines if the severity for the given rule configuration represents an error.\n * @param {int|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} True if the rule represents an error, false if not.\n */\nfunction isErrorSeverity(ruleConfig) {\n return getRuleSeverity(ruleConfig) === 2;\n}\n\n/**\n * Checks whether a given config has valid severity or not.\n * @param {number|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isValidSeverity(ruleConfig) {\n let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (typeof severity === \"string\") {\n severity = severity.toLowerCase();\n }\n return VALID_SEVERITIES.indexOf(severity) !== -1;\n}\n\n/**\n * Checks whether every rule of a given config has valid severity or not.\n * @param {Object} config The configuration for rules.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isEverySeverityValid(config) {\n return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId]));\n}\n\n/**\n * Normalizes a value for a global in a config\n * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in\n * a global directive comment\n * @returns {(\"readable\"|\"writeable\"|\"off\")} The value normalized as a string\n * @throws Error if global value is invalid\n */\nfunction normalizeConfigGlobal(configuredValue) {\n switch (configuredValue) {\n case \"off\":\n return \"off\";\n\n case true:\n case \"true\":\n case \"writeable\":\n case \"writable\":\n return \"writable\";\n\n case null:\n case false:\n case \"false\":\n case \"readable\":\n case \"readonly\":\n return \"readonly\";\n\n default:\n throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`);\n }\n}\n\nexport {\n getRuleSeverity,\n normalizeToStrings,\n isErrorSeverity,\n isValidSeverity,\n isEverySeverityValid,\n normalizeConfigGlobal\n};\n","/**\n * @fileoverview Provide the function that emits deprecation warnings.\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport path from \"path\";\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\n// Defitions for deprecation warnings.\nconst deprecationWarningMessages = {\n ESLINT_LEGACY_ECMAFEATURES:\n \"The 'ecmaFeatures' config file property is deprecated and has no effect.\",\n ESLINT_PERSONAL_CONFIG_LOAD:\n \"'~/.eslintrc.*' config files have been deprecated. \" +\n \"Please use a config file per project or the '--config' option.\",\n ESLINT_PERSONAL_CONFIG_SUPPRESS:\n \"'~/.eslintrc.*' config files have been deprecated. \" +\n \"Please remove it or add 'root:true' to the config files in your \" +\n \"projects in order to avoid loading '~/.eslintrc.*' accidentally.\"\n};\n\nconst sourceFileErrorCache = new Set();\n\n/**\n * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted\n * for each unique file path, but repeated invocations with the same file path have no effect.\n * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active.\n * @param {string} source The name of the configuration source to report the warning for.\n * @param {string} errorCode The warning message to show.\n * @returns {void}\n */\nfunction emitDeprecationWarning(source, errorCode) {\n const cacheKey = JSON.stringify({ source, errorCode });\n\n if (sourceFileErrorCache.has(cacheKey)) {\n return;\n }\n sourceFileErrorCache.add(cacheKey);\n\n const rel = path.relative(process.cwd(), source);\n const message = deprecationWarningMessages[errorCode];\n\n process.emitWarning(\n `${message} (found in \"${rel}\")`,\n \"DeprecationWarning\",\n errorCode\n );\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport {\n emitDeprecationWarning\n};\n","/**\n * @fileoverview The instance of Ajv validator.\n * @author Evgeny Poberezkin\n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport Ajv from \"ajv\";\n\n//-----------------------------------------------------------------------------\n// Helpers\n//-----------------------------------------------------------------------------\n\n/*\n * Copied from ajv/lib/refs/json-schema-draft-04.json\n * The MIT License (MIT)\n * Copyright (c) 2015-2017 Evgeny Poberezkin\n */\nconst metaSchema = {\n id: \"http://json-schema.org/draft-04/schema#\",\n $schema: \"http://json-schema.org/draft-04/schema#\",\n description: \"Core schema meta-schema\",\n definitions: {\n schemaArray: {\n type: \"array\",\n minItems: 1,\n items: { $ref: \"#\" }\n },\n positiveInteger: {\n type: \"integer\",\n minimum: 0\n },\n positiveIntegerDefault0: {\n allOf: [{ $ref: \"#/definitions/positiveInteger\" }, { default: 0 }]\n },\n simpleTypes: {\n enum: [\"array\", \"boolean\", \"integer\", \"null\", \"number\", \"object\", \"string\"]\n },\n stringArray: {\n type: \"array\",\n items: { type: \"string\" },\n minItems: 1,\n uniqueItems: true\n }\n },\n type: \"object\",\n properties: {\n id: {\n type: \"string\"\n },\n $schema: {\n type: \"string\"\n },\n title: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n default: { },\n multipleOf: {\n type: \"number\",\n minimum: 0,\n exclusiveMinimum: true\n },\n maximum: {\n type: \"number\"\n },\n exclusiveMaximum: {\n type: \"boolean\",\n default: false\n },\n minimum: {\n type: \"number\"\n },\n exclusiveMinimum: {\n type: \"boolean\",\n default: false\n },\n maxLength: { $ref: \"#/definitions/positiveInteger\" },\n minLength: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n pattern: {\n type: \"string\",\n format: \"regex\"\n },\n additionalItems: {\n anyOf: [\n { type: \"boolean\" },\n { $ref: \"#\" }\n ],\n default: { }\n },\n items: {\n anyOf: [\n { $ref: \"#\" },\n { $ref: \"#/definitions/schemaArray\" }\n ],\n default: { }\n },\n maxItems: { $ref: \"#/definitions/positiveInteger\" },\n minItems: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n uniqueItems: {\n type: \"boolean\",\n default: false\n },\n maxProperties: { $ref: \"#/definitions/positiveInteger\" },\n minProperties: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n required: { $ref: \"#/definitions/stringArray\" },\n additionalProperties: {\n anyOf: [\n { type: \"boolean\" },\n { $ref: \"#\" }\n ],\n default: { }\n },\n definitions: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n properties: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n patternProperties: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n dependencies: {\n type: \"object\",\n additionalProperties: {\n anyOf: [\n { $ref: \"#\" },\n { $ref: \"#/definitions/stringArray\" }\n ]\n }\n },\n enum: {\n type: \"array\",\n minItems: 1,\n uniqueItems: true\n },\n type: {\n anyOf: [\n { $ref: \"#/definitions/simpleTypes\" },\n {\n type: \"array\",\n items: { $ref: \"#/definitions/simpleTypes\" },\n minItems: 1,\n uniqueItems: true\n }\n ]\n },\n format: { type: \"string\" },\n allOf: { $ref: \"#/definitions/schemaArray\" },\n anyOf: { $ref: \"#/definitions/schemaArray\" },\n oneOf: { $ref: \"#/definitions/schemaArray\" },\n not: { $ref: \"#\" }\n },\n dependencies: {\n exclusiveMaximum: [\"maximum\"],\n exclusiveMinimum: [\"minimum\"]\n },\n default: { }\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport default (additionalOptions = {}) => {\n const ajv = new Ajv({\n meta: false,\n useDefaults: true,\n validateSchema: false,\n missingRefs: \"ignore\",\n verbose: true,\n schemaId: \"auto\",\n ...additionalOptions\n });\n\n ajv.addMetaSchema(metaSchema);\n // eslint-disable-next-line no-underscore-dangle\n ajv._opts.defaultMeta = metaSchema.id;\n\n return ajv;\n};\n","/**\n * @fileoverview Defines a schema for configs.\n * @author Sylvan Mably\n */\n\nconst baseConfigProperties = {\n $schema: { type: \"string\" },\n env: { type: \"object\" },\n extends: { $ref: \"#/definitions/stringOrStrings\" },\n globals: { type: \"object\" },\n overrides: {\n type: \"array\",\n items: { $ref: \"#/definitions/overrideConfig\" },\n additionalItems: false\n },\n parser: { type: [\"string\", \"null\"] },\n parserOptions: { type: \"object\" },\n plugins: { type: \"array\" },\n processor: { type: \"string\" },\n rules: { type: \"object\" },\n settings: { type: \"object\" },\n noInlineConfig: { type: \"boolean\" },\n reportUnusedDisableDirectives: { type: \"boolean\" },\n\n ecmaFeatures: { type: \"object\" } // deprecated; logs a warning when used\n};\n\nconst configSchema = {\n definitions: {\n stringOrStrings: {\n oneOf: [\n { type: \"string\" },\n {\n type: \"array\",\n items: { type: \"string\" },\n additionalItems: false\n }\n ]\n },\n stringOrStringsRequired: {\n oneOf: [\n { type: \"string\" },\n {\n type: \"array\",\n items: { type: \"string\" },\n additionalItems: false,\n minItems: 1\n }\n ]\n },\n\n // Config at top-level.\n objectConfig: {\n type: \"object\",\n properties: {\n root: { type: \"boolean\" },\n ignorePatterns: { $ref: \"#/definitions/stringOrStrings\" },\n ...baseConfigProperties\n },\n additionalProperties: false\n },\n\n // Config in `overrides`.\n overrideConfig: {\n type: \"object\",\n properties: {\n excludedFiles: { $ref: \"#/definitions/stringOrStrings\" },\n files: { $ref: \"#/definitions/stringOrStringsRequired\" },\n ...baseConfigProperties\n },\n required: [\"files\"],\n additionalProperties: false\n }\n },\n\n $ref: \"#/definitions/objectConfig\"\n};\n\nexport default configSchema;\n","/**\n * @fileoverview Defines environment settings and globals.\n * @author Elan Shanker\n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport globals from \"globals\";\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Get the object that has difference.\n * @param {Record} current The newer object.\n * @param {Record} prev The older object.\n * @returns {Record} The difference object.\n */\nfunction getDiff(current, prev) {\n const retv = {};\n\n for (const [key, value] of Object.entries(current)) {\n if (!Object.hasOwnProperty.call(prev, key)) {\n retv[key] = value;\n }\n }\n\n return retv;\n}\n\nconst newGlobals2015 = getDiff(globals.es2015, globals.es5); // 19 variables such as Promise, Map, ...\nconst newGlobals2017 = {\n Atomics: false,\n SharedArrayBuffer: false\n};\nconst newGlobals2020 = {\n BigInt: false,\n BigInt64Array: false,\n BigUint64Array: false,\n globalThis: false\n};\n\nconst newGlobals2021 = {\n AggregateError: false,\n FinalizationRegistry: false,\n WeakRef: false\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/** @type {Map} */\nexport default new Map(Object.entries({\n\n // Language\n builtin: {\n globals: globals.es5\n },\n es6: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2015: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2016: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 7\n }\n },\n es2017: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 8\n }\n },\n es2018: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 9\n }\n },\n es2019: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 10\n }\n },\n es2020: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 },\n parserOptions: {\n ecmaVersion: 11\n }\n },\n es2021: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 12\n }\n },\n es2022: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 13\n }\n },\n\n // Platforms\n browser: {\n globals: globals.browser\n },\n node: {\n globals: globals.node,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n \"shared-node-browser\": {\n globals: globals[\"shared-node-browser\"]\n },\n worker: {\n globals: globals.worker\n },\n serviceworker: {\n globals: globals.serviceworker\n },\n\n // Frameworks\n commonjs: {\n globals: globals.commonjs,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n amd: {\n globals: globals.amd\n },\n mocha: {\n globals: globals.mocha\n },\n jasmine: {\n globals: globals.jasmine\n },\n jest: {\n globals: globals.jest\n },\n phantomjs: {\n globals: globals.phantomjs\n },\n jquery: {\n globals: globals.jquery\n },\n qunit: {\n globals: globals.qunit\n },\n prototypejs: {\n globals: globals.prototypejs\n },\n shelljs: {\n globals: globals.shelljs\n },\n meteor: {\n globals: globals.meteor\n },\n mongo: {\n globals: globals.mongo\n },\n protractor: {\n globals: globals.protractor\n },\n applescript: {\n globals: globals.applescript\n },\n nashorn: {\n globals: globals.nashorn\n },\n atomtest: {\n globals: globals.atomtest\n },\n embertest: {\n globals: globals.embertest\n },\n webextensions: {\n globals: globals.webextensions\n },\n greasemonkey: {\n globals: globals.greasemonkey\n }\n}));\n","/**\n * @fileoverview Validates configs.\n * @author Brandon Mills\n */\n\n/* eslint class-methods-use-this: \"off\" */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport util from \"util\";\nimport * as ConfigOps from \"./config-ops.js\";\nimport { emitDeprecationWarning } from \"./deprecation-warnings.js\";\nimport ajvOrig from \"./ajv.js\";\nimport configSchema from \"../../conf/config-schema.js\";\nimport BuiltInEnvironments from \"../../conf/environments.js\";\n\nconst ajv = ajvOrig();\n\nconst ruleValidators = new WeakMap();\nconst noop = Function.prototype;\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\nlet validateSchema;\nconst severityMap = {\n error: 2,\n warn: 1,\n off: 0\n};\n\nconst validated = new WeakSet();\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\nexport default class ConfigValidator {\n constructor({ builtInRules = new Map() } = {}) {\n this.builtInRules = builtInRules;\n }\n\n /**\n * Gets a complete options schema for a rule.\n * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object\n * @returns {Object} JSON Schema for the rule's options.\n */\n getRuleOptionsSchema(rule) {\n if (!rule) {\n return null;\n }\n\n const schema = rule.schema || rule.meta && rule.meta.schema;\n\n // Given a tuple of schemas, insert warning level at the beginning\n if (Array.isArray(schema)) {\n if (schema.length) {\n return {\n type: \"array\",\n items: schema,\n minItems: 0,\n maxItems: schema.length\n };\n }\n return {\n type: \"array\",\n minItems: 0,\n maxItems: 0\n };\n\n }\n\n // Given a full schema, leave it alone\n return schema || null;\n }\n\n /**\n * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid.\n * @param {options} options The given options for the rule.\n * @returns {number|string} The rule's severity value\n */\n validateRuleSeverity(options) {\n const severity = Array.isArray(options) ? options[0] : options;\n const normSeverity = typeof severity === \"string\" ? severityMap[severity.toLowerCase()] : severity;\n\n if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {\n return normSeverity;\n }\n\n throw new Error(`\\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, \"\\\"\").replace(/\\n/gu, \"\")}').\\n`);\n\n }\n\n /**\n * Validates the non-severity options passed to a rule, based on its schema.\n * @param {{create: Function}} rule The rule to validate\n * @param {Array} localOptions The options for the rule, excluding severity\n * @returns {void}\n */\n validateRuleSchema(rule, localOptions) {\n if (!ruleValidators.has(rule)) {\n const schema = this.getRuleOptionsSchema(rule);\n\n if (schema) {\n ruleValidators.set(rule, ajv.compile(schema));\n }\n }\n\n const validateRule = ruleValidators.get(rule);\n\n if (validateRule) {\n validateRule(localOptions);\n if (validateRule.errors) {\n throw new Error(validateRule.errors.map(\n error => `\\tValue ${JSON.stringify(error.data)} ${error.message}.\\n`\n ).join(\"\"));\n }\n }\n }\n\n /**\n * Validates a rule's options against its schema.\n * @param {{create: Function}|null} rule The rule that the config is being validated for\n * @param {string} ruleId The rule's unique name.\n * @param {Array|number} options The given options for the rule.\n * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined,\n * no source is prepended to the message.\n * @returns {void}\n */\n validateRuleOptions(rule, ruleId, options, source = null) {\n try {\n const severity = this.validateRuleSeverity(options);\n\n if (severity !== 0) {\n this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []);\n }\n } catch (err) {\n const enhancedMessage = `Configuration for rule \"${ruleId}\" is invalid:\\n${err.message}`;\n\n if (typeof source === \"string\") {\n throw new Error(`${source}:\\n\\t${enhancedMessage}`);\n } else {\n throw new Error(enhancedMessage);\n }\n }\n }\n\n /**\n * Validates an environment object\n * @param {Object} environment The environment config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded environments.\n * @returns {void}\n */\n validateEnvironment(\n environment,\n source,\n getAdditionalEnv = noop\n ) {\n\n // not having an environment is ok\n if (!environment) {\n return;\n }\n\n Object.keys(environment).forEach(id => {\n const env = getAdditionalEnv(id) || BuiltInEnvironments.get(id) || null;\n\n if (!env) {\n const message = `${source}:\\n\\tEnvironment key \"${id}\" is unknown\\n`;\n\n throw new Error(message);\n }\n });\n }\n\n /**\n * Validates a rules config object\n * @param {Object} rulesConfig The rules config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(ruleId:string): Object} getAdditionalRule A map from strings to loaded rules\n * @returns {void}\n */\n validateRules(\n rulesConfig,\n source,\n getAdditionalRule = noop\n ) {\n if (!rulesConfig) {\n return;\n }\n\n Object.keys(rulesConfig).forEach(id => {\n const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null;\n\n this.validateRuleOptions(rule, id, rulesConfig[id], source);\n });\n }\n\n /**\n * Validates a `globals` section of a config file\n * @param {Object} globalsConfig The `globals` section\n * @param {string|null} source The name of the configuration source to report in the event of an error.\n * @returns {void}\n */\n validateGlobals(globalsConfig, source = null) {\n if (!globalsConfig) {\n return;\n }\n\n Object.entries(globalsConfig)\n .forEach(([configuredGlobal, configuredValue]) => {\n try {\n ConfigOps.normalizeConfigGlobal(configuredValue);\n } catch (err) {\n throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\\n${err.message}`);\n }\n });\n }\n\n /**\n * Validate `processor` configuration.\n * @param {string|undefined} processorName The processor name.\n * @param {string} source The name of config file.\n * @param {function(id:string): Processor} getProcessor The getter of defined processors.\n * @returns {void}\n */\n validateProcessor(processorName, source, getProcessor) {\n if (processorName && !getProcessor(processorName)) {\n throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`);\n }\n }\n\n /**\n * Formats an array of schema validation errors.\n * @param {Array} errors An array of error messages to format.\n * @returns {string} Formatted error message\n */\n formatErrors(errors) {\n return errors.map(error => {\n if (error.keyword === \"additionalProperties\") {\n const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty;\n\n return `Unexpected top-level property \"${formattedPropertyPath}\"`;\n }\n if (error.keyword === \"type\") {\n const formattedField = error.dataPath.slice(1);\n const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join(\"/\") : error.schema;\n const formattedValue = JSON.stringify(error.data);\n\n return `Property \"${formattedField}\" is the wrong type (expected ${formattedExpectedType} but got \\`${formattedValue}\\`)`;\n }\n\n const field = error.dataPath[0] === \".\" ? error.dataPath.slice(1) : error.dataPath;\n\n return `\"${field}\" ${error.message}. Value: ${JSON.stringify(error.data)}`;\n }).map(message => `\\t- ${message}.\\n`).join(\"\");\n }\n\n /**\n * Validates the top level properties of the config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @returns {void}\n */\n validateConfigSchema(config, source = null) {\n validateSchema = validateSchema || ajv.compile(configSchema);\n\n if (!validateSchema(config)) {\n throw new Error(`ESLint configuration in ${source} is invalid:\\n${this.formatErrors(validateSchema.errors)}`);\n }\n\n if (Object.hasOwnProperty.call(config, \"ecmaFeatures\")) {\n emitDeprecationWarning(source, \"ESLINT_LEGACY_ECMAFEATURES\");\n }\n }\n\n /**\n * Validates an entire config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(ruleId:string): Object} [getAdditionalRule] A map from strings to loaded rules.\n * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded envs.\n * @returns {void}\n */\n validate(config, source, getAdditionalRule, getAdditionalEnv) {\n this.validateConfigSchema(config, source);\n this.validateRules(config.rules, source, getAdditionalRule);\n this.validateEnvironment(config.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n\n for (const override of config.overrides || []) {\n this.validateRules(override.rules, source, getAdditionalRule);\n this.validateEnvironment(override.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n }\n }\n\n /**\n * Validate config array object.\n * @param {ConfigArray} configArray The config array to validate.\n * @returns {void}\n */\n validateConfigArray(configArray) {\n const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments);\n const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors);\n const getPluginRule = Map.prototype.get.bind(configArray.pluginRules);\n\n // Validate.\n for (const element of configArray) {\n if (validated.has(element)) {\n continue;\n }\n validated.add(element);\n\n this.validateEnvironment(element.env, element.name, getPluginEnv);\n this.validateGlobals(element.globals, element.name);\n this.validateProcessor(element.processor, element.name, getPluginProcessor);\n this.validateRules(element.rules, element.name, getPluginRule);\n }\n }\n\n}\n","/**\n * @fileoverview Common helpers for naming of plugins, formatters and configs\n */\n\nconst NAMESPACE_REGEX = /^@.*\\//iu;\n\n/**\n * Brings package name to correct format based on prefix\n * @param {string} name The name of the package.\n * @param {string} prefix Can be either \"eslint-plugin\", \"eslint-config\" or \"eslint-formatter\"\n * @returns {string} Normalized name of the package\n * @private\n */\nfunction normalizePackageName(name, prefix) {\n let normalizedName = name;\n\n /**\n * On Windows, name can come in with Windows slashes instead of Unix slashes.\n * Normalize to Unix first to avoid errors later on.\n * https://github.com/eslint/eslint/issues/5644\n */\n if (normalizedName.includes(\"\\\\\")) {\n normalizedName = normalizedName.replace(/\\\\/gu, \"/\");\n }\n\n if (normalizedName.charAt(0) === \"@\") {\n\n /**\n * it's a scoped package\n * package name is the prefix, or just a username\n */\n const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, \"u\"),\n scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, \"u\");\n\n if (scopedPackageShortcutRegex.test(normalizedName)) {\n normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`);\n } else if (!scopedPackageNameRegex.test(normalizedName.split(\"/\")[1])) {\n\n /**\n * for scoped packages, insert the prefix after the first / unless\n * the path is already @scope/eslint or @scope/eslint-xxx-yyy\n */\n normalizedName = normalizedName.replace(/^@([^/]+)\\/(.*)$/u, `@$1/${prefix}-$2`);\n }\n } else if (!normalizedName.startsWith(`${prefix}-`)) {\n normalizedName = `${prefix}-${normalizedName}`;\n }\n\n return normalizedName;\n}\n\n/**\n * Removes the prefix from a fullname.\n * @param {string} fullname The term which may have the prefix.\n * @param {string} prefix The prefix to remove.\n * @returns {string} The term without prefix.\n */\nfunction getShorthandName(fullname, prefix) {\n if (fullname[0] === \"@\") {\n let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, \"u\").exec(fullname);\n\n if (matchResult) {\n return matchResult[1];\n }\n\n matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, \"u\").exec(fullname);\n if (matchResult) {\n return `${matchResult[1]}/${matchResult[2]}`;\n }\n } else if (fullname.startsWith(`${prefix}-`)) {\n return fullname.slice(prefix.length + 1);\n }\n\n return fullname;\n}\n\n/**\n * Gets the scope (namespace) of a term.\n * @param {string} term The term which may have the namespace.\n * @returns {string} The namespace of the term if it has one.\n */\nfunction getNamespaceFromTerm(term) {\n const match = term.match(NAMESPACE_REGEX);\n\n return match ? match[0] : \"\";\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport {\n normalizePackageName,\n getShorthandName,\n getNamespaceFromTerm\n};\n","/**\n * @fileoverview Package exports for @eslint/eslintrc\n * @author Nicholas C. Zakas\n */\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport * as ConfigOps from \"./shared/config-ops.js\";\nimport ConfigValidator from \"./shared/config-validator.js\";\nimport * as naming from \"./shared/naming.js\";\nimport environments from \"../conf/environments.js\";\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\nconst Legacy = {\n environments,\n\n // shared\n ConfigOps,\n ConfigValidator,\n naming\n};\n\nexport {\n Legacy\n};\n"],"names":["path","Ajv","globals","util","BuiltInEnvironments","ConfigOps.normalizeConfigGlobal"],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC;AACtD,IAAI,aAAa,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,KAAK;AACxE,QAAQ,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;AAC3B,QAAQ,OAAO,GAAG,CAAC;AACnB,KAAK,EAAE,EAAE,CAAC;AACV,IAAI,gBAAgB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,eAAe,CAAC,UAAU,EAAE;AACrC,IAAI,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC;AACjF;AACA,IAAI,IAAI,aAAa,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC,EAAE;AAC3E,QAAQ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G;AACf,IAAI,YAAY;AAChB;AACA;AACA,IAAI,SAAS;AACb,IAAI,eAAe;AACnB,IAAI,MAAM;AACV;;;;"} \ No newline at end of file diff --git a/node_modules/@eslint/eslintrc/dist/eslintrc.cjs b/node_modules/@eslint/eslintrc/dist/eslintrc.cjs new file mode 100644 index 000000000..a722b6ce1 --- /dev/null +++ b/node_modules/@eslint/eslintrc/dist/eslintrc.cjs @@ -0,0 +1,4310 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var debugOrig = require('debug'); +var fs = require('fs'); +var importFresh = require('import-fresh'); +var Module = require('module'); +var path = require('path'); +var stripComments = require('strip-json-comments'); +var assert = require('assert'); +var ignore = require('ignore'); +var util = require('util'); +var minimatch = require('minimatch'); +var Ajv = require('ajv'); +var globals = require('globals'); +var os = require('os'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +var debugOrig__default = /*#__PURE__*/_interopDefaultLegacy(debugOrig); +var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); +var importFresh__default = /*#__PURE__*/_interopDefaultLegacy(importFresh); +var Module__default = /*#__PURE__*/_interopDefaultLegacy(Module); +var path__default = /*#__PURE__*/_interopDefaultLegacy(path); +var stripComments__default = /*#__PURE__*/_interopDefaultLegacy(stripComments); +var assert__default = /*#__PURE__*/_interopDefaultLegacy(assert); +var ignore__default = /*#__PURE__*/_interopDefaultLegacy(ignore); +var util__default = /*#__PURE__*/_interopDefaultLegacy(util); +var minimatch__default = /*#__PURE__*/_interopDefaultLegacy(minimatch); +var Ajv__default = /*#__PURE__*/_interopDefaultLegacy(Ajv); +var globals__default = /*#__PURE__*/_interopDefaultLegacy(globals); +var os__default = /*#__PURE__*/_interopDefaultLegacy(os); + +/** + * @fileoverview `IgnorePattern` class. + * + * `IgnorePattern` class has the set of glob patterns and the base path. + * + * It provides two static methods. + * + * - `IgnorePattern.createDefaultIgnore(cwd)` + * Create the default predicate function. + * - `IgnorePattern.createIgnore(ignorePatterns)` + * Create the predicate function from multiple `IgnorePattern` objects. + * + * It provides two properties and a method. + * + * - `patterns` + * The glob patterns that ignore to lint. + * - `basePath` + * The base path of the glob patterns. If absolute paths existed in the + * glob patterns, those are handled as relative paths to the base path. + * - `getPatternsRelativeTo(basePath)` + * Get `patterns` as modified for a given base path. It modifies the + * absolute paths in the patterns as prepending the difference of two base + * paths. + * + * `ConfigArrayFactory` creates `IgnorePattern` objects when it processes + * `ignorePatterns` properties. + * + * @author Toru Nagashima + */ + +const debug$3 = debugOrig__default["default"]("eslintrc:ignore-pattern"); + +/** @typedef {ReturnType} Ignore */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the path to the common ancestor directory of given paths. + * @param {string[]} sourcePaths The paths to calculate the common ancestor. + * @returns {string} The path to the common ancestor directory. + */ +function getCommonAncestorPath(sourcePaths) { + let result = sourcePaths[0]; + + for (let i = 1; i < sourcePaths.length; ++i) { + const a = result; + const b = sourcePaths[i]; + + // Set the shorter one (it's the common ancestor if one includes the other). + result = a.length < b.length ? a : b; + + // Set the common ancestor. + for (let j = 0, lastSepPos = 0; j < a.length && j < b.length; ++j) { + if (a[j] !== b[j]) { + result = a.slice(0, lastSepPos); + break; + } + if (a[j] === path__default["default"].sep) { + lastSepPos = j; + } + } + } + + let resolvedResult = result || path__default["default"].sep; + + // if Windows common ancestor is root of drive must have trailing slash to be absolute. + if (resolvedResult && resolvedResult.endsWith(":") && process.platform === "win32") { + resolvedResult += path__default["default"].sep; + } + return resolvedResult; +} + +/** + * Make relative path. + * @param {string} from The source path to get relative path. + * @param {string} to The destination path to get relative path. + * @returns {string} The relative path. + */ +function relative(from, to) { + const relPath = path__default["default"].relative(from, to); + + if (path__default["default"].sep === "/") { + return relPath; + } + return relPath.split(path__default["default"].sep).join("/"); +} + +/** + * Get the trailing slash if existed. + * @param {string} filePath The path to check. + * @returns {string} The trailing slash if existed. + */ +function dirSuffix(filePath) { + const isDir = ( + filePath.endsWith(path__default["default"].sep) || + (process.platform === "win32" && filePath.endsWith("/")) + ); + + return isDir ? "/" : ""; +} + +const DefaultPatterns = Object.freeze(["/**/node_modules/*"]); +const DotPatterns = Object.freeze([".*", "!.eslintrc.*", "!../"]); + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +class IgnorePattern { + + /** + * The default patterns. + * @type {string[]} + */ + static get DefaultPatterns() { + return DefaultPatterns; + } + + /** + * Create the default predicate function. + * @param {string} cwd The current working directory. + * @returns {((filePath:string, dot:boolean) => boolean) & {basePath:string; patterns:string[]}} + * The preficate function. + * The first argument is an absolute path that is checked. + * The second argument is the flag to not ignore dotfiles. + * If the predicate function returned `true`, it means the path should be ignored. + */ + static createDefaultIgnore(cwd) { + return this.createIgnore([new IgnorePattern(DefaultPatterns, cwd)]); + } + + /** + * Create the predicate function from multiple `IgnorePattern` objects. + * @param {IgnorePattern[]} ignorePatterns The list of ignore patterns. + * @returns {((filePath:string, dot?:boolean) => boolean) & {basePath:string; patterns:string[]}} + * The preficate function. + * The first argument is an absolute path that is checked. + * The second argument is the flag to not ignore dotfiles. + * If the predicate function returned `true`, it means the path should be ignored. + */ + static createIgnore(ignorePatterns) { + debug$3("Create with: %o", ignorePatterns); + + const basePath = getCommonAncestorPath(ignorePatterns.map(p => p.basePath)); + const patterns = [].concat( + ...ignorePatterns.map(p => p.getPatternsRelativeTo(basePath)) + ); + const ig = ignore__default["default"]({ allowRelativePaths: true }).add([...DotPatterns, ...patterns]); + const dotIg = ignore__default["default"]({ allowRelativePaths: true }).add(patterns); + + debug$3(" processed: %o", { basePath, patterns }); + + return Object.assign( + (filePath, dot = false) => { + assert__default["default"](path__default["default"].isAbsolute(filePath), "'filePath' should be an absolute path."); + const relPathRaw = relative(basePath, filePath); + const relPath = relPathRaw && (relPathRaw + dirSuffix(filePath)); + const adoptedIg = dot ? dotIg : ig; + const result = relPath !== "" && adoptedIg.ignores(relPath); + + debug$3("Check", { filePath, dot, relativePath: relPath, result }); + return result; + }, + { basePath, patterns } + ); + } + + /** + * Initialize a new `IgnorePattern` instance. + * @param {string[]} patterns The glob patterns that ignore to lint. + * @param {string} basePath The base path of `patterns`. + */ + constructor(patterns, basePath) { + assert__default["default"](path__default["default"].isAbsolute(basePath), "'basePath' should be an absolute path."); + + /** + * The glob patterns that ignore to lint. + * @type {string[]} + */ + this.patterns = patterns; + + /** + * The base path of `patterns`. + * @type {string} + */ + this.basePath = basePath; + + /** + * If `true` then patterns which don't start with `/` will match the paths to the outside of `basePath`. Defaults to `false`. + * + * It's set `true` for `.eslintignore`, `package.json`, and `--ignore-path` for backward compatibility. + * It's `false` as-is for `ignorePatterns` property in config files. + * @type {boolean} + */ + this.loose = false; + } + + /** + * Get `patterns` as modified for a given base path. It modifies the + * absolute paths in the patterns as prepending the difference of two base + * paths. + * @param {string} newBasePath The base path. + * @returns {string[]} Modifired patterns. + */ + getPatternsRelativeTo(newBasePath) { + assert__default["default"](path__default["default"].isAbsolute(newBasePath), "'newBasePath' should be an absolute path."); + const { basePath, loose, patterns } = this; + + if (newBasePath === basePath) { + return patterns; + } + const prefix = `/${relative(newBasePath, basePath)}`; + + return patterns.map(pattern => { + const negative = pattern.startsWith("!"); + const head = negative ? "!" : ""; + const body = negative ? pattern.slice(1) : pattern; + + if (body.startsWith("/") || body.startsWith("../")) { + return `${head}${prefix}${body}`; + } + return loose ? pattern : `${head}${prefix}/**/${body}`; + }); + } +} + +/** + * @fileoverview `ExtractedConfig` class. + * + * `ExtractedConfig` class expresses a final configuration for a specific file. + * + * It provides one method. + * + * - `toCompatibleObjectAsConfigFileContent()` + * Convert this configuration to the compatible object as the content of + * config files. It converts the loaded parser and plugins to strings. + * `CLIEngine#getConfigForFile(filePath)` method uses this method. + * + * `ConfigArray#extractConfig(filePath)` creates a `ExtractedConfig` instance. + * + * @author Toru Nagashima + */ + +// For VSCode intellisense +/** @typedef {import("../../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../../shared/types").GlobalConf} GlobalConf */ +/** @typedef {import("../../shared/types").SeverityConf} SeverityConf */ +/** @typedef {import("./config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-dependency").DependentPlugin} DependentPlugin */ + +/** + * Check if `xs` starts with `ys`. + * @template T + * @param {T[]} xs The array to check. + * @param {T[]} ys The array that may be the first part of `xs`. + * @returns {boolean} `true` if `xs` starts with `ys`. + */ +function startsWith(xs, ys) { + return xs.length >= ys.length && ys.every((y, i) => y === xs[i]); +} + +/** + * The class for extracted config data. + */ +class ExtractedConfig { + constructor() { + + /** + * The config name what `noInlineConfig` setting came from. + * @type {string} + */ + this.configNameOfNoInlineConfig = ""; + + /** + * Environments. + * @type {Record} + */ + this.env = {}; + + /** + * Global variables. + * @type {Record} + */ + this.globals = {}; + + /** + * The glob patterns that ignore to lint. + * @type {(((filePath:string, dot?:boolean) => boolean) & { basePath:string; patterns:string[] }) | undefined} + */ + this.ignores = void 0; + + /** + * The flag that disables directive comments. + * @type {boolean|undefined} + */ + this.noInlineConfig = void 0; + + /** + * Parser definition. + * @type {DependentParser|null} + */ + this.parser = null; + + /** + * Options for the parser. + * @type {Object} + */ + this.parserOptions = {}; + + /** + * Plugin definitions. + * @type {Record} + */ + this.plugins = {}; + + /** + * Processor ID. + * @type {string|null} + */ + this.processor = null; + + /** + * The flag that reports unused `eslint-disable` directive comments. + * @type {boolean|undefined} + */ + this.reportUnusedDisableDirectives = void 0; + + /** + * Rule settings. + * @type {Record} + */ + this.rules = {}; + + /** + * Shared settings. + * @type {Object} + */ + this.settings = {}; + } + + /** + * Convert this config to the compatible object as a config file content. + * @returns {ConfigData} The converted object. + */ + toCompatibleObjectAsConfigFileContent() { + const { + /* eslint-disable no-unused-vars */ + configNameOfNoInlineConfig: _ignore1, + processor: _ignore2, + /* eslint-enable no-unused-vars */ + ignores, + ...config + } = this; + + config.parser = config.parser && config.parser.filePath; + config.plugins = Object.keys(config.plugins).filter(Boolean).reverse(); + config.ignorePatterns = ignores ? ignores.patterns : []; + + // Strip the default patterns from `ignorePatterns`. + if (startsWith(config.ignorePatterns, IgnorePattern.DefaultPatterns)) { + config.ignorePatterns = + config.ignorePatterns.slice(IgnorePattern.DefaultPatterns.length); + } + + return config; + } +} + +/** + * @fileoverview `ConfigArray` class. + * + * `ConfigArray` class expresses the full of a configuration. It has the entry + * config file, base config files that were extended, loaded parsers, and loaded + * plugins. + * + * `ConfigArray` class provides three properties and two methods. + * + * - `pluginEnvironments` + * - `pluginProcessors` + * - `pluginRules` + * The `Map` objects that contain the members of all plugins that this + * config array contains. Those map objects don't have mutation methods. + * Those keys are the member ID such as `pluginId/memberName`. + * - `isRoot()` + * If `true` then this configuration has `root:true` property. + * - `extractConfig(filePath)` + * Extract the final configuration for a given file. This means merging + * every config array element which that `criteria` property matched. The + * `filePath` argument must be an absolute path. + * + * `ConfigArrayFactory` provides the loading logic of config files. + * + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// Define types for VSCode IntelliSense. +/** @typedef {import("../../shared/types").Environment} Environment */ +/** @typedef {import("../../shared/types").GlobalConf} GlobalConf */ +/** @typedef {import("../../shared/types").RuleConf} RuleConf */ +/** @typedef {import("../../shared/types").Rule} Rule */ +/** @typedef {import("../../shared/types").Plugin} Plugin */ +/** @typedef {import("../../shared/types").Processor} Processor */ +/** @typedef {import("./config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-dependency").DependentPlugin} DependentPlugin */ +/** @typedef {import("./override-tester")["OverrideTester"]} OverrideTester */ + +/** + * @typedef {Object} ConfigArrayElement + * @property {string} name The name of this config element. + * @property {string} filePath The path to the source file of this config element. + * @property {InstanceType|null} criteria The tester for the `files` and `excludedFiles` of this config element. + * @property {Record|undefined} env The environment settings. + * @property {Record|undefined} globals The global variable settings. + * @property {IgnorePattern|undefined} ignorePattern The ignore patterns. + * @property {boolean|undefined} noInlineConfig The flag that disables directive comments. + * @property {DependentParser|undefined} parser The parser loader. + * @property {Object|undefined} parserOptions The parser options. + * @property {Record|undefined} plugins The plugin loaders. + * @property {string|undefined} processor The processor name to refer plugin's processor. + * @property {boolean|undefined} reportUnusedDisableDirectives The flag to report unused `eslint-disable` comments. + * @property {boolean|undefined} root The flag to express root. + * @property {Record|undefined} rules The rule settings + * @property {Object|undefined} settings The shared settings. + * @property {"config" | "ignore" | "implicit-processor"} type The element type. + */ + +/** + * @typedef {Object} ConfigArrayInternalSlots + * @property {Map} cache The cache to extract configs. + * @property {ReadonlyMap|null} envMap The map from environment ID to environment definition. + * @property {ReadonlyMap|null} processorMap The map from processor ID to environment definition. + * @property {ReadonlyMap|null} ruleMap The map from rule ID to rule definition. + */ + +/** @type {WeakMap} */ +const internalSlotsMap$2 = new class extends WeakMap { + get(key) { + let value = super.get(key); + + if (!value) { + value = { + cache: new Map(), + envMap: null, + processorMap: null, + ruleMap: null + }; + super.set(key, value); + } + + return value; + } +}(); + +/** + * Get the indices which are matched to a given file. + * @param {ConfigArrayElement[]} elements The elements. + * @param {string} filePath The path to a target file. + * @returns {number[]} The indices. + */ +function getMatchedIndices(elements, filePath) { + const indices = []; + + for (let i = elements.length - 1; i >= 0; --i) { + const element = elements[i]; + + if (!element.criteria || (filePath && element.criteria.test(filePath))) { + indices.push(i); + } + } + + return indices; +} + +/** + * Check if a value is a non-null object. + * @param {any} x The value to check. + * @returns {boolean} `true` if the value is a non-null object. + */ +function isNonNullObject(x) { + return typeof x === "object" && x !== null; +} + +/** + * Merge two objects. + * + * Assign every property values of `y` to `x` if `x` doesn't have the property. + * If `x`'s property value is an object, it does recursive. + * @param {Object} target The destination to merge + * @param {Object|undefined} source The source to merge. + * @returns {void} + */ +function mergeWithoutOverwrite(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + + if (isNonNullObject(target[key])) { + mergeWithoutOverwrite(target[key], source[key]); + } else if (target[key] === void 0) { + if (isNonNullObject(source[key])) { + target[key] = Array.isArray(source[key]) ? [] : {}; + mergeWithoutOverwrite(target[key], source[key]); + } else if (source[key] !== void 0) { + target[key] = source[key]; + } + } + } +} + +/** + * The error for plugin conflicts. + */ +class PluginConflictError extends Error { + + /** + * Initialize this error object. + * @param {string} pluginId The plugin ID. + * @param {{filePath:string, importerName:string}[]} plugins The resolved plugins. + */ + constructor(pluginId, plugins) { + super(`Plugin "${pluginId}" was conflicted between ${plugins.map(p => `"${p.importerName}"`).join(" and ")}.`); + this.messageTemplate = "plugin-conflict"; + this.messageData = { pluginId, plugins }; + } +} + +/** + * Merge plugins. + * `target`'s definition is prior to `source`'s. + * @param {Record} target The destination to merge + * @param {Record|undefined} source The source to merge. + * @returns {void} + */ +function mergePlugins(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + const targetValue = target[key]; + const sourceValue = source[key]; + + // Adopt the plugin which was found at first. + if (targetValue === void 0) { + if (sourceValue.error) { + throw sourceValue.error; + } + target[key] = sourceValue; + } else if (sourceValue.filePath !== targetValue.filePath) { + throw new PluginConflictError(key, [ + { + filePath: targetValue.filePath, + importerName: targetValue.importerName + }, + { + filePath: sourceValue.filePath, + importerName: sourceValue.importerName + } + ]); + } + } +} + +/** + * Merge rule configs. + * `target`'s definition is prior to `source`'s. + * @param {Record} target The destination to merge + * @param {Record|undefined} source The source to merge. + * @returns {void} + */ +function mergeRuleConfigs(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + const targetDef = target[key]; + const sourceDef = source[key]; + + // Adopt the rule config which was found at first. + if (targetDef === void 0) { + if (Array.isArray(sourceDef)) { + target[key] = [...sourceDef]; + } else { + target[key] = [sourceDef]; + } + + /* + * If the first found rule config is severity only and the current rule + * config has options, merge the severity and the options. + */ + } else if ( + targetDef.length === 1 && + Array.isArray(sourceDef) && + sourceDef.length >= 2 + ) { + targetDef.push(...sourceDef.slice(1)); + } + } +} + +/** + * Create the extracted config. + * @param {ConfigArray} instance The config elements. + * @param {number[]} indices The indices to use. + * @returns {ExtractedConfig} The extracted config. + */ +function createConfig(instance, indices) { + const config = new ExtractedConfig(); + const ignorePatterns = []; + + // Merge elements. + for (const index of indices) { + const element = instance[index]; + + // Adopt the parser which was found at first. + if (!config.parser && element.parser) { + if (element.parser.error) { + throw element.parser.error; + } + config.parser = element.parser; + } + + // Adopt the processor which was found at first. + if (!config.processor && element.processor) { + config.processor = element.processor; + } + + // Adopt the noInlineConfig which was found at first. + if (config.noInlineConfig === void 0 && element.noInlineConfig !== void 0) { + config.noInlineConfig = element.noInlineConfig; + config.configNameOfNoInlineConfig = element.name; + } + + // Adopt the reportUnusedDisableDirectives which was found at first. + if (config.reportUnusedDisableDirectives === void 0 && element.reportUnusedDisableDirectives !== void 0) { + config.reportUnusedDisableDirectives = element.reportUnusedDisableDirectives; + } + + // Collect ignorePatterns + if (element.ignorePattern) { + ignorePatterns.push(element.ignorePattern); + } + + // Merge others. + mergeWithoutOverwrite(config.env, element.env); + mergeWithoutOverwrite(config.globals, element.globals); + mergeWithoutOverwrite(config.parserOptions, element.parserOptions); + mergeWithoutOverwrite(config.settings, element.settings); + mergePlugins(config.plugins, element.plugins); + mergeRuleConfigs(config.rules, element.rules); + } + + // Create the predicate function for ignore patterns. + if (ignorePatterns.length > 0) { + config.ignores = IgnorePattern.createIgnore(ignorePatterns.reverse()); + } + + return config; +} + +/** + * Collect definitions. + * @template T, U + * @param {string} pluginId The plugin ID for prefix. + * @param {Record} defs The definitions to collect. + * @param {Map} map The map to output. + * @param {function(T): U} [normalize] The normalize function for each value. + * @returns {void} + */ +function collect(pluginId, defs, map, normalize) { + if (defs) { + const prefix = pluginId && `${pluginId}/`; + + for (const [key, value] of Object.entries(defs)) { + map.set( + `${prefix}${key}`, + normalize ? normalize(value) : value + ); + } + } +} + +/** + * Normalize a rule definition. + * @param {Function|Rule} rule The rule definition to normalize. + * @returns {Rule} The normalized rule definition. + */ +function normalizePluginRule(rule) { + return typeof rule === "function" ? { create: rule } : rule; +} + +/** + * Delete the mutation methods from a given map. + * @param {Map} map The map object to delete. + * @returns {void} + */ +function deleteMutationMethods(map) { + Object.defineProperties(map, { + clear: { configurable: true, value: void 0 }, + delete: { configurable: true, value: void 0 }, + set: { configurable: true, value: void 0 } + }); +} + +/** + * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array. + * @param {ConfigArrayElement[]} elements The config elements. + * @param {ConfigArrayInternalSlots} slots The internal slots. + * @returns {void} + */ +function initPluginMemberMaps(elements, slots) { + const processed = new Set(); + + slots.envMap = new Map(); + slots.processorMap = new Map(); + slots.ruleMap = new Map(); + + for (const element of elements) { + if (!element.plugins) { + continue; + } + + for (const [pluginId, value] of Object.entries(element.plugins)) { + const plugin = value.definition; + + if (!plugin || processed.has(pluginId)) { + continue; + } + processed.add(pluginId); + + collect(pluginId, plugin.environments, slots.envMap); + collect(pluginId, plugin.processors, slots.processorMap); + collect(pluginId, plugin.rules, slots.ruleMap, normalizePluginRule); + } + } + + deleteMutationMethods(slots.envMap); + deleteMutationMethods(slots.processorMap); + deleteMutationMethods(slots.ruleMap); +} + +/** + * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array. + * @param {ConfigArray} instance The config elements. + * @returns {ConfigArrayInternalSlots} The extracted config. + */ +function ensurePluginMemberMaps(instance) { + const slots = internalSlotsMap$2.get(instance); + + if (!slots.ruleMap) { + initPluginMemberMaps(instance, slots); + } + + return slots; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The Config Array. + * + * `ConfigArray` instance contains all settings, parsers, and plugins. + * You need to call `ConfigArray#extractConfig(filePath)` method in order to + * extract, merge and get only the config data which is related to an arbitrary + * file. + * @extends {Array} + */ +class ConfigArray extends Array { + + /** + * Get the plugin environments. + * The returned map cannot be mutated. + * @type {ReadonlyMap} The plugin environments. + */ + get pluginEnvironments() { + return ensurePluginMemberMaps(this).envMap; + } + + /** + * Get the plugin processors. + * The returned map cannot be mutated. + * @type {ReadonlyMap} The plugin processors. + */ + get pluginProcessors() { + return ensurePluginMemberMaps(this).processorMap; + } + + /** + * Get the plugin rules. + * The returned map cannot be mutated. + * @returns {ReadonlyMap} The plugin rules. + */ + get pluginRules() { + return ensurePluginMemberMaps(this).ruleMap; + } + + /** + * Check if this config has `root` flag. + * @returns {boolean} `true` if this config array is root. + */ + isRoot() { + for (let i = this.length - 1; i >= 0; --i) { + const root = this[i].root; + + if (typeof root === "boolean") { + return root; + } + } + return false; + } + + /** + * Extract the config data which is related to a given file. + * @param {string} filePath The absolute path to the target file. + * @returns {ExtractedConfig} The extracted config data. + */ + extractConfig(filePath) { + const { cache } = internalSlotsMap$2.get(this); + const indices = getMatchedIndices(this, filePath); + const cacheKey = indices.join(","); + + if (!cache.has(cacheKey)) { + cache.set(cacheKey, createConfig(this, indices)); + } + + return cache.get(cacheKey); + } + + /** + * Check if a given path is an additional lint target. + * @param {string} filePath The absolute path to the target file. + * @returns {boolean} `true` if the file is an additional lint target. + */ + isAdditionalTargetPath(filePath) { + for (const { criteria, type } of this) { + if ( + type === "config" && + criteria && + !criteria.endsWithWildcard && + criteria.test(filePath) + ) { + return true; + } + } + return false; + } +} + +/** + * Get the used extracted configs. + * CLIEngine will use this method to collect used deprecated rules. + * @param {ConfigArray} instance The config array object to get. + * @returns {ExtractedConfig[]} The used extracted configs. + * @private + */ +function getUsedExtractedConfigs(instance) { + const { cache } = internalSlotsMap$2.get(instance); + + return Array.from(cache.values()); +} + +/** + * @fileoverview `ConfigDependency` class. + * + * `ConfigDependency` class expresses a loaded parser or plugin. + * + * If the parser or plugin was loaded successfully, it has `definition` property + * and `filePath` property. Otherwise, it has `error` property. + * + * When `JSON.stringify()` converted a `ConfigDependency` object to a JSON, it + * omits `definition` property. + * + * `ConfigArrayFactory` creates `ConfigDependency` objects when it loads parsers + * or plugins. + * + * @author Toru Nagashima + */ + +/** + * The class is to store parsers or plugins. + * This class hides the loaded object from `JSON.stringify()` and `console.log`. + * @template T + */ +class ConfigDependency { + + /** + * Initialize this instance. + * @param {Object} data The dependency data. + * @param {T} [data.definition] The dependency if the loading succeeded. + * @param {Error} [data.error] The error object if the loading failed. + * @param {string} [data.filePath] The actual path to the dependency if the loading succeeded. + * @param {string} data.id The ID of this dependency. + * @param {string} data.importerName The name of the config file which loads this dependency. + * @param {string} data.importerPath The path to the config file which loads this dependency. + */ + constructor({ + definition = null, + error = null, + filePath = null, + id, + importerName, + importerPath + }) { + + /** + * The loaded dependency if the loading succeeded. + * @type {T|null} + */ + this.definition = definition; + + /** + * The error object if the loading failed. + * @type {Error|null} + */ + this.error = error; + + /** + * The loaded dependency if the loading succeeded. + * @type {string|null} + */ + this.filePath = filePath; + + /** + * The ID of this dependency. + * @type {string} + */ + this.id = id; + + /** + * The name of the config file which loads this dependency. + * @type {string} + */ + this.importerName = importerName; + + /** + * The path to the config file which loads this dependency. + * @type {string} + */ + this.importerPath = importerPath; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} a JSON compatible object. + */ + toJSON() { + const obj = this[util__default["default"].inspect.custom](); + + // Display `error.message` (`Error#message` is unenumerable). + if (obj.error instanceof Error) { + obj.error = { ...obj.error, message: obj.error.message }; + } + + return obj; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} an object to display by `console.log()`. + */ + [util__default["default"].inspect.custom]() { + const { + definition: _ignore, // eslint-disable-line no-unused-vars + ...obj + } = this; + + return obj; + } +} + +/** + * @fileoverview `OverrideTester` class. + * + * `OverrideTester` class handles `files` property and `excludedFiles` property + * of `overrides` config. + * + * It provides one method. + * + * - `test(filePath)` + * Test if a file path matches the pair of `files` property and + * `excludedFiles` property. The `filePath` argument must be an absolute + * path. + * + * `ConfigArrayFactory` creates `OverrideTester` objects when it processes + * `overrides` properties. + * + * @author Toru Nagashima + */ + +const { Minimatch } = minimatch__default["default"]; + +const minimatchOpts = { dot: true, matchBase: true }; + +/** + * @typedef {Object} Pattern + * @property {InstanceType[] | null} includes The positive matchers. + * @property {InstanceType[] | null} excludes The negative matchers. + */ + +/** + * Normalize a given pattern to an array. + * @param {string|string[]|undefined} patterns A glob pattern or an array of glob patterns. + * @returns {string[]|null} Normalized patterns. + * @private + */ +function normalizePatterns(patterns) { + if (Array.isArray(patterns)) { + return patterns.filter(Boolean); + } + if (typeof patterns === "string" && patterns) { + return [patterns]; + } + return []; +} + +/** + * Create the matchers of given patterns. + * @param {string[]} patterns The patterns. + * @returns {InstanceType[] | null} The matchers. + */ +function toMatcher(patterns) { + if (patterns.length === 0) { + return null; + } + return patterns.map(pattern => { + if (/^\.[/\\]/u.test(pattern)) { + return new Minimatch( + pattern.slice(2), + + // `./*.js` should not match with `subdir/foo.js` + { ...minimatchOpts, matchBase: false } + ); + } + return new Minimatch(pattern, minimatchOpts); + }); +} + +/** + * Convert a given matcher to string. + * @param {Pattern} matchers The matchers. + * @returns {string} The string expression of the matcher. + */ +function patternToJson({ includes, excludes }) { + return { + includes: includes && includes.map(m => m.pattern), + excludes: excludes && excludes.map(m => m.pattern) + }; +} + +/** + * The class to test given paths are matched by the patterns. + */ +class OverrideTester { + + /** + * Create a tester with given criteria. + * If there are no criteria, returns `null`. + * @param {string|string[]} files The glob patterns for included files. + * @param {string|string[]} excludedFiles The glob patterns for excluded files. + * @param {string} basePath The path to the base directory to test paths. + * @returns {OverrideTester|null} The created instance or `null`. + */ + static create(files, excludedFiles, basePath) { + const includePatterns = normalizePatterns(files); + const excludePatterns = normalizePatterns(excludedFiles); + let endsWithWildcard = false; + + if (includePatterns.length === 0) { + return null; + } + + // Rejects absolute paths or relative paths to parents. + for (const pattern of includePatterns) { + if (path__default["default"].isAbsolute(pattern) || pattern.includes("..")) { + throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`); + } + if (pattern.endsWith("*")) { + endsWithWildcard = true; + } + } + for (const pattern of excludePatterns) { + if (path__default["default"].isAbsolute(pattern) || pattern.includes("..")) { + throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`); + } + } + + const includes = toMatcher(includePatterns); + const excludes = toMatcher(excludePatterns); + + return new OverrideTester( + [{ includes, excludes }], + basePath, + endsWithWildcard + ); + } + + /** + * Combine two testers by logical and. + * If either of the testers was `null`, returns the other tester. + * The `basePath` property of the two must be the same value. + * @param {OverrideTester|null} a A tester. + * @param {OverrideTester|null} b Another tester. + * @returns {OverrideTester|null} Combined tester. + */ + static and(a, b) { + if (!b) { + return a && new OverrideTester( + a.patterns, + a.basePath, + a.endsWithWildcard + ); + } + if (!a) { + return new OverrideTester( + b.patterns, + b.basePath, + b.endsWithWildcard + ); + } + + assert__default["default"].strictEqual(a.basePath, b.basePath); + return new OverrideTester( + a.patterns.concat(b.patterns), + a.basePath, + a.endsWithWildcard || b.endsWithWildcard + ); + } + + /** + * Initialize this instance. + * @param {Pattern[]} patterns The matchers. + * @param {string} basePath The base path. + * @param {boolean} endsWithWildcard If `true` then a pattern ends with `*`. + */ + constructor(patterns, basePath, endsWithWildcard = false) { + + /** @type {Pattern[]} */ + this.patterns = patterns; + + /** @type {string} */ + this.basePath = basePath; + + /** @type {boolean} */ + this.endsWithWildcard = endsWithWildcard; + } + + /** + * Test if a given path is matched or not. + * @param {string} filePath The absolute path to the target file. + * @returns {boolean} `true` if the path was matched. + */ + test(filePath) { + if (typeof filePath !== "string" || !path__default["default"].isAbsolute(filePath)) { + throw new Error(`'filePath' should be an absolute path, but got ${filePath}.`); + } + const relativePath = path__default["default"].relative(this.basePath, filePath); + + return this.patterns.every(({ includes, excludes }) => ( + (!includes || includes.some(m => m.match(relativePath))) && + (!excludes || !excludes.some(m => m.match(relativePath))) + )); + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} a JSON compatible object. + */ + toJSON() { + if (this.patterns.length === 1) { + return { + ...patternToJson(this.patterns[0]), + basePath: this.basePath + }; + } + return { + AND: this.patterns.map(patternToJson), + basePath: this.basePath + }; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} an object to display by `console.log()`. + */ + [util__default["default"].inspect.custom]() { + return this.toJSON(); + } +} + +/** + * @fileoverview `ConfigArray` class. + * @author Toru Nagashima + */ + +/** + * @fileoverview Config file operations. This file must be usable in the browser, + * so no Node-specific code can be here. + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +const RULE_SEVERITY_STRINGS = ["off", "warn", "error"], + RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => { + map[value] = index; + return map; + }, {}), + VALID_SEVERITIES = [0, 1, 2, "off", "warn", "error"]; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Normalizes the severity value of a rule's configuration to a number + * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally + * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0), + * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array + * whose first element is one of the above values. Strings are matched case-insensitively. + * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0. + */ +function getRuleSeverity(ruleConfig) { + const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (severityValue === 0 || severityValue === 1 || severityValue === 2) { + return severityValue; + } + + if (typeof severityValue === "string") { + return RULE_SEVERITY[severityValue.toLowerCase()] || 0; + } + + return 0; +} + +/** + * Converts old-style severity settings (0, 1, 2) into new-style + * severity settings (off, warn, error) for all rules. Assumption is that severity + * values have already been validated as correct. + * @param {Object} config The config object to normalize. + * @returns {void} + */ +function normalizeToStrings(config) { + + if (config.rules) { + Object.keys(config.rules).forEach(ruleId => { + const ruleConfig = config.rules[ruleId]; + + if (typeof ruleConfig === "number") { + config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0]; + } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") { + ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0]; + } + }); + } +} + +/** + * Determines if the severity for the given rule configuration represents an error. + * @param {int|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} True if the rule represents an error, false if not. + */ +function isErrorSeverity(ruleConfig) { + return getRuleSeverity(ruleConfig) === 2; +} + +/** + * Checks whether a given config has valid severity or not. + * @param {number|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} `true` if the configuration has valid severity. + */ +function isValidSeverity(ruleConfig) { + let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (typeof severity === "string") { + severity = severity.toLowerCase(); + } + return VALID_SEVERITIES.indexOf(severity) !== -1; +} + +/** + * Checks whether every rule of a given config has valid severity or not. + * @param {Object} config The configuration for rules. + * @returns {boolean} `true` if the configuration has valid severity. + */ +function isEverySeverityValid(config) { + return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId])); +} + +/** + * Normalizes a value for a global in a config + * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in + * a global directive comment + * @returns {("readable"|"writeable"|"off")} The value normalized as a string + * @throws Error if global value is invalid + */ +function normalizeConfigGlobal(configuredValue) { + switch (configuredValue) { + case "off": + return "off"; + + case true: + case "true": + case "writeable": + case "writable": + return "writable"; + + case null: + case false: + case "false": + case "readable": + case "readonly": + return "readonly"; + + default: + throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`); + } +} + +var ConfigOps = { + __proto__: null, + getRuleSeverity: getRuleSeverity, + normalizeToStrings: normalizeToStrings, + isErrorSeverity: isErrorSeverity, + isValidSeverity: isValidSeverity, + isEverySeverityValid: isEverySeverityValid, + normalizeConfigGlobal: normalizeConfigGlobal +}; + +/** + * @fileoverview Provide the function that emits deprecation warnings. + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +// Defitions for deprecation warnings. +const deprecationWarningMessages = { + ESLINT_LEGACY_ECMAFEATURES: + "The 'ecmaFeatures' config file property is deprecated and has no effect.", + ESLINT_PERSONAL_CONFIG_LOAD: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please use a config file per project or the '--config' option.", + ESLINT_PERSONAL_CONFIG_SUPPRESS: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please remove it or add 'root:true' to the config files in your " + + "projects in order to avoid loading '~/.eslintrc.*' accidentally." +}; + +const sourceFileErrorCache = new Set(); + +/** + * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted + * for each unique file path, but repeated invocations with the same file path have no effect. + * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active. + * @param {string} source The name of the configuration source to report the warning for. + * @param {string} errorCode The warning message to show. + * @returns {void} + */ +function emitDeprecationWarning(source, errorCode) { + const cacheKey = JSON.stringify({ source, errorCode }); + + if (sourceFileErrorCache.has(cacheKey)) { + return; + } + sourceFileErrorCache.add(cacheKey); + + const rel = path__default["default"].relative(process.cwd(), source); + const message = deprecationWarningMessages[errorCode]; + + process.emitWarning( + `${message} (found in "${rel}")`, + "DeprecationWarning", + errorCode + ); +} + +/** + * @fileoverview The instance of Ajv validator. + * @author Evgeny Poberezkin + */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/* + * Copied from ajv/lib/refs/json-schema-draft-04.json + * The MIT License (MIT) + * Copyright (c) 2015-2017 Evgeny Poberezkin + */ +const metaSchema = { + id: "http://json-schema.org/draft-04/schema#", + $schema: "http://json-schema.org/draft-04/schema#", + description: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { $ref: "#" } + }, + positiveInteger: { + type: "integer", + minimum: 0 + }, + positiveIntegerDefault0: { + allOf: [{ $ref: "#/definitions/positiveInteger" }, { default: 0 }] + }, + simpleTypes: { + enum: ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + stringArray: { + type: "array", + items: { type: "string" }, + minItems: 1, + uniqueItems: true + } + }, + type: "object", + properties: { + id: { + type: "string" + }, + $schema: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: { }, + multipleOf: { + type: "number", + minimum: 0, + exclusiveMinimum: true + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { $ref: "#/definitions/positiveInteger" }, + minLength: { $ref: "#/definitions/positiveIntegerDefault0" }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + anyOf: [ + { type: "boolean" }, + { $ref: "#" } + ], + default: { } + }, + items: { + anyOf: [ + { $ref: "#" }, + { $ref: "#/definitions/schemaArray" } + ], + default: { } + }, + maxItems: { $ref: "#/definitions/positiveInteger" }, + minItems: { $ref: "#/definitions/positiveIntegerDefault0" }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { $ref: "#/definitions/positiveInteger" }, + minProperties: { $ref: "#/definitions/positiveIntegerDefault0" }, + required: { $ref: "#/definitions/stringArray" }, + additionalProperties: { + anyOf: [ + { type: "boolean" }, + { $ref: "#" } + ], + default: { } + }, + definitions: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + properties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + patternProperties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { $ref: "#" }, + { $ref: "#/definitions/stringArray" } + ] + } + }, + enum: { + type: "array", + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { $ref: "#/definitions/simpleTypes" }, + { + type: "array", + items: { $ref: "#/definitions/simpleTypes" }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { type: "string" }, + allOf: { $ref: "#/definitions/schemaArray" }, + anyOf: { $ref: "#/definitions/schemaArray" }, + oneOf: { $ref: "#/definitions/schemaArray" }, + not: { $ref: "#" } + }, + dependencies: { + exclusiveMaximum: ["maximum"], + exclusiveMinimum: ["minimum"] + }, + default: { } +}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +var ajvOrig = (additionalOptions = {}) => { + const ajv = new Ajv__default["default"]({ + meta: false, + useDefaults: true, + validateSchema: false, + missingRefs: "ignore", + verbose: true, + schemaId: "auto", + ...additionalOptions + }); + + ajv.addMetaSchema(metaSchema); + // eslint-disable-next-line no-underscore-dangle + ajv._opts.defaultMeta = metaSchema.id; + + return ajv; +}; + +/** + * @fileoverview Defines a schema for configs. + * @author Sylvan Mably + */ + +const baseConfigProperties = { + $schema: { type: "string" }, + env: { type: "object" }, + extends: { $ref: "#/definitions/stringOrStrings" }, + globals: { type: "object" }, + overrides: { + type: "array", + items: { $ref: "#/definitions/overrideConfig" }, + additionalItems: false + }, + parser: { type: ["string", "null"] }, + parserOptions: { type: "object" }, + plugins: { type: "array" }, + processor: { type: "string" }, + rules: { type: "object" }, + settings: { type: "object" }, + noInlineConfig: { type: "boolean" }, + reportUnusedDisableDirectives: { type: "boolean" }, + + ecmaFeatures: { type: "object" } // deprecated; logs a warning when used +}; + +const configSchema = { + definitions: { + stringOrStrings: { + oneOf: [ + { type: "string" }, + { + type: "array", + items: { type: "string" }, + additionalItems: false + } + ] + }, + stringOrStringsRequired: { + oneOf: [ + { type: "string" }, + { + type: "array", + items: { type: "string" }, + additionalItems: false, + minItems: 1 + } + ] + }, + + // Config at top-level. + objectConfig: { + type: "object", + properties: { + root: { type: "boolean" }, + ignorePatterns: { $ref: "#/definitions/stringOrStrings" }, + ...baseConfigProperties + }, + additionalProperties: false + }, + + // Config in `overrides`. + overrideConfig: { + type: "object", + properties: { + excludedFiles: { $ref: "#/definitions/stringOrStrings" }, + files: { $ref: "#/definitions/stringOrStringsRequired" }, + ...baseConfigProperties + }, + required: ["files"], + additionalProperties: false + } + }, + + $ref: "#/definitions/objectConfig" +}; + +/** + * @fileoverview Defines environment settings and globals. + * @author Elan Shanker + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the object that has difference. + * @param {Record} current The newer object. + * @param {Record} prev The older object. + * @returns {Record} The difference object. + */ +function getDiff(current, prev) { + const retv = {}; + + for (const [key, value] of Object.entries(current)) { + if (!Object.hasOwnProperty.call(prev, key)) { + retv[key] = value; + } + } + + return retv; +} + +const newGlobals2015 = getDiff(globals__default["default"].es2015, globals__default["default"].es5); // 19 variables such as Promise, Map, ... +const newGlobals2017 = { + Atomics: false, + SharedArrayBuffer: false +}; +const newGlobals2020 = { + BigInt: false, + BigInt64Array: false, + BigUint64Array: false, + globalThis: false +}; + +const newGlobals2021 = { + AggregateError: false, + FinalizationRegistry: false, + WeakRef: false +}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** @type {Map} */ +var environments = new Map(Object.entries({ + + // Language + builtin: { + globals: globals__default["default"].es5 + }, + es6: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2015: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2016: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 7 + } + }, + es2017: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 8 + } + }, + es2018: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 9 + } + }, + es2019: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 10 + } + }, + es2020: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 }, + parserOptions: { + ecmaVersion: 11 + } + }, + es2021: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 12 + } + }, + es2022: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 13 + } + }, + + // Platforms + browser: { + globals: globals__default["default"].browser + }, + node: { + globals: globals__default["default"].node, + parserOptions: { + ecmaFeatures: { + globalReturn: true + } + } + }, + "shared-node-browser": { + globals: globals__default["default"]["shared-node-browser"] + }, + worker: { + globals: globals__default["default"].worker + }, + serviceworker: { + globals: globals__default["default"].serviceworker + }, + + // Frameworks + commonjs: { + globals: globals__default["default"].commonjs, + parserOptions: { + ecmaFeatures: { + globalReturn: true + } + } + }, + amd: { + globals: globals__default["default"].amd + }, + mocha: { + globals: globals__default["default"].mocha + }, + jasmine: { + globals: globals__default["default"].jasmine + }, + jest: { + globals: globals__default["default"].jest + }, + phantomjs: { + globals: globals__default["default"].phantomjs + }, + jquery: { + globals: globals__default["default"].jquery + }, + qunit: { + globals: globals__default["default"].qunit + }, + prototypejs: { + globals: globals__default["default"].prototypejs + }, + shelljs: { + globals: globals__default["default"].shelljs + }, + meteor: { + globals: globals__default["default"].meteor + }, + mongo: { + globals: globals__default["default"].mongo + }, + protractor: { + globals: globals__default["default"].protractor + }, + applescript: { + globals: globals__default["default"].applescript + }, + nashorn: { + globals: globals__default["default"].nashorn + }, + atomtest: { + globals: globals__default["default"].atomtest + }, + embertest: { + globals: globals__default["default"].embertest + }, + webextensions: { + globals: globals__default["default"].webextensions + }, + greasemonkey: { + globals: globals__default["default"].greasemonkey + } +})); + +/** + * @fileoverview Validates configs. + * @author Brandon Mills + */ + +const ajv = ajvOrig(); + +const ruleValidators = new WeakMap(); +const noop = Function.prototype; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ +let validateSchema; +const severityMap = { + error: 2, + warn: 1, + off: 0 +}; + +const validated = new WeakSet(); + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +class ConfigValidator { + constructor({ builtInRules = new Map() } = {}) { + this.builtInRules = builtInRules; + } + + /** + * Gets a complete options schema for a rule. + * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object + * @returns {Object} JSON Schema for the rule's options. + */ + getRuleOptionsSchema(rule) { + if (!rule) { + return null; + } + + const schema = rule.schema || rule.meta && rule.meta.schema; + + // Given a tuple of schemas, insert warning level at the beginning + if (Array.isArray(schema)) { + if (schema.length) { + return { + type: "array", + items: schema, + minItems: 0, + maxItems: schema.length + }; + } + return { + type: "array", + minItems: 0, + maxItems: 0 + }; + + } + + // Given a full schema, leave it alone + return schema || null; + } + + /** + * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid. + * @param {options} options The given options for the rule. + * @returns {number|string} The rule's severity value + */ + validateRuleSeverity(options) { + const severity = Array.isArray(options) ? options[0] : options; + const normSeverity = typeof severity === "string" ? severityMap[severity.toLowerCase()] : severity; + + if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) { + return normSeverity; + } + + throw new Error(`\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util__default["default"].inspect(severity).replace(/'/gu, "\"").replace(/\n/gu, "")}').\n`); + + } + + /** + * Validates the non-severity options passed to a rule, based on its schema. + * @param {{create: Function}} rule The rule to validate + * @param {Array} localOptions The options for the rule, excluding severity + * @returns {void} + */ + validateRuleSchema(rule, localOptions) { + if (!ruleValidators.has(rule)) { + const schema = this.getRuleOptionsSchema(rule); + + if (schema) { + ruleValidators.set(rule, ajv.compile(schema)); + } + } + + const validateRule = ruleValidators.get(rule); + + if (validateRule) { + validateRule(localOptions); + if (validateRule.errors) { + throw new Error(validateRule.errors.map( + error => `\tValue ${JSON.stringify(error.data)} ${error.message}.\n` + ).join("")); + } + } + } + + /** + * Validates a rule's options against its schema. + * @param {{create: Function}|null} rule The rule that the config is being validated for + * @param {string} ruleId The rule's unique name. + * @param {Array|number} options The given options for the rule. + * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined, + * no source is prepended to the message. + * @returns {void} + */ + validateRuleOptions(rule, ruleId, options, source = null) { + try { + const severity = this.validateRuleSeverity(options); + + if (severity !== 0) { + this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []); + } + } catch (err) { + const enhancedMessage = `Configuration for rule "${ruleId}" is invalid:\n${err.message}`; + + if (typeof source === "string") { + throw new Error(`${source}:\n\t${enhancedMessage}`); + } else { + throw new Error(enhancedMessage); + } + } + } + + /** + * Validates an environment object + * @param {Object} environment The environment config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded environments. + * @returns {void} + */ + validateEnvironment( + environment, + source, + getAdditionalEnv = noop + ) { + + // not having an environment is ok + if (!environment) { + return; + } + + Object.keys(environment).forEach(id => { + const env = getAdditionalEnv(id) || environments.get(id) || null; + + if (!env) { + const message = `${source}:\n\tEnvironment key "${id}" is unknown\n`; + + throw new Error(message); + } + }); + } + + /** + * Validates a rules config object + * @param {Object} rulesConfig The rules config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(ruleId:string): Object} getAdditionalRule A map from strings to loaded rules + * @returns {void} + */ + validateRules( + rulesConfig, + source, + getAdditionalRule = noop + ) { + if (!rulesConfig) { + return; + } + + Object.keys(rulesConfig).forEach(id => { + const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null; + + this.validateRuleOptions(rule, id, rulesConfig[id], source); + }); + } + + /** + * Validates a `globals` section of a config file + * @param {Object} globalsConfig The `globals` section + * @param {string|null} source The name of the configuration source to report in the event of an error. + * @returns {void} + */ + validateGlobals(globalsConfig, source = null) { + if (!globalsConfig) { + return; + } + + Object.entries(globalsConfig) + .forEach(([configuredGlobal, configuredValue]) => { + try { + normalizeConfigGlobal(configuredValue); + } catch (err) { + throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\n${err.message}`); + } + }); + } + + /** + * Validate `processor` configuration. + * @param {string|undefined} processorName The processor name. + * @param {string} source The name of config file. + * @param {function(id:string): Processor} getProcessor The getter of defined processors. + * @returns {void} + */ + validateProcessor(processorName, source, getProcessor) { + if (processorName && !getProcessor(processorName)) { + throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`); + } + } + + /** + * Formats an array of schema validation errors. + * @param {Array} errors An array of error messages to format. + * @returns {string} Formatted error message + */ + formatErrors(errors) { + return errors.map(error => { + if (error.keyword === "additionalProperties") { + const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty; + + return `Unexpected top-level property "${formattedPropertyPath}"`; + } + if (error.keyword === "type") { + const formattedField = error.dataPath.slice(1); + const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join("/") : error.schema; + const formattedValue = JSON.stringify(error.data); + + return `Property "${formattedField}" is the wrong type (expected ${formattedExpectedType} but got \`${formattedValue}\`)`; + } + + const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath; + + return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`; + }).map(message => `\t- ${message}.\n`).join(""); + } + + /** + * Validates the top level properties of the config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @returns {void} + */ + validateConfigSchema(config, source = null) { + validateSchema = validateSchema || ajv.compile(configSchema); + + if (!validateSchema(config)) { + throw new Error(`ESLint configuration in ${source} is invalid:\n${this.formatErrors(validateSchema.errors)}`); + } + + if (Object.hasOwnProperty.call(config, "ecmaFeatures")) { + emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES"); + } + } + + /** + * Validates an entire config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(ruleId:string): Object} [getAdditionalRule] A map from strings to loaded rules. + * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded envs. + * @returns {void} + */ + validate(config, source, getAdditionalRule, getAdditionalEnv) { + this.validateConfigSchema(config, source); + this.validateRules(config.rules, source, getAdditionalRule); + this.validateEnvironment(config.env, source, getAdditionalEnv); + this.validateGlobals(config.globals, source); + + for (const override of config.overrides || []) { + this.validateRules(override.rules, source, getAdditionalRule); + this.validateEnvironment(override.env, source, getAdditionalEnv); + this.validateGlobals(config.globals, source); + } + } + + /** + * Validate config array object. + * @param {ConfigArray} configArray The config array to validate. + * @returns {void} + */ + validateConfigArray(configArray) { + const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments); + const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors); + const getPluginRule = Map.prototype.get.bind(configArray.pluginRules); + + // Validate. + for (const element of configArray) { + if (validated.has(element)) { + continue; + } + validated.add(element); + + this.validateEnvironment(element.env, element.name, getPluginEnv); + this.validateGlobals(element.globals, element.name); + this.validateProcessor(element.processor, element.name, getPluginProcessor); + this.validateRules(element.rules, element.name, getPluginRule); + } + } + +} + +/** + * @fileoverview Common helpers for naming of plugins, formatters and configs + */ + +const NAMESPACE_REGEX = /^@.*\//iu; + +/** + * Brings package name to correct format based on prefix + * @param {string} name The name of the package. + * @param {string} prefix Can be either "eslint-plugin", "eslint-config" or "eslint-formatter" + * @returns {string} Normalized name of the package + * @private + */ +function normalizePackageName(name, prefix) { + let normalizedName = name; + + /** + * On Windows, name can come in with Windows slashes instead of Unix slashes. + * Normalize to Unix first to avoid errors later on. + * https://github.com/eslint/eslint/issues/5644 + */ + if (normalizedName.includes("\\")) { + normalizedName = normalizedName.replace(/\\/gu, "/"); + } + + if (normalizedName.charAt(0) === "@") { + + /** + * it's a scoped package + * package name is the prefix, or just a username + */ + const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, "u"), + scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, "u"); + + if (scopedPackageShortcutRegex.test(normalizedName)) { + normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`); + } else if (!scopedPackageNameRegex.test(normalizedName.split("/")[1])) { + + /** + * for scoped packages, insert the prefix after the first / unless + * the path is already @scope/eslint or @scope/eslint-xxx-yyy + */ + normalizedName = normalizedName.replace(/^@([^/]+)\/(.*)$/u, `@$1/${prefix}-$2`); + } + } else if (!normalizedName.startsWith(`${prefix}-`)) { + normalizedName = `${prefix}-${normalizedName}`; + } + + return normalizedName; +} + +/** + * Removes the prefix from a fullname. + * @param {string} fullname The term which may have the prefix. + * @param {string} prefix The prefix to remove. + * @returns {string} The term without prefix. + */ +function getShorthandName(fullname, prefix) { + if (fullname[0] === "@") { + let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, "u").exec(fullname); + + if (matchResult) { + return matchResult[1]; + } + + matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, "u").exec(fullname); + if (matchResult) { + return `${matchResult[1]}/${matchResult[2]}`; + } + } else if (fullname.startsWith(`${prefix}-`)) { + return fullname.slice(prefix.length + 1); + } + + return fullname; +} + +/** + * Gets the scope (namespace) of a term. + * @param {string} term The term which may have the namespace. + * @returns {string} The namespace of the term if it has one. + */ +function getNamespaceFromTerm(term) { + const match = term.match(NAMESPACE_REGEX); + + return match ? match[0] : ""; +} + +var naming = { + __proto__: null, + normalizePackageName: normalizePackageName, + getShorthandName: getShorthandName, + getNamespaceFromTerm: getNamespaceFromTerm +}; + +/** + * Utility for resolving a module relative to another module + * @author Teddy Katz + */ + +/* + * `Module.createRequire` is added in v12.2.0. It supports URL as well. + * We only support the case where the argument is a filepath, not a URL. + */ +const createRequire = Module__default["default"].createRequire; + +/** + * Resolves a Node module relative to another module + * @param {string} moduleName The name of a Node module, or a path to a Node module. + * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be + * a file rather than a directory, but the file need not actually exist. + * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath` + */ +function resolve(moduleName, relativeToPath) { + try { + return createRequire(relativeToPath).resolve(moduleName); + } catch (error) { + + // This `if` block is for older Node.js than 12.0.0. We can remove this block in the future. + if ( + typeof error === "object" && + error !== null && + error.code === "MODULE_NOT_FOUND" && + !error.requireStack && + error.message.includes(moduleName) + ) { + error.message += `\nRequire stack:\n- ${relativeToPath}`; + } + throw error; + } +} + +var ModuleResolver = { + __proto__: null, + resolve: resolve +}; + +/** + * @fileoverview The factory of `ConfigArray` objects. + * + * This class provides methods to create `ConfigArray` instance. + * + * - `create(configData, options)` + * Create a `ConfigArray` instance from a config data. This is to handle CLI + * options except `--config`. + * - `loadFile(filePath, options)` + * Create a `ConfigArray` instance from a config file. This is to handle + * `--config` option. If the file was not found, throws the following error: + * - If the filename was `*.js`, a `MODULE_NOT_FOUND` error. + * - If the filename was `package.json`, an IO error or an + * `ESLINT_CONFIG_FIELD_NOT_FOUND` error. + * - Otherwise, an IO error such as `ENOENT`. + * - `loadInDirectory(directoryPath, options)` + * Create a `ConfigArray` instance from a config file which is on a given + * directory. This tries to load `.eslintrc.*` or `package.json`. If not + * found, returns an empty `ConfigArray`. + * - `loadESLintIgnore(filePath)` + * Create a `ConfigArray` instance from a config file that is `.eslintignore` + * format. This is to handle `--ignore-path` option. + * - `loadDefaultESLintIgnore()` + * Create a `ConfigArray` instance from `.eslintignore` or `package.json` in + * the current working directory. + * + * `ConfigArrayFactory` class has the responsibility that loads configuration + * files, including loading `extends`, `parser`, and `plugins`. The created + * `ConfigArray` instance has the loaded `extends`, `parser`, and `plugins`. + * + * But this class doesn't handle cascading. `CascadingConfigArrayFactory` class + * handles cascading and hierarchy. + * + * @author Toru Nagashima + */ + +const require$1 = Module.createRequire(require('url').pathToFileURL(__filename).toString()); + +const debug$2 = debugOrig__default["default"]("eslintrc:config-array-factory"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const configFilenames = [ + ".eslintrc.js", + ".eslintrc.cjs", + ".eslintrc.yaml", + ".eslintrc.yml", + ".eslintrc.json", + ".eslintrc", + "package.json" +]; + +// Define types for VSCode IntelliSense. +/** @typedef {import("./shared/types").ConfigData} ConfigData */ +/** @typedef {import("./shared/types").OverrideConfigData} OverrideConfigData */ +/** @typedef {import("./shared/types").Parser} Parser */ +/** @typedef {import("./shared/types").Plugin} Plugin */ +/** @typedef {import("./shared/types").Rule} Rule */ +/** @typedef {import("./config-array/config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-array/config-dependency").DependentPlugin} DependentPlugin */ +/** @typedef {ConfigArray[0]} ConfigArrayElement */ + +/** + * @typedef {Object} ConfigArrayFactoryOptions + * @property {Map} [additionalPluginPool] The map for additional plugins. + * @property {string} [cwd] The path to the current working directory. + * @property {string} [resolvePluginsRelativeTo] A path to the directory that plugins should be resolved from. Defaults to `cwd`. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** + * @typedef {Object} ConfigArrayFactoryInternalSlots + * @property {Map} additionalPluginPool The map for additional plugins. + * @property {string} cwd The path to the current working directory. + * @property {string | undefined} resolvePluginsRelativeTo An absolute path the the directory that plugins should be resolved from. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** + * @typedef {Object} ConfigArrayFactoryLoadingContext + * @property {string} filePath The path to the current configuration. + * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @property {string} name The name of the current configuration. + * @property {string} pluginBasePath The base path to resolve plugins. + * @property {"config" | "ignore" | "implicit-processor"} type The type of the current configuration. This is `"config"` in normal. This is `"ignore"` if it came from `.eslintignore`. This is `"implicit-processor"` if it came from legacy file-extension processors. + */ + +/** + * @typedef {Object} ConfigArrayFactoryLoadingContext + * @property {string} filePath The path to the current configuration. + * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @property {string} name The name of the current configuration. + * @property {"config" | "ignore" | "implicit-processor"} type The type of the current configuration. This is `"config"` in normal. This is `"ignore"` if it came from `.eslintignore`. This is `"implicit-processor"` if it came from legacy file-extension processors. + */ + +/** @type {WeakMap} */ +const internalSlotsMap$1 = new WeakMap(); + +/** @type {WeakMap} */ +const normalizedPlugins = new WeakMap(); + +/** + * Check if a given string is a file path. + * @param {string} nameOrPath A module name or file path. + * @returns {boolean} `true` if the `nameOrPath` is a file path. + */ +function isFilePath(nameOrPath) { + return ( + /^\.{1,2}[/\\]/u.test(nameOrPath) || + path__default["default"].isAbsolute(nameOrPath) + ); +} + +/** + * Convenience wrapper for synchronously reading file contents. + * @param {string} filePath The filename to read. + * @returns {string} The file contents, with the BOM removed. + * @private + */ +function readFile(filePath) { + return fs__default["default"].readFileSync(filePath, "utf8").replace(/^\ufeff/u, ""); +} + +/** + * Loads a YAML configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadYAMLConfigFile(filePath) { + debug$2(`Loading YAML config file: ${filePath}`); + + // lazy load YAML to improve performance when not used + const yaml = require$1("js-yaml"); + + try { + + // empty YAML file can be null, so always use + return yaml.load(readFile(filePath)) || {}; + } catch (e) { + debug$2(`Error reading YAML file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a JSON configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadJSONConfigFile(filePath) { + debug$2(`Loading JSON config file: ${filePath}`); + + try { + return JSON.parse(stripComments__default["default"](readFile(filePath))); + } catch (e) { + debug$2(`Error reading JSON file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + e.messageTemplate = "failed-to-read-json"; + e.messageData = { + path: filePath, + message: e.message + }; + throw e; + } +} + +/** + * Loads a legacy (.eslintrc) configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadLegacyConfigFile(filePath) { + debug$2(`Loading legacy config file: ${filePath}`); + + // lazy load YAML to improve performance when not used + const yaml = require$1("js-yaml"); + + try { + return yaml.load(stripComments__default["default"](readFile(filePath))) || /* istanbul ignore next */ {}; + } catch (e) { + debug$2("Error reading YAML file: %s\n%o", filePath, e); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a JavaScript configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadJSConfigFile(filePath) { + debug$2(`Loading JS config file: ${filePath}`); + try { + return importFresh__default["default"](filePath); + } catch (e) { + debug$2(`Error reading JavaScript file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a configuration from a package.json file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadPackageJSONConfigFile(filePath) { + debug$2(`Loading package.json config file: ${filePath}`); + try { + const packageData = loadJSONConfigFile(filePath); + + if (!Object.hasOwnProperty.call(packageData, "eslintConfig")) { + throw Object.assign( + new Error("package.json file doesn't have 'eslintConfig' field."), + { code: "ESLINT_CONFIG_FIELD_NOT_FOUND" } + ); + } + + return packageData.eslintConfig; + } catch (e) { + debug$2(`Error reading package.json file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a `.eslintignore` from a file. + * @param {string} filePath The filename to load. + * @returns {string[]} The ignore patterns from the file. + * @private + */ +function loadESLintIgnoreFile(filePath) { + debug$2(`Loading .eslintignore file: ${filePath}`); + + try { + return readFile(filePath) + .split(/\r?\n/gu) + .filter(line => line.trim() !== "" && !line.startsWith("#")); + } catch (e) { + debug$2(`Error reading .eslintignore file: ${filePath}`); + e.message = `Cannot read .eslintignore file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Creates an error to notify about a missing config to extend from. + * @param {string} configName The name of the missing config. + * @param {string} importerName The name of the config that imported the missing config + * @param {string} messageTemplate The text template to source error strings from. + * @returns {Error} The error object to throw + * @private + */ +function configInvalidError(configName, importerName, messageTemplate) { + return Object.assign( + new Error(`Failed to load config "${configName}" to extend from.`), + { + messageTemplate, + messageData: { configName, importerName } + } + ); +} + +/** + * Loads a configuration file regardless of the source. Inspects the file path + * to determine the correctly way to load the config file. + * @param {string} filePath The path to the configuration. + * @returns {ConfigData|null} The configuration information. + * @private + */ +function loadConfigFile(filePath) { + switch (path__default["default"].extname(filePath)) { + case ".js": + case ".cjs": + return loadJSConfigFile(filePath); + + case ".json": + if (path__default["default"].basename(filePath) === "package.json") { + return loadPackageJSONConfigFile(filePath); + } + return loadJSONConfigFile(filePath); + + case ".yaml": + case ".yml": + return loadYAMLConfigFile(filePath); + + default: + return loadLegacyConfigFile(filePath); + } +} + +/** + * Write debug log. + * @param {string} request The requested module name. + * @param {string} relativeTo The file path to resolve the request relative to. + * @param {string} filePath The resolved file path. + * @returns {void} + */ +function writeDebugLogForLoading(request, relativeTo, filePath) { + /* istanbul ignore next */ + if (debug$2.enabled) { + let nameAndVersion = null; + + try { + const packageJsonPath = resolve( + `${request}/package.json`, + relativeTo + ); + const { version = "unknown" } = require$1(packageJsonPath); + + nameAndVersion = `${request}@${version}`; + } catch (error) { + debug$2("package.json was not found:", error.message); + nameAndVersion = request; + } + + debug$2("Loaded: %s (%s)", nameAndVersion, filePath); + } +} + +/** + * Create a new context with default values. + * @param {ConfigArrayFactoryInternalSlots} slots The internal slots. + * @param {"config" | "ignore" | "implicit-processor" | undefined} providedType The type of the current configuration. Default is `"config"`. + * @param {string | undefined} providedName The name of the current configuration. Default is the relative path from `cwd` to `filePath`. + * @param {string | undefined} providedFilePath The path to the current configuration. Default is empty string. + * @param {string | undefined} providedMatchBasePath The type of the current configuration. Default is the directory of `filePath` or `cwd`. + * @returns {ConfigArrayFactoryLoadingContext} The created context. + */ +function createContext( + { cwd, resolvePluginsRelativeTo }, + providedType, + providedName, + providedFilePath, + providedMatchBasePath +) { + const filePath = providedFilePath + ? path__default["default"].resolve(cwd, providedFilePath) + : ""; + const matchBasePath = + (providedMatchBasePath && path__default["default"].resolve(cwd, providedMatchBasePath)) || + (filePath && path__default["default"].dirname(filePath)) || + cwd; + const name = + providedName || + (filePath && path__default["default"].relative(cwd, filePath)) || + ""; + const pluginBasePath = + resolvePluginsRelativeTo || + (filePath && path__default["default"].dirname(filePath)) || + cwd; + const type = providedType || "config"; + + return { filePath, matchBasePath, name, pluginBasePath, type }; +} + +/** + * Normalize a given plugin. + * - Ensure the object to have four properties: configs, environments, processors, and rules. + * - Ensure the object to not have other properties. + * @param {Plugin} plugin The plugin to normalize. + * @returns {Plugin} The normalized plugin. + */ +function normalizePlugin(plugin) { + + // first check the cache + let normalizedPlugin = normalizedPlugins.get(plugin); + + if (normalizedPlugin) { + return normalizedPlugin; + } + + normalizedPlugin = { + configs: plugin.configs || {}, + environments: plugin.environments || {}, + processors: plugin.processors || {}, + rules: plugin.rules || {} + }; + + // save the reference for later + normalizedPlugins.set(plugin, normalizedPlugin); + + return normalizedPlugin; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The factory of `ConfigArray` objects. + */ +class ConfigArrayFactory { + + /** + * Initialize this instance. + * @param {ConfigArrayFactoryOptions} [options] The map for additional plugins. + */ + constructor({ + additionalPluginPool = new Map(), + cwd = process.cwd(), + resolvePluginsRelativeTo, + builtInRules, + resolver = ModuleResolver, + eslintAllPath, + getEslintAllConfig, + eslintRecommendedPath, + getEslintRecommendedConfig + } = {}) { + internalSlotsMap$1.set(this, { + additionalPluginPool, + cwd, + resolvePluginsRelativeTo: + resolvePluginsRelativeTo && + path__default["default"].resolve(cwd, resolvePluginsRelativeTo), + builtInRules, + resolver, + eslintAllPath, + getEslintAllConfig, + eslintRecommendedPath, + getEslintRecommendedConfig + }); + } + + /** + * Create `ConfigArray` instance from a config data. + * @param {ConfigData|null} configData The config data to create. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.filePath] The path to this config data. + * @param {string} [options.name] The config name. + * @returns {ConfigArray} Loaded config. + */ + create(configData, { basePath, filePath, name } = {}) { + if (!configData) { + return new ConfigArray(); + } + + const slots = internalSlotsMap$1.get(this); + const ctx = createContext(slots, "config", name, filePath, basePath); + const elements = this._normalizeConfigData(configData, ctx); + + return new ConfigArray(...elements); + } + + /** + * Load a config file. + * @param {string} filePath The path to a config file. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.name] The config name. + * @returns {ConfigArray} Loaded config. + */ + loadFile(filePath, { basePath, name } = {}) { + const slots = internalSlotsMap$1.get(this); + const ctx = createContext(slots, "config", name, filePath, basePath); + + return new ConfigArray(...this._loadConfigData(ctx)); + } + + /** + * Load the config file on a given directory if exists. + * @param {string} directoryPath The path to a directory. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.name] The config name. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + */ + loadInDirectory(directoryPath, { basePath, name } = {}) { + const slots = internalSlotsMap$1.get(this); + + for (const filename of configFilenames) { + const ctx = createContext( + slots, + "config", + name, + path__default["default"].join(directoryPath, filename), + basePath + ); + + if (fs__default["default"].existsSync(ctx.filePath) && fs__default["default"].statSync(ctx.filePath).isFile()) { + let configData; + + try { + configData = loadConfigFile(ctx.filePath); + } catch (error) { + if (!error || error.code !== "ESLINT_CONFIG_FIELD_NOT_FOUND") { + throw error; + } + } + + if (configData) { + debug$2(`Config file found: ${ctx.filePath}`); + return new ConfigArray( + ...this._normalizeConfigData(configData, ctx) + ); + } + } + } + + debug$2(`Config file not found on ${directoryPath}`); + return new ConfigArray(); + } + + /** + * Check if a config file on a given directory exists or not. + * @param {string} directoryPath The path to a directory. + * @returns {string | null} The path to the found config file. If not found then null. + */ + static getPathToConfigFileInDirectory(directoryPath) { + for (const filename of configFilenames) { + const filePath = path__default["default"].join(directoryPath, filename); + + if (fs__default["default"].existsSync(filePath)) { + if (filename === "package.json") { + try { + loadPackageJSONConfigFile(filePath); + return filePath; + } catch { /* ignore */ } + } else { + return filePath; + } + } + } + return null; + } + + /** + * Load `.eslintignore` file. + * @param {string} filePath The path to a `.eslintignore` file to load. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + */ + loadESLintIgnore(filePath) { + const slots = internalSlotsMap$1.get(this); + const ctx = createContext( + slots, + "ignore", + void 0, + filePath, + slots.cwd + ); + const ignorePatterns = loadESLintIgnoreFile(ctx.filePath); + + return new ConfigArray( + ...this._normalizeESLintIgnoreData(ignorePatterns, ctx) + ); + } + + /** + * Load `.eslintignore` file in the current working directory. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + */ + loadDefaultESLintIgnore() { + const slots = internalSlotsMap$1.get(this); + const eslintIgnorePath = path__default["default"].resolve(slots.cwd, ".eslintignore"); + const packageJsonPath = path__default["default"].resolve(slots.cwd, "package.json"); + + if (fs__default["default"].existsSync(eslintIgnorePath)) { + return this.loadESLintIgnore(eslintIgnorePath); + } + if (fs__default["default"].existsSync(packageJsonPath)) { + const data = loadJSONConfigFile(packageJsonPath); + + if (Object.hasOwnProperty.call(data, "eslintIgnore")) { + if (!Array.isArray(data.eslintIgnore)) { + throw new Error("Package.json eslintIgnore property requires an array of paths"); + } + const ctx = createContext( + slots, + "ignore", + "eslintIgnore in package.json", + packageJsonPath, + slots.cwd + ); + + return new ConfigArray( + ...this._normalizeESLintIgnoreData(data.eslintIgnore, ctx) + ); + } + } + + return new ConfigArray(); + } + + /** + * Load a given config file. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} Loaded config. + * @private + */ + _loadConfigData(ctx) { + return this._normalizeConfigData(loadConfigFile(ctx.filePath), ctx); + } + + /** + * Normalize a given `.eslintignore` data to config array elements. + * @param {string[]} ignorePatterns The patterns to ignore files. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeESLintIgnoreData(ignorePatterns, ctx) { + const elements = this._normalizeObjectConfigData( + { ignorePatterns }, + ctx + ); + + // Set `ignorePattern.loose` flag for backward compatibility. + for (const element of elements) { + if (element.ignorePattern) { + element.ignorePattern.loose = true; + } + yield element; + } + } + + /** + * Normalize a given config to an array. + * @param {ConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _normalizeConfigData(configData, ctx) { + const validator = new ConfigValidator(); + + validator.validateConfigSchema(configData, ctx.name || ctx.filePath); + return this._normalizeObjectConfigData(configData, ctx); + } + + /** + * Normalize a given config to an array. + * @param {ConfigData|OverrideConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeObjectConfigData(configData, ctx) { + const { files, excludedFiles, ...configBody } = configData; + const criteria = OverrideTester.create( + files, + excludedFiles, + ctx.matchBasePath + ); + const elements = this._normalizeObjectConfigDataBody(configBody, ctx); + + // Apply the criteria to every element. + for (const element of elements) { + + /* + * Merge the criteria. + * This is for the `overrides` entries that came from the + * configurations of `overrides[].extends`. + */ + element.criteria = OverrideTester.and(criteria, element.criteria); + + /* + * Remove `root` property to ignore `root` settings which came from + * `extends` in `overrides`. + */ + if (element.criteria) { + element.root = void 0; + } + + yield element; + } + } + + /** + * Normalize a given config to an array. + * @param {ConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeObjectConfigDataBody( + { + env, + extends: extend, + globals, + ignorePatterns, + noInlineConfig, + parser: parserName, + parserOptions, + plugins: pluginList, + processor, + reportUnusedDisableDirectives, + root, + rules, + settings, + overrides: overrideList = [] + }, + ctx + ) { + const extendList = Array.isArray(extend) ? extend : [extend]; + const ignorePattern = ignorePatterns && new IgnorePattern( + Array.isArray(ignorePatterns) ? ignorePatterns : [ignorePatterns], + ctx.matchBasePath + ); + + // Flatten `extends`. + for (const extendName of extendList.filter(Boolean)) { + yield* this._loadExtends(extendName, ctx); + } + + // Load parser & plugins. + const parser = parserName && this._loadParser(parserName, ctx); + const plugins = pluginList && this._loadPlugins(pluginList, ctx); + + // Yield pseudo config data for file extension processors. + if (plugins) { + yield* this._takeFileExtensionProcessors(plugins, ctx); + } + + // Yield the config data except `extends` and `overrides`. + yield { + + // Debug information. + type: ctx.type, + name: ctx.name, + filePath: ctx.filePath, + + // Config data. + criteria: null, + env, + globals, + ignorePattern, + noInlineConfig, + parser, + parserOptions, + plugins, + processor, + reportUnusedDisableDirectives, + root, + rules, + settings + }; + + // Flatten `overries`. + for (let i = 0; i < overrideList.length; ++i) { + yield* this._normalizeObjectConfigData( + overrideList[i], + { ...ctx, name: `${ctx.name}#overrides[${i}]` } + ); + } + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtends(extendName, ctx) { + debug$2("Loading {extends:%j} relative to %s", extendName, ctx.filePath); + try { + if (extendName.startsWith("eslint:")) { + return this._loadExtendedBuiltInConfig(extendName, ctx); + } + if (extendName.startsWith("plugin:")) { + return this._loadExtendedPluginConfig(extendName, ctx); + } + return this._loadExtendedShareableConfig(extendName, ctx); + } catch (error) { + error.message += `\nReferenced from: ${ctx.filePath || ctx.name}`; + throw error; + } + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtendedBuiltInConfig(extendName, ctx) { + const { + eslintAllPath, + getEslintAllConfig, + eslintRecommendedPath, + getEslintRecommendedConfig + } = internalSlotsMap$1.get(this); + + if (extendName === "eslint:recommended") { + const name = `${ctx.name} » ${extendName}`; + + if (getEslintRecommendedConfig) { + if (typeof getEslintRecommendedConfig !== "function") { + throw new Error(`getEslintRecommendedConfig must be a function instead of '${getEslintRecommendedConfig}'`); + } + return this._normalizeConfigData(getEslintRecommendedConfig(), { ...ctx, name, filePath: "" }); + } + return this._loadConfigData({ + ...ctx, + name, + filePath: eslintRecommendedPath + }); + } + if (extendName === "eslint:all") { + const name = `${ctx.name} » ${extendName}`; + + if (getEslintAllConfig) { + if (typeof getEslintAllConfig !== "function") { + throw new Error(`getEslintAllConfig must be a function instead of '${getEslintAllConfig}'`); + } + return this._normalizeConfigData(getEslintAllConfig(), { ...ctx, name, filePath: "" }); + } + return this._loadConfigData({ + ...ctx, + name, + filePath: eslintAllPath + }); + } + + throw configInvalidError(extendName, ctx.name, "extend-config-missing"); + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtendedPluginConfig(extendName, ctx) { + const slashIndex = extendName.lastIndexOf("/"); + + if (slashIndex === -1) { + throw configInvalidError(extendName, ctx.filePath, "plugin-invalid"); + } + + const pluginName = extendName.slice("plugin:".length, slashIndex); + const configName = extendName.slice(slashIndex + 1); + + if (isFilePath(pluginName)) { + throw new Error("'extends' cannot use a file path for plugins."); + } + + const plugin = this._loadPlugin(pluginName, ctx); + const configData = + plugin.definition && + plugin.definition.configs[configName]; + + if (configData) { + return this._normalizeConfigData(configData, { + ...ctx, + filePath: plugin.filePath || ctx.filePath, + name: `${ctx.name} » plugin:${plugin.id}/${configName}` + }); + } + + throw plugin.error || configInvalidError(extendName, ctx.filePath, "extend-config-missing"); + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtendedShareableConfig(extendName, ctx) { + const { cwd, resolver } = internalSlotsMap$1.get(this); + const relativeTo = ctx.filePath || path__default["default"].join(cwd, "__placeholder__.js"); + let request; + + if (isFilePath(extendName)) { + request = extendName; + } else if (extendName.startsWith(".")) { + request = `./${extendName}`; // For backward compatibility. A ton of tests depended on this behavior. + } else { + request = normalizePackageName( + extendName, + "eslint-config" + ); + } + + let filePath; + + try { + filePath = resolver.resolve(request, relativeTo); + } catch (error) { + /* istanbul ignore else */ + if (error && error.code === "MODULE_NOT_FOUND") { + throw configInvalidError(extendName, ctx.filePath, "extend-config-missing"); + } + throw error; + } + + writeDebugLogForLoading(request, relativeTo, filePath); + return this._loadConfigData({ + ...ctx, + filePath, + name: `${ctx.name} » ${request}` + }); + } + + /** + * Load given plugins. + * @param {string[]} names The plugin names to load. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {Record} The loaded parser. + * @private + */ + _loadPlugins(names, ctx) { + return names.reduce((map, name) => { + if (isFilePath(name)) { + throw new Error("Plugins array cannot includes file paths."); + } + const plugin = this._loadPlugin(name, ctx); + + map[plugin.id] = plugin; + + return map; + }, {}); + } + + /** + * Load a given parser. + * @param {string} nameOrPath The package name or the path to a parser file. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {DependentParser} The loaded parser. + */ + _loadParser(nameOrPath, ctx) { + debug$2("Loading parser %j from %s", nameOrPath, ctx.filePath); + + const { cwd, resolver } = internalSlotsMap$1.get(this); + const relativeTo = ctx.filePath || path__default["default"].join(cwd, "__placeholder__.js"); + + try { + const filePath = resolver.resolve(nameOrPath, relativeTo); + + writeDebugLogForLoading(nameOrPath, relativeTo, filePath); + + return new ConfigDependency({ + definition: require$1(filePath), + filePath, + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } catch (error) { + + // If the parser name is "espree", load the espree of ESLint. + if (nameOrPath === "espree") { + debug$2("Fallback espree."); + return new ConfigDependency({ + definition: require$1("espree"), + filePath: require$1.resolve("espree"), + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + debug$2("Failed to load parser '%s' declared in '%s'.", nameOrPath, ctx.name); + error.message = `Failed to load parser '${nameOrPath}' declared in '${ctx.name}': ${error.message}`; + + return new ConfigDependency({ + error, + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + } + + /** + * Load a given plugin. + * @param {string} name The plugin name to load. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {DependentPlugin} The loaded plugin. + * @private + */ + _loadPlugin(name, ctx) { + debug$2("Loading plugin %j from %s", name, ctx.filePath); + + const { additionalPluginPool, resolver } = internalSlotsMap$1.get(this); + const request = normalizePackageName(name, "eslint-plugin"); + const id = getShorthandName(request, "eslint-plugin"); + const relativeTo = path__default["default"].join(ctx.pluginBasePath, "__placeholder__.js"); + + if (name.match(/\s+/u)) { + const error = Object.assign( + new Error(`Whitespace found in plugin name '${name}'`), + { + messageTemplate: "whitespace-found", + messageData: { pluginName: request } + } + ); + + return new ConfigDependency({ + error, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + // Check for additional pool. + const plugin = + additionalPluginPool.get(request) || + additionalPluginPool.get(id); + + if (plugin) { + return new ConfigDependency({ + definition: normalizePlugin(plugin), + filePath: "", // It's unknown where the plugin came from. + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + let filePath; + let error; + + try { + filePath = resolver.resolve(request, relativeTo); + } catch (resolveError) { + error = resolveError; + /* istanbul ignore else */ + if (error && error.code === "MODULE_NOT_FOUND") { + error.messageTemplate = "plugin-missing"; + error.messageData = { + pluginName: request, + resolvePluginsRelativeTo: ctx.pluginBasePath, + importerName: ctx.name + }; + } + } + + if (filePath) { + try { + writeDebugLogForLoading(request, relativeTo, filePath); + + const startTime = Date.now(); + const pluginDefinition = require$1(filePath); + + debug$2(`Plugin ${filePath} loaded in: ${Date.now() - startTime}ms`); + + return new ConfigDependency({ + definition: normalizePlugin(pluginDefinition), + filePath, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } catch (loadError) { + error = loadError; + } + } + + debug$2("Failed to load plugin '%s' declared in '%s'.", name, ctx.name); + error.message = `Failed to load plugin '${name}' declared in '${ctx.name}': ${error.message}`; + return new ConfigDependency({ + error, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + /** + * Take file expression processors as config array elements. + * @param {Record} plugins The plugin definitions. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The config array elements of file expression processors. + * @private + */ + *_takeFileExtensionProcessors(plugins, ctx) { + for (const pluginId of Object.keys(plugins)) { + const processors = + plugins[pluginId] && + plugins[pluginId].definition && + plugins[pluginId].definition.processors; + + if (!processors) { + continue; + } + + for (const processorId of Object.keys(processors)) { + if (processorId.startsWith(".")) { + yield* this._normalizeObjectConfigData( + { + files: [`*${processorId}`], + processor: `${pluginId}/${processorId}` + }, + { + ...ctx, + type: "implicit-processor", + name: `${ctx.name}#processors["${pluginId}/${processorId}"]` + } + ); + } + } + } + } +} + +/** + * @fileoverview `CascadingConfigArrayFactory` class. + * + * `CascadingConfigArrayFactory` class has a responsibility: + * + * 1. Handles cascading of config files. + * + * It provides two methods: + * + * - `getConfigArrayForFile(filePath)` + * Get the corresponded configuration of a given file. This method doesn't + * throw even if the given file didn't exist. + * - `clearCache()` + * Clear the internal cache. You have to call this method when + * `additionalPluginPool` was updated if `baseConfig` or `cliConfig` depends + * on the additional plugins. (`CLIEngine#addPlugin()` method calls this.) + * + * @author Toru Nagashima + */ + +const debug$1 = debugOrig__default["default"]("eslintrc:cascading-config-array-factory"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// Define types for VSCode IntelliSense. +/** @typedef {import("./shared/types").ConfigData} ConfigData */ +/** @typedef {import("./shared/types").Parser} Parser */ +/** @typedef {import("./shared/types").Plugin} Plugin */ +/** @typedef {import("./shared/types").Rule} Rule */ +/** @typedef {ReturnType} ConfigArray */ + +/** + * @typedef {Object} CascadingConfigArrayFactoryOptions + * @property {Map} [additionalPluginPool] The map for additional plugins. + * @property {ConfigData} [baseConfig] The config by `baseConfig` option. + * @property {ConfigData} [cliConfig] The config by CLI options (`--env`, `--global`, `--ignore-pattern`, `--parser`, `--parser-options`, `--plugin`, and `--rule`). CLI options overwrite the setting in config files. + * @property {string} [cwd] The base directory to start lookup. + * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`. + * @property {string[]} [rulePaths] The value of `--rulesdir` option. + * @property {string} [specificConfigPath] The value of `--config` option. + * @property {boolean} [useEslintrc] if `false` then it doesn't load config files. + * @property {Function} loadRules The function to use to load rules. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** + * @typedef {Object} CascadingConfigArrayFactoryInternalSlots + * @property {ConfigArray} baseConfigArray The config array of `baseConfig` option. + * @property {ConfigData} baseConfigData The config data of `baseConfig` option. This is used to reset `baseConfigArray`. + * @property {ConfigArray} cliConfigArray The config array of CLI options. + * @property {ConfigData} cliConfigData The config data of CLI options. This is used to reset `cliConfigArray`. + * @property {ConfigArrayFactory} configArrayFactory The factory for config arrays. + * @property {Map} configCache The cache from directory paths to config arrays. + * @property {string} cwd The base directory to start lookup. + * @property {WeakMap} finalizeCache The cache from config arrays to finalized config arrays. + * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`. + * @property {string[]|null} rulePaths The value of `--rulesdir` option. This is used to reset `baseConfigArray`. + * @property {string|null} specificConfigPath The value of `--config` option. This is used to reset `cliConfigArray`. + * @property {boolean} useEslintrc if `false` then it doesn't load config files. + * @property {Function} loadRules The function to use to load rules. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** @type {WeakMap} */ +const internalSlotsMap = new WeakMap(); + +/** + * Create the config array from `baseConfig` and `rulePaths`. + * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots. + * @returns {ConfigArray} The config array of the base configs. + */ +function createBaseConfigArray({ + configArrayFactory, + baseConfigData, + rulePaths, + cwd, + loadRules +}) { + const baseConfigArray = configArrayFactory.create( + baseConfigData, + { name: "BaseConfig" } + ); + + /* + * Create the config array element for the default ignore patterns. + * This element has `ignorePattern` property that ignores the default + * patterns in the current working directory. + */ + baseConfigArray.unshift(configArrayFactory.create( + { ignorePatterns: IgnorePattern.DefaultPatterns }, + { name: "DefaultIgnorePattern" } + )[0]); + + /* + * Load rules `--rulesdir` option as a pseudo plugin. + * Use a pseudo plugin to define rules of `--rulesdir`, so we can validate + * the rule's options with only information in the config array. + */ + if (rulePaths && rulePaths.length > 0) { + baseConfigArray.push({ + type: "config", + name: "--rulesdir", + filePath: "", + plugins: { + "": new ConfigDependency({ + definition: { + rules: rulePaths.reduce( + (map, rulesPath) => Object.assign( + map, + loadRules(rulesPath, cwd) + ), + {} + ) + }, + filePath: "", + id: "", + importerName: "--rulesdir", + importerPath: "" + }) + } + }); + } + + return baseConfigArray; +} + +/** + * Create the config array from CLI options. + * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots. + * @returns {ConfigArray} The config array of the base configs. + */ +function createCLIConfigArray({ + cliConfigData, + configArrayFactory, + cwd, + ignorePath, + specificConfigPath +}) { + const cliConfigArray = configArrayFactory.create( + cliConfigData, + { name: "CLIOptions" } + ); + + cliConfigArray.unshift( + ...(ignorePath + ? configArrayFactory.loadESLintIgnore(ignorePath) + : configArrayFactory.loadDefaultESLintIgnore()) + ); + + if (specificConfigPath) { + cliConfigArray.unshift( + ...configArrayFactory.loadFile( + specificConfigPath, + { name: "--config", basePath: cwd } + ) + ); + } + + return cliConfigArray; +} + +/** + * The error type when there are files matched by a glob, but all of them have been ignored. + */ +class ConfigurationNotFoundError extends Error { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {string} directoryPath The directory path. + */ + constructor(directoryPath) { + super(`No ESLint configuration found in ${directoryPath}.`); + this.messageTemplate = "no-config-found"; + this.messageData = { directoryPath }; + } +} + +/** + * This class provides the functionality that enumerates every file which is + * matched by given glob patterns and that configuration. + */ +class CascadingConfigArrayFactory { + + /** + * Initialize this enumerator. + * @param {CascadingConfigArrayFactoryOptions} options The options. + */ + constructor({ + additionalPluginPool = new Map(), + baseConfig: baseConfigData = null, + cliConfig: cliConfigData = null, + cwd = process.cwd(), + ignorePath, + resolvePluginsRelativeTo, + rulePaths = [], + specificConfigPath = null, + useEslintrc = true, + builtInRules = new Map(), + loadRules, + resolver, + eslintRecommendedPath, + getEslintRecommendedConfig, + eslintAllPath, + getEslintAllConfig + } = {}) { + const configArrayFactory = new ConfigArrayFactory({ + additionalPluginPool, + cwd, + resolvePluginsRelativeTo, + builtInRules, + resolver, + eslintRecommendedPath, + getEslintRecommendedConfig, + eslintAllPath, + getEslintAllConfig + }); + + internalSlotsMap.set(this, { + baseConfigArray: createBaseConfigArray({ + baseConfigData, + configArrayFactory, + cwd, + rulePaths, + loadRules + }), + baseConfigData, + cliConfigArray: createCLIConfigArray({ + cliConfigData, + configArrayFactory, + cwd, + ignorePath, + specificConfigPath + }), + cliConfigData, + configArrayFactory, + configCache: new Map(), + cwd, + finalizeCache: new WeakMap(), + ignorePath, + rulePaths, + specificConfigPath, + useEslintrc, + builtInRules, + loadRules + }); + } + + /** + * The path to the current working directory. + * This is used by tests. + * @type {string} + */ + get cwd() { + const { cwd } = internalSlotsMap.get(this); + + return cwd; + } + + /** + * Get the config array of a given file. + * If `filePath` was not given, it returns the config which contains only + * `baseConfigData` and `cliConfigData`. + * @param {string} [filePath] The file path to a file. + * @param {Object} [options] The options. + * @param {boolean} [options.ignoreNotFoundError] If `true` then it doesn't throw `ConfigurationNotFoundError`. + * @returns {ConfigArray} The config array of the file. + */ + getConfigArrayForFile(filePath, { ignoreNotFoundError = false } = {}) { + const { + baseConfigArray, + cliConfigArray, + cwd + } = internalSlotsMap.get(this); + + if (!filePath) { + return new ConfigArray(...baseConfigArray, ...cliConfigArray); + } + + const directoryPath = path__default["default"].dirname(path__default["default"].resolve(cwd, filePath)); + + debug$1(`Load config files for ${directoryPath}.`); + + return this._finalizeConfigArray( + this._loadConfigInAncestors(directoryPath), + directoryPath, + ignoreNotFoundError + ); + } + + /** + * Set the config data to override all configs. + * Require to call `clearCache()` method after this method is called. + * @param {ConfigData} configData The config data to override all configs. + * @returns {void} + */ + setOverrideConfig(configData) { + const slots = internalSlotsMap.get(this); + + slots.cliConfigData = configData; + } + + /** + * Clear config cache. + * @returns {void} + */ + clearCache() { + const slots = internalSlotsMap.get(this); + + slots.baseConfigArray = createBaseConfigArray(slots); + slots.cliConfigArray = createCLIConfigArray(slots); + slots.configCache.clear(); + } + + /** + * Load and normalize config files from the ancestor directories. + * @param {string} directoryPath The path to a leaf directory. + * @param {boolean} configsExistInSubdirs `true` if configurations exist in subdirectories. + * @returns {ConfigArray} The loaded config. + * @private + */ + _loadConfigInAncestors(directoryPath, configsExistInSubdirs = false) { + const { + baseConfigArray, + configArrayFactory, + configCache, + cwd, + useEslintrc + } = internalSlotsMap.get(this); + + if (!useEslintrc) { + return baseConfigArray; + } + + let configArray = configCache.get(directoryPath); + + // Hit cache. + if (configArray) { + debug$1(`Cache hit: ${directoryPath}.`); + return configArray; + } + debug$1(`No cache found: ${directoryPath}.`); + + const homePath = os__default["default"].homedir(); + + // Consider this is root. + if (directoryPath === homePath && cwd !== homePath) { + debug$1("Stop traversing because of considered root."); + if (configsExistInSubdirs) { + const filePath = ConfigArrayFactory.getPathToConfigFileInDirectory(directoryPath); + + if (filePath) { + emitDeprecationWarning( + filePath, + "ESLINT_PERSONAL_CONFIG_SUPPRESS" + ); + } + } + return this._cacheConfig(directoryPath, baseConfigArray); + } + + // Load the config on this directory. + try { + configArray = configArrayFactory.loadInDirectory(directoryPath); + } catch (error) { + /* istanbul ignore next */ + if (error.code === "EACCES") { + debug$1("Stop traversing because of 'EACCES' error."); + return this._cacheConfig(directoryPath, baseConfigArray); + } + throw error; + } + + if (configArray.length > 0 && configArray.isRoot()) { + debug$1("Stop traversing because of 'root:true'."); + configArray.unshift(...baseConfigArray); + return this._cacheConfig(directoryPath, configArray); + } + + // Load from the ancestors and merge it. + const parentPath = path__default["default"].dirname(directoryPath); + const parentConfigArray = parentPath && parentPath !== directoryPath + ? this._loadConfigInAncestors( + parentPath, + configsExistInSubdirs || configArray.length > 0 + ) + : baseConfigArray; + + if (configArray.length > 0) { + configArray.unshift(...parentConfigArray); + } else { + configArray = parentConfigArray; + } + + // Cache and return. + return this._cacheConfig(directoryPath, configArray); + } + + /** + * Freeze and cache a given config. + * @param {string} directoryPath The path to a directory as a cache key. + * @param {ConfigArray} configArray The config array as a cache value. + * @returns {ConfigArray} The `configArray` (frozen). + */ + _cacheConfig(directoryPath, configArray) { + const { configCache } = internalSlotsMap.get(this); + + Object.freeze(configArray); + configCache.set(directoryPath, configArray); + + return configArray; + } + + /** + * Finalize a given config array. + * Concatenate `--config` and other CLI options. + * @param {ConfigArray} configArray The parent config array. + * @param {string} directoryPath The path to the leaf directory to find config files. + * @param {boolean} ignoreNotFoundError If `true` then it doesn't throw `ConfigurationNotFoundError`. + * @returns {ConfigArray} The loaded config. + * @private + */ + _finalizeConfigArray(configArray, directoryPath, ignoreNotFoundError) { + const { + cliConfigArray, + configArrayFactory, + finalizeCache, + useEslintrc, + builtInRules + } = internalSlotsMap.get(this); + + let finalConfigArray = finalizeCache.get(configArray); + + if (!finalConfigArray) { + finalConfigArray = configArray; + + // Load the personal config if there are no regular config files. + if ( + useEslintrc && + configArray.every(c => !c.filePath) && + cliConfigArray.every(c => !c.filePath) // `--config` option can be a file. + ) { + const homePath = os__default["default"].homedir(); + + debug$1("Loading the config file of the home directory:", homePath); + + const personalConfigArray = configArrayFactory.loadInDirectory( + homePath, + { name: "PersonalConfig" } + ); + + if ( + personalConfigArray.length > 0 && + !directoryPath.startsWith(homePath) + ) { + const lastElement = + personalConfigArray[personalConfigArray.length - 1]; + + emitDeprecationWarning( + lastElement.filePath, + "ESLINT_PERSONAL_CONFIG_LOAD" + ); + } + + finalConfigArray = finalConfigArray.concat(personalConfigArray); + } + + // Apply CLI options. + if (cliConfigArray.length > 0) { + finalConfigArray = finalConfigArray.concat(cliConfigArray); + } + + // Validate rule settings and environments. + const validator = new ConfigValidator({ + builtInRules + }); + + validator.validateConfigArray(finalConfigArray); + + // Cache it. + Object.freeze(finalConfigArray); + finalizeCache.set(configArray, finalConfigArray); + + debug$1( + "Configuration was determined: %o on %s", + finalConfigArray, + directoryPath + ); + } + + // At least one element (the default ignore patterns) exists. + if (!ignoreNotFoundError && useEslintrc && finalConfigArray.length <= 1) { + throw new ConfigurationNotFoundError(directoryPath); + } + + return finalConfigArray; + } +} + +/** + * @fileoverview Compatibility class for flat config. + * @author Nicholas C. Zakas + */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/** @typedef {import("../../shared/types").Environment} Environment */ +/** @typedef {import("../../shared/types").Processor} Processor */ + +const debug = debugOrig__default["default"]("eslintrc:flat-compat"); +const cafactory = Symbol("cafactory"); + +/** + * Translates an ESLintRC-style config object into a flag-config-style config + * object. + * @param {Object} eslintrcConfig An ESLintRC-style config object. + * @param {Object} options Options to help translate the config. + * @param {string} options.resolveConfigRelativeTo To the directory to resolve + * configs from. + * @param {string} options.resolvePluginsRelativeTo The directory to resolve + * plugins from. + * @param {ReadOnlyMap} options.pluginEnvironments A map of plugin environment + * names to objects. + * @param {ReadOnlyMap} options.pluginProcessors A map of plugin processor + * names to objects. + * @returns {Object} A flag-config-style config object. + */ +function translateESLintRC(eslintrcConfig, { + resolveConfigRelativeTo, + resolvePluginsRelativeTo, + pluginEnvironments, + pluginProcessors +}) { + + const flatConfig = {}; + const configs = []; + const languageOptions = {}; + const linterOptions = {}; + const keysToCopy = ["settings", "rules", "processor"]; + const languageOptionsKeysToCopy = ["globals", "parser", "parserOptions"]; + const linterOptionsKeysToCopy = ["noInlineConfig", "reportUnusedDisableDirectives"]; + + // check for special settings for eslint:all and eslint:recommended: + if (eslintrcConfig.settings) { + if (eslintrcConfig.settings["eslint:all"] === true) { + return ["eslint:all"]; + } + + if (eslintrcConfig.settings["eslint:recommended"] === true) { + return ["eslint:recommended"]; + } + } + + // copy over simple translations + for (const key of keysToCopy) { + if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") { + flatConfig[key] = eslintrcConfig[key]; + } + } + + // copy over languageOptions + for (const key of languageOptionsKeysToCopy) { + if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") { + + // create the languageOptions key in the flat config + flatConfig.languageOptions = languageOptions; + + if (key === "parser") { + debug(`Resolving parser '${languageOptions[key]}' relative to ${resolveConfigRelativeTo}`); + + if (eslintrcConfig[key].error) { + throw eslintrcConfig[key].error; + } + + languageOptions[key] = eslintrcConfig[key].definition; + continue; + } + + // clone any object values that are in the eslintrc config + if (eslintrcConfig[key] && typeof eslintrcConfig[key] === "object") { + languageOptions[key] = { + ...eslintrcConfig[key] + }; + } else { + languageOptions[key] = eslintrcConfig[key]; + } + } + } + + // copy over linterOptions + for (const key of linterOptionsKeysToCopy) { + if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") { + flatConfig.linterOptions = linterOptions; + linterOptions[key] = eslintrcConfig[key]; + } + } + + // move ecmaVersion a level up + if (languageOptions.parserOptions) { + + if ("ecmaVersion" in languageOptions.parserOptions) { + languageOptions.ecmaVersion = languageOptions.parserOptions.ecmaVersion; + delete languageOptions.parserOptions.ecmaVersion; + } + + if ("sourceType" in languageOptions.parserOptions) { + languageOptions.sourceType = languageOptions.parserOptions.sourceType; + delete languageOptions.parserOptions.sourceType; + } + + // check to see if we even need parserOptions anymore and remove it if not + if (Object.keys(languageOptions.parserOptions).length === 0) { + delete languageOptions.parserOptions; + } + } + + // overrides + if (eslintrcConfig.criteria) { + flatConfig.files = [absoluteFilePath => eslintrcConfig.criteria.test(absoluteFilePath)]; + } + + // translate plugins + if (eslintrcConfig.plugins && typeof eslintrcConfig.plugins === "object") { + debug(`Translating plugins: ${eslintrcConfig.plugins}`); + + flatConfig.plugins = {}; + + for (const pluginName of Object.keys(eslintrcConfig.plugins)) { + + debug(`Translating plugin: ${pluginName}`); + debug(`Resolving plugin '${pluginName} relative to ${resolvePluginsRelativeTo}`); + + const { definition: plugin, error } = eslintrcConfig.plugins[pluginName]; + + if (error) { + throw error; + } + + flatConfig.plugins[pluginName] = plugin; + + // create a config for any processors + if (plugin.processors) { + for (const processorName of Object.keys(plugin.processors)) { + if (processorName.startsWith(".")) { + debug(`Assigning processor: ${pluginName}/${processorName}`); + + configs.unshift({ + files: [`**/*${processorName}`], + processor: pluginProcessors.get(`${pluginName}/${processorName}`) + }); + } + + } + } + } + } + + // translate env - must come after plugins + if (eslintrcConfig.env && typeof eslintrcConfig.env === "object") { + for (const envName of Object.keys(eslintrcConfig.env)) { + + // only add environments that are true + if (eslintrcConfig.env[envName]) { + debug(`Translating environment: ${envName}`); + + if (environments.has(envName)) { + + // built-in environments should be defined first + configs.unshift(...translateESLintRC(environments.get(envName), { + resolveConfigRelativeTo, + resolvePluginsRelativeTo + })); + } else if (pluginEnvironments.has(envName)) { + + // if the environment comes from a plugin, it should come after the plugin config + configs.push(...translateESLintRC(pluginEnvironments.get(envName), { + resolveConfigRelativeTo, + resolvePluginsRelativeTo + })); + } + } + } + } + + // only add if there are actually keys in the config + if (Object.keys(flatConfig).length > 0) { + configs.push(flatConfig); + } + + return configs; +} + + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * A compatibility class for working with configs. + */ +class FlatCompat { + + constructor({ + baseDirectory = process.cwd(), + resolvePluginsRelativeTo = baseDirectory + } = {}) { + this.baseDirectory = baseDirectory; + this.resolvePluginsRelativeTo = resolvePluginsRelativeTo; + this[cafactory] = new ConfigArrayFactory({ + cwd: baseDirectory, + resolvePluginsRelativeTo, + getEslintAllConfig: () => ({ settings: { "eslint:all": true } }), + getEslintRecommendedConfig: () => ({ settings: { "eslint:recommended": true } }) + }); + } + + /** + * Translates an ESLintRC-style config into a flag-config-style config. + * @param {Object} eslintrcConfig The ESLintRC-style config object. + * @returns {Object} A flag-config-style config object. + */ + config(eslintrcConfig) { + const eslintrcArray = this[cafactory].create(eslintrcConfig, { + basePath: this.baseDirectory + }); + + const flatArray = []; + let hasIgnorePatterns = false; + + eslintrcArray.forEach(configData => { + if (configData.type === "config") { + hasIgnorePatterns = hasIgnorePatterns || configData.ignorePattern; + flatArray.push(...translateESLintRC(configData, { + resolveConfigRelativeTo: path__default["default"].join(this.baseDirectory, "__placeholder.js"), + resolvePluginsRelativeTo: path__default["default"].join(this.resolvePluginsRelativeTo, "__placeholder.js"), + pluginEnvironments: eslintrcArray.pluginEnvironments, + pluginProcessors: eslintrcArray.pluginProcessors + })); + } + }); + + // combine ignorePatterns to emulate ESLintRC behavior better + if (hasIgnorePatterns) { + flatArray.unshift({ + ignores: [filePath => { + + // Compute the final config for this file. + // This filters config array elements by `files`/`excludedFiles` then merges the elements. + const finalConfig = eslintrcArray.extractConfig(filePath); + + // Test the `ignorePattern` properties of the final config. + return Boolean(finalConfig.ignores) && finalConfig.ignores(filePath); + }] + }); + } + + return flatArray; + } + + /** + * Translates the `env` section of an ESLintRC-style config. + * @param {Object} envConfig The `env` section of an ESLintRC config. + * @returns {Object} A flag-config object representing the environments. + */ + env(envConfig) { + return this.config({ + env: envConfig + }); + } + + /** + * Translates the `extends` section of an ESLintRC-style config. + * @param {...string} configsToExtend The names of the configs to load. + * @returns {Object} A flag-config object representing the config. + */ + extends(...configsToExtend) { + return this.config({ + extends: configsToExtend + }); + } + + /** + * Translates the `plugins` section of an ESLintRC-style config. + * @param {...string} plugins The names of the plugins to load. + * @returns {Object} A flag-config object representing the plugins. + */ + plugins(...plugins) { + return this.config({ + plugins + }); + } +} + +/** + * @fileoverview Package exports for @eslint/eslintrc + * @author Nicholas C. Zakas + */ + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +const Legacy = { + ConfigArray, + createConfigArrayFactoryContext: createContext, + CascadingConfigArrayFactory, + ConfigArrayFactory, + ConfigDependency, + ExtractedConfig, + IgnorePattern, + OverrideTester, + getUsedExtractedConfigs, + environments, + + // shared + ConfigOps, + ConfigValidator, + ModuleResolver, + naming +}; + +exports.FlatCompat = FlatCompat; +exports.Legacy = Legacy; +//# sourceMappingURL=eslintrc.cjs.map diff --git a/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map b/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map new file mode 100644 index 000000000..924313cdc --- /dev/null +++ b/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"eslintrc.cjs","sources":["../lib/config-array/ignore-pattern.js","../lib/config-array/extracted-config.js","../lib/config-array/config-array.js","../lib/config-array/config-dependency.js","../lib/config-array/override-tester.js","../lib/config-array/index.js","../lib/shared/config-ops.js","../lib/shared/deprecation-warnings.js","../lib/shared/ajv.js","../conf/config-schema.js","../conf/environments.js","../lib/shared/config-validator.js","../lib/shared/naming.js","../lib/shared/relative-module-resolver.js","../lib/config-array-factory.js","../lib/cascading-config-array-factory.js","../lib/flat-compat.js","../lib/index.js"],"sourcesContent":["/**\n * @fileoverview `IgnorePattern` class.\n *\n * `IgnorePattern` class has the set of glob patterns and the base path.\n *\n * It provides two static methods.\n *\n * - `IgnorePattern.createDefaultIgnore(cwd)`\n * Create the default predicate function.\n * - `IgnorePattern.createIgnore(ignorePatterns)`\n * Create the predicate function from multiple `IgnorePattern` objects.\n *\n * It provides two properties and a method.\n *\n * - `patterns`\n * The glob patterns that ignore to lint.\n * - `basePath`\n * The base path of the glob patterns. If absolute paths existed in the\n * glob patterns, those are handled as relative paths to the base path.\n * - `getPatternsRelativeTo(basePath)`\n * Get `patterns` as modified for a given base path. It modifies the\n * absolute paths in the patterns as prepending the difference of two base\n * paths.\n *\n * `ConfigArrayFactory` creates `IgnorePattern` objects when it processes\n * `ignorePatterns` properties.\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport assert from \"assert\";\nimport path from \"path\";\nimport ignore from \"ignore\";\nimport debugOrig from \"debug\";\n\nconst debug = debugOrig(\"eslintrc:ignore-pattern\");\n\n/** @typedef {ReturnType} Ignore */\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Get the path to the common ancestor directory of given paths.\n * @param {string[]} sourcePaths The paths to calculate the common ancestor.\n * @returns {string} The path to the common ancestor directory.\n */\nfunction getCommonAncestorPath(sourcePaths) {\n let result = sourcePaths[0];\n\n for (let i = 1; i < sourcePaths.length; ++i) {\n const a = result;\n const b = sourcePaths[i];\n\n // Set the shorter one (it's the common ancestor if one includes the other).\n result = a.length < b.length ? a : b;\n\n // Set the common ancestor.\n for (let j = 0, lastSepPos = 0; j < a.length && j < b.length; ++j) {\n if (a[j] !== b[j]) {\n result = a.slice(0, lastSepPos);\n break;\n }\n if (a[j] === path.sep) {\n lastSepPos = j;\n }\n }\n }\n\n let resolvedResult = result || path.sep;\n\n // if Windows common ancestor is root of drive must have trailing slash to be absolute.\n if (resolvedResult && resolvedResult.endsWith(\":\") && process.platform === \"win32\") {\n resolvedResult += path.sep;\n }\n return resolvedResult;\n}\n\n/**\n * Make relative path.\n * @param {string} from The source path to get relative path.\n * @param {string} to The destination path to get relative path.\n * @returns {string} The relative path.\n */\nfunction relative(from, to) {\n const relPath = path.relative(from, to);\n\n if (path.sep === \"/\") {\n return relPath;\n }\n return relPath.split(path.sep).join(\"/\");\n}\n\n/**\n * Get the trailing slash if existed.\n * @param {string} filePath The path to check.\n * @returns {string} The trailing slash if existed.\n */\nfunction dirSuffix(filePath) {\n const isDir = (\n filePath.endsWith(path.sep) ||\n (process.platform === \"win32\" && filePath.endsWith(\"/\"))\n );\n\n return isDir ? \"/\" : \"\";\n}\n\nconst DefaultPatterns = Object.freeze([\"/**/node_modules/*\"]);\nconst DotPatterns = Object.freeze([\".*\", \"!.eslintrc.*\", \"!../\"]);\n\n//------------------------------------------------------------------------------\n// Public\n//------------------------------------------------------------------------------\n\nclass IgnorePattern {\n\n /**\n * The default patterns.\n * @type {string[]}\n */\n static get DefaultPatterns() {\n return DefaultPatterns;\n }\n\n /**\n * Create the default predicate function.\n * @param {string} cwd The current working directory.\n * @returns {((filePath:string, dot:boolean) => boolean) & {basePath:string; patterns:string[]}}\n * The preficate function.\n * The first argument is an absolute path that is checked.\n * The second argument is the flag to not ignore dotfiles.\n * If the predicate function returned `true`, it means the path should be ignored.\n */\n static createDefaultIgnore(cwd) {\n return this.createIgnore([new IgnorePattern(DefaultPatterns, cwd)]);\n }\n\n /**\n * Create the predicate function from multiple `IgnorePattern` objects.\n * @param {IgnorePattern[]} ignorePatterns The list of ignore patterns.\n * @returns {((filePath:string, dot?:boolean) => boolean) & {basePath:string; patterns:string[]}}\n * The preficate function.\n * The first argument is an absolute path that is checked.\n * The second argument is the flag to not ignore dotfiles.\n * If the predicate function returned `true`, it means the path should be ignored.\n */\n static createIgnore(ignorePatterns) {\n debug(\"Create with: %o\", ignorePatterns);\n\n const basePath = getCommonAncestorPath(ignorePatterns.map(p => p.basePath));\n const patterns = [].concat(\n ...ignorePatterns.map(p => p.getPatternsRelativeTo(basePath))\n );\n const ig = ignore({ allowRelativePaths: true }).add([...DotPatterns, ...patterns]);\n const dotIg = ignore({ allowRelativePaths: true }).add(patterns);\n\n debug(\" processed: %o\", { basePath, patterns });\n\n return Object.assign(\n (filePath, dot = false) => {\n assert(path.isAbsolute(filePath), \"'filePath' should be an absolute path.\");\n const relPathRaw = relative(basePath, filePath);\n const relPath = relPathRaw && (relPathRaw + dirSuffix(filePath));\n const adoptedIg = dot ? dotIg : ig;\n const result = relPath !== \"\" && adoptedIg.ignores(relPath);\n\n debug(\"Check\", { filePath, dot, relativePath: relPath, result });\n return result;\n },\n { basePath, patterns }\n );\n }\n\n /**\n * Initialize a new `IgnorePattern` instance.\n * @param {string[]} patterns The glob patterns that ignore to lint.\n * @param {string} basePath The base path of `patterns`.\n */\n constructor(patterns, basePath) {\n assert(path.isAbsolute(basePath), \"'basePath' should be an absolute path.\");\n\n /**\n * The glob patterns that ignore to lint.\n * @type {string[]}\n */\n this.patterns = patterns;\n\n /**\n * The base path of `patterns`.\n * @type {string}\n */\n this.basePath = basePath;\n\n /**\n * If `true` then patterns which don't start with `/` will match the paths to the outside of `basePath`. Defaults to `false`.\n *\n * It's set `true` for `.eslintignore`, `package.json`, and `--ignore-path` for backward compatibility.\n * It's `false` as-is for `ignorePatterns` property in config files.\n * @type {boolean}\n */\n this.loose = false;\n }\n\n /**\n * Get `patterns` as modified for a given base path. It modifies the\n * absolute paths in the patterns as prepending the difference of two base\n * paths.\n * @param {string} newBasePath The base path.\n * @returns {string[]} Modifired patterns.\n */\n getPatternsRelativeTo(newBasePath) {\n assert(path.isAbsolute(newBasePath), \"'newBasePath' should be an absolute path.\");\n const { basePath, loose, patterns } = this;\n\n if (newBasePath === basePath) {\n return patterns;\n }\n const prefix = `/${relative(newBasePath, basePath)}`;\n\n return patterns.map(pattern => {\n const negative = pattern.startsWith(\"!\");\n const head = negative ? \"!\" : \"\";\n const body = negative ? pattern.slice(1) : pattern;\n\n if (body.startsWith(\"/\") || body.startsWith(\"../\")) {\n return `${head}${prefix}${body}`;\n }\n return loose ? pattern : `${head}${prefix}/**/${body}`;\n });\n }\n}\n\nexport { IgnorePattern };\n","/**\n * @fileoverview `ExtractedConfig` class.\n *\n * `ExtractedConfig` class expresses a final configuration for a specific file.\n *\n * It provides one method.\n *\n * - `toCompatibleObjectAsConfigFileContent()`\n * Convert this configuration to the compatible object as the content of\n * config files. It converts the loaded parser and plugins to strings.\n * `CLIEngine#getConfigForFile(filePath)` method uses this method.\n *\n * `ConfigArray#extractConfig(filePath)` creates a `ExtractedConfig` instance.\n *\n * @author Toru Nagashima \n */\n\nimport { IgnorePattern } from \"./ignore-pattern.js\";\n\n// For VSCode intellisense\n/** @typedef {import(\"../../shared/types\").ConfigData} ConfigData */\n/** @typedef {import(\"../../shared/types\").GlobalConf} GlobalConf */\n/** @typedef {import(\"../../shared/types\").SeverityConf} SeverityConf */\n/** @typedef {import(\"./config-dependency\").DependentParser} DependentParser */\n/** @typedef {import(\"./config-dependency\").DependentPlugin} DependentPlugin */\n\n/**\n * Check if `xs` starts with `ys`.\n * @template T\n * @param {T[]} xs The array to check.\n * @param {T[]} ys The array that may be the first part of `xs`.\n * @returns {boolean} `true` if `xs` starts with `ys`.\n */\nfunction startsWith(xs, ys) {\n return xs.length >= ys.length && ys.every((y, i) => y === xs[i]);\n}\n\n/**\n * The class for extracted config data.\n */\nclass ExtractedConfig {\n constructor() {\n\n /**\n * The config name what `noInlineConfig` setting came from.\n * @type {string}\n */\n this.configNameOfNoInlineConfig = \"\";\n\n /**\n * Environments.\n * @type {Record}\n */\n this.env = {};\n\n /**\n * Global variables.\n * @type {Record}\n */\n this.globals = {};\n\n /**\n * The glob patterns that ignore to lint.\n * @type {(((filePath:string, dot?:boolean) => boolean) & { basePath:string; patterns:string[] }) | undefined}\n */\n this.ignores = void 0;\n\n /**\n * The flag that disables directive comments.\n * @type {boolean|undefined}\n */\n this.noInlineConfig = void 0;\n\n /**\n * Parser definition.\n * @type {DependentParser|null}\n */\n this.parser = null;\n\n /**\n * Options for the parser.\n * @type {Object}\n */\n this.parserOptions = {};\n\n /**\n * Plugin definitions.\n * @type {Record}\n */\n this.plugins = {};\n\n /**\n * Processor ID.\n * @type {string|null}\n */\n this.processor = null;\n\n /**\n * The flag that reports unused `eslint-disable` directive comments.\n * @type {boolean|undefined}\n */\n this.reportUnusedDisableDirectives = void 0;\n\n /**\n * Rule settings.\n * @type {Record}\n */\n this.rules = {};\n\n /**\n * Shared settings.\n * @type {Object}\n */\n this.settings = {};\n }\n\n /**\n * Convert this config to the compatible object as a config file content.\n * @returns {ConfigData} The converted object.\n */\n toCompatibleObjectAsConfigFileContent() {\n const {\n /* eslint-disable no-unused-vars */\n configNameOfNoInlineConfig: _ignore1,\n processor: _ignore2,\n /* eslint-enable no-unused-vars */\n ignores,\n ...config\n } = this;\n\n config.parser = config.parser && config.parser.filePath;\n config.plugins = Object.keys(config.plugins).filter(Boolean).reverse();\n config.ignorePatterns = ignores ? ignores.patterns : [];\n\n // Strip the default patterns from `ignorePatterns`.\n if (startsWith(config.ignorePatterns, IgnorePattern.DefaultPatterns)) {\n config.ignorePatterns =\n config.ignorePatterns.slice(IgnorePattern.DefaultPatterns.length);\n }\n\n return config;\n }\n}\n\nexport { ExtractedConfig };\n","/**\n * @fileoverview `ConfigArray` class.\n *\n * `ConfigArray` class expresses the full of a configuration. It has the entry\n * config file, base config files that were extended, loaded parsers, and loaded\n * plugins.\n *\n * `ConfigArray` class provides three properties and two methods.\n *\n * - `pluginEnvironments`\n * - `pluginProcessors`\n * - `pluginRules`\n * The `Map` objects that contain the members of all plugins that this\n * config array contains. Those map objects don't have mutation methods.\n * Those keys are the member ID such as `pluginId/memberName`.\n * - `isRoot()`\n * If `true` then this configuration has `root:true` property.\n * - `extractConfig(filePath)`\n * Extract the final configuration for a given file. This means merging\n * every config array element which that `criteria` property matched. The\n * `filePath` argument must be an absolute path.\n *\n * `ConfigArrayFactory` provides the loading logic of config files.\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport { ExtractedConfig } from \"./extracted-config.js\";\nimport { IgnorePattern } from \"./ignore-pattern.js\";\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n// Define types for VSCode IntelliSense.\n/** @typedef {import(\"../../shared/types\").Environment} Environment */\n/** @typedef {import(\"../../shared/types\").GlobalConf} GlobalConf */\n/** @typedef {import(\"../../shared/types\").RuleConf} RuleConf */\n/** @typedef {import(\"../../shared/types\").Rule} Rule */\n/** @typedef {import(\"../../shared/types\").Plugin} Plugin */\n/** @typedef {import(\"../../shared/types\").Processor} Processor */\n/** @typedef {import(\"./config-dependency\").DependentParser} DependentParser */\n/** @typedef {import(\"./config-dependency\").DependentPlugin} DependentPlugin */\n/** @typedef {import(\"./override-tester\")[\"OverrideTester\"]} OverrideTester */\n\n/**\n * @typedef {Object} ConfigArrayElement\n * @property {string} name The name of this config element.\n * @property {string} filePath The path to the source file of this config element.\n * @property {InstanceType|null} criteria The tester for the `files` and `excludedFiles` of this config element.\n * @property {Record|undefined} env The environment settings.\n * @property {Record|undefined} globals The global variable settings.\n * @property {IgnorePattern|undefined} ignorePattern The ignore patterns.\n * @property {boolean|undefined} noInlineConfig The flag that disables directive comments.\n * @property {DependentParser|undefined} parser The parser loader.\n * @property {Object|undefined} parserOptions The parser options.\n * @property {Record|undefined} plugins The plugin loaders.\n * @property {string|undefined} processor The processor name to refer plugin's processor.\n * @property {boolean|undefined} reportUnusedDisableDirectives The flag to report unused `eslint-disable` comments.\n * @property {boolean|undefined} root The flag to express root.\n * @property {Record|undefined} rules The rule settings\n * @property {Object|undefined} settings The shared settings.\n * @property {\"config\" | \"ignore\" | \"implicit-processor\"} type The element type.\n */\n\n/**\n * @typedef {Object} ConfigArrayInternalSlots\n * @property {Map} cache The cache to extract configs.\n * @property {ReadonlyMap|null} envMap The map from environment ID to environment definition.\n * @property {ReadonlyMap|null} processorMap The map from processor ID to environment definition.\n * @property {ReadonlyMap|null} ruleMap The map from rule ID to rule definition.\n */\n\n/** @type {WeakMap} */\nconst internalSlotsMap = new class extends WeakMap {\n get(key) {\n let value = super.get(key);\n\n if (!value) {\n value = {\n cache: new Map(),\n envMap: null,\n processorMap: null,\n ruleMap: null\n };\n super.set(key, value);\n }\n\n return value;\n }\n}();\n\n/**\n * Get the indices which are matched to a given file.\n * @param {ConfigArrayElement[]} elements The elements.\n * @param {string} filePath The path to a target file.\n * @returns {number[]} The indices.\n */\nfunction getMatchedIndices(elements, filePath) {\n const indices = [];\n\n for (let i = elements.length - 1; i >= 0; --i) {\n const element = elements[i];\n\n if (!element.criteria || (filePath && element.criteria.test(filePath))) {\n indices.push(i);\n }\n }\n\n return indices;\n}\n\n/**\n * Check if a value is a non-null object.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is a non-null object.\n */\nfunction isNonNullObject(x) {\n return typeof x === \"object\" && x !== null;\n}\n\n/**\n * Merge two objects.\n *\n * Assign every property values of `y` to `x` if `x` doesn't have the property.\n * If `x`'s property value is an object, it does recursive.\n * @param {Object} target The destination to merge\n * @param {Object|undefined} source The source to merge.\n * @returns {void}\n */\nfunction mergeWithoutOverwrite(target, source) {\n if (!isNonNullObject(source)) {\n return;\n }\n\n for (const key of Object.keys(source)) {\n if (key === \"__proto__\") {\n continue;\n }\n\n if (isNonNullObject(target[key])) {\n mergeWithoutOverwrite(target[key], source[key]);\n } else if (target[key] === void 0) {\n if (isNonNullObject(source[key])) {\n target[key] = Array.isArray(source[key]) ? [] : {};\n mergeWithoutOverwrite(target[key], source[key]);\n } else if (source[key] !== void 0) {\n target[key] = source[key];\n }\n }\n }\n}\n\n/**\n * The error for plugin conflicts.\n */\nclass PluginConflictError extends Error {\n\n /**\n * Initialize this error object.\n * @param {string} pluginId The plugin ID.\n * @param {{filePath:string, importerName:string}[]} plugins The resolved plugins.\n */\n constructor(pluginId, plugins) {\n super(`Plugin \"${pluginId}\" was conflicted between ${plugins.map(p => `\"${p.importerName}\"`).join(\" and \")}.`);\n this.messageTemplate = \"plugin-conflict\";\n this.messageData = { pluginId, plugins };\n }\n}\n\n/**\n * Merge plugins.\n * `target`'s definition is prior to `source`'s.\n * @param {Record} target The destination to merge\n * @param {Record|undefined} source The source to merge.\n * @returns {void}\n */\nfunction mergePlugins(target, source) {\n if (!isNonNullObject(source)) {\n return;\n }\n\n for (const key of Object.keys(source)) {\n if (key === \"__proto__\") {\n continue;\n }\n const targetValue = target[key];\n const sourceValue = source[key];\n\n // Adopt the plugin which was found at first.\n if (targetValue === void 0) {\n if (sourceValue.error) {\n throw sourceValue.error;\n }\n target[key] = sourceValue;\n } else if (sourceValue.filePath !== targetValue.filePath) {\n throw new PluginConflictError(key, [\n {\n filePath: targetValue.filePath,\n importerName: targetValue.importerName\n },\n {\n filePath: sourceValue.filePath,\n importerName: sourceValue.importerName\n }\n ]);\n }\n }\n}\n\n/**\n * Merge rule configs.\n * `target`'s definition is prior to `source`'s.\n * @param {Record} target The destination to merge\n * @param {Record|undefined} source The source to merge.\n * @returns {void}\n */\nfunction mergeRuleConfigs(target, source) {\n if (!isNonNullObject(source)) {\n return;\n }\n\n for (const key of Object.keys(source)) {\n if (key === \"__proto__\") {\n continue;\n }\n const targetDef = target[key];\n const sourceDef = source[key];\n\n // Adopt the rule config which was found at first.\n if (targetDef === void 0) {\n if (Array.isArray(sourceDef)) {\n target[key] = [...sourceDef];\n } else {\n target[key] = [sourceDef];\n }\n\n /*\n * If the first found rule config is severity only and the current rule\n * config has options, merge the severity and the options.\n */\n } else if (\n targetDef.length === 1 &&\n Array.isArray(sourceDef) &&\n sourceDef.length >= 2\n ) {\n targetDef.push(...sourceDef.slice(1));\n }\n }\n}\n\n/**\n * Create the extracted config.\n * @param {ConfigArray} instance The config elements.\n * @param {number[]} indices The indices to use.\n * @returns {ExtractedConfig} The extracted config.\n */\nfunction createConfig(instance, indices) {\n const config = new ExtractedConfig();\n const ignorePatterns = [];\n\n // Merge elements.\n for (const index of indices) {\n const element = instance[index];\n\n // Adopt the parser which was found at first.\n if (!config.parser && element.parser) {\n if (element.parser.error) {\n throw element.parser.error;\n }\n config.parser = element.parser;\n }\n\n // Adopt the processor which was found at first.\n if (!config.processor && element.processor) {\n config.processor = element.processor;\n }\n\n // Adopt the noInlineConfig which was found at first.\n if (config.noInlineConfig === void 0 && element.noInlineConfig !== void 0) {\n config.noInlineConfig = element.noInlineConfig;\n config.configNameOfNoInlineConfig = element.name;\n }\n\n // Adopt the reportUnusedDisableDirectives which was found at first.\n if (config.reportUnusedDisableDirectives === void 0 && element.reportUnusedDisableDirectives !== void 0) {\n config.reportUnusedDisableDirectives = element.reportUnusedDisableDirectives;\n }\n\n // Collect ignorePatterns\n if (element.ignorePattern) {\n ignorePatterns.push(element.ignorePattern);\n }\n\n // Merge others.\n mergeWithoutOverwrite(config.env, element.env);\n mergeWithoutOverwrite(config.globals, element.globals);\n mergeWithoutOverwrite(config.parserOptions, element.parserOptions);\n mergeWithoutOverwrite(config.settings, element.settings);\n mergePlugins(config.plugins, element.plugins);\n mergeRuleConfigs(config.rules, element.rules);\n }\n\n // Create the predicate function for ignore patterns.\n if (ignorePatterns.length > 0) {\n config.ignores = IgnorePattern.createIgnore(ignorePatterns.reverse());\n }\n\n return config;\n}\n\n/**\n * Collect definitions.\n * @template T, U\n * @param {string} pluginId The plugin ID for prefix.\n * @param {Record} defs The definitions to collect.\n * @param {Map} map The map to output.\n * @param {function(T): U} [normalize] The normalize function for each value.\n * @returns {void}\n */\nfunction collect(pluginId, defs, map, normalize) {\n if (defs) {\n const prefix = pluginId && `${pluginId}/`;\n\n for (const [key, value] of Object.entries(defs)) {\n map.set(\n `${prefix}${key}`,\n normalize ? normalize(value) : value\n );\n }\n }\n}\n\n/**\n * Normalize a rule definition.\n * @param {Function|Rule} rule The rule definition to normalize.\n * @returns {Rule} The normalized rule definition.\n */\nfunction normalizePluginRule(rule) {\n return typeof rule === \"function\" ? { create: rule } : rule;\n}\n\n/**\n * Delete the mutation methods from a given map.\n * @param {Map} map The map object to delete.\n * @returns {void}\n */\nfunction deleteMutationMethods(map) {\n Object.defineProperties(map, {\n clear: { configurable: true, value: void 0 },\n delete: { configurable: true, value: void 0 },\n set: { configurable: true, value: void 0 }\n });\n}\n\n/**\n * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array.\n * @param {ConfigArrayElement[]} elements The config elements.\n * @param {ConfigArrayInternalSlots} slots The internal slots.\n * @returns {void}\n */\nfunction initPluginMemberMaps(elements, slots) {\n const processed = new Set();\n\n slots.envMap = new Map();\n slots.processorMap = new Map();\n slots.ruleMap = new Map();\n\n for (const element of elements) {\n if (!element.plugins) {\n continue;\n }\n\n for (const [pluginId, value] of Object.entries(element.plugins)) {\n const plugin = value.definition;\n\n if (!plugin || processed.has(pluginId)) {\n continue;\n }\n processed.add(pluginId);\n\n collect(pluginId, plugin.environments, slots.envMap);\n collect(pluginId, plugin.processors, slots.processorMap);\n collect(pluginId, plugin.rules, slots.ruleMap, normalizePluginRule);\n }\n }\n\n deleteMutationMethods(slots.envMap);\n deleteMutationMethods(slots.processorMap);\n deleteMutationMethods(slots.ruleMap);\n}\n\n/**\n * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array.\n * @param {ConfigArray} instance The config elements.\n * @returns {ConfigArrayInternalSlots} The extracted config.\n */\nfunction ensurePluginMemberMaps(instance) {\n const slots = internalSlotsMap.get(instance);\n\n if (!slots.ruleMap) {\n initPluginMemberMaps(instance, slots);\n }\n\n return slots;\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * The Config Array.\n *\n * `ConfigArray` instance contains all settings, parsers, and plugins.\n * You need to call `ConfigArray#extractConfig(filePath)` method in order to\n * extract, merge and get only the config data which is related to an arbitrary\n * file.\n * @extends {Array}\n */\nclass ConfigArray extends Array {\n\n /**\n * Get the plugin environments.\n * The returned map cannot be mutated.\n * @type {ReadonlyMap} The plugin environments.\n */\n get pluginEnvironments() {\n return ensurePluginMemberMaps(this).envMap;\n }\n\n /**\n * Get the plugin processors.\n * The returned map cannot be mutated.\n * @type {ReadonlyMap} The plugin processors.\n */\n get pluginProcessors() {\n return ensurePluginMemberMaps(this).processorMap;\n }\n\n /**\n * Get the plugin rules.\n * The returned map cannot be mutated.\n * @returns {ReadonlyMap} The plugin rules.\n */\n get pluginRules() {\n return ensurePluginMemberMaps(this).ruleMap;\n }\n\n /**\n * Check if this config has `root` flag.\n * @returns {boolean} `true` if this config array is root.\n */\n isRoot() {\n for (let i = this.length - 1; i >= 0; --i) {\n const root = this[i].root;\n\n if (typeof root === \"boolean\") {\n return root;\n }\n }\n return false;\n }\n\n /**\n * Extract the config data which is related to a given file.\n * @param {string} filePath The absolute path to the target file.\n * @returns {ExtractedConfig} The extracted config data.\n */\n extractConfig(filePath) {\n const { cache } = internalSlotsMap.get(this);\n const indices = getMatchedIndices(this, filePath);\n const cacheKey = indices.join(\",\");\n\n if (!cache.has(cacheKey)) {\n cache.set(cacheKey, createConfig(this, indices));\n }\n\n return cache.get(cacheKey);\n }\n\n /**\n * Check if a given path is an additional lint target.\n * @param {string} filePath The absolute path to the target file.\n * @returns {boolean} `true` if the file is an additional lint target.\n */\n isAdditionalTargetPath(filePath) {\n for (const { criteria, type } of this) {\n if (\n type === \"config\" &&\n criteria &&\n !criteria.endsWithWildcard &&\n criteria.test(filePath)\n ) {\n return true;\n }\n }\n return false;\n }\n}\n\n/**\n * Get the used extracted configs.\n * CLIEngine will use this method to collect used deprecated rules.\n * @param {ConfigArray} instance The config array object to get.\n * @returns {ExtractedConfig[]} The used extracted configs.\n * @private\n */\nfunction getUsedExtractedConfigs(instance) {\n const { cache } = internalSlotsMap.get(instance);\n\n return Array.from(cache.values());\n}\n\n\nexport {\n ConfigArray,\n getUsedExtractedConfigs\n};\n","/**\n * @fileoverview `ConfigDependency` class.\n *\n * `ConfigDependency` class expresses a loaded parser or plugin.\n *\n * If the parser or plugin was loaded successfully, it has `definition` property\n * and `filePath` property. Otherwise, it has `error` property.\n *\n * When `JSON.stringify()` converted a `ConfigDependency` object to a JSON, it\n * omits `definition` property.\n *\n * `ConfigArrayFactory` creates `ConfigDependency` objects when it loads parsers\n * or plugins.\n *\n * @author Toru Nagashima \n */\n\nimport util from \"util\";\n\n/**\n * The class is to store parsers or plugins.\n * This class hides the loaded object from `JSON.stringify()` and `console.log`.\n * @template T\n */\nclass ConfigDependency {\n\n /**\n * Initialize this instance.\n * @param {Object} data The dependency data.\n * @param {T} [data.definition] The dependency if the loading succeeded.\n * @param {Error} [data.error] The error object if the loading failed.\n * @param {string} [data.filePath] The actual path to the dependency if the loading succeeded.\n * @param {string} data.id The ID of this dependency.\n * @param {string} data.importerName The name of the config file which loads this dependency.\n * @param {string} data.importerPath The path to the config file which loads this dependency.\n */\n constructor({\n definition = null,\n error = null,\n filePath = null,\n id,\n importerName,\n importerPath\n }) {\n\n /**\n * The loaded dependency if the loading succeeded.\n * @type {T|null}\n */\n this.definition = definition;\n\n /**\n * The error object if the loading failed.\n * @type {Error|null}\n */\n this.error = error;\n\n /**\n * The loaded dependency if the loading succeeded.\n * @type {string|null}\n */\n this.filePath = filePath;\n\n /**\n * The ID of this dependency.\n * @type {string}\n */\n this.id = id;\n\n /**\n * The name of the config file which loads this dependency.\n * @type {string}\n */\n this.importerName = importerName;\n\n /**\n * The path to the config file which loads this dependency.\n * @type {string}\n */\n this.importerPath = importerPath;\n }\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @returns {Object} a JSON compatible object.\n */\n toJSON() {\n const obj = this[util.inspect.custom]();\n\n // Display `error.message` (`Error#message` is unenumerable).\n if (obj.error instanceof Error) {\n obj.error = { ...obj.error, message: obj.error.message };\n }\n\n return obj;\n }\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @returns {Object} an object to display by `console.log()`.\n */\n [util.inspect.custom]() {\n const {\n definition: _ignore, // eslint-disable-line no-unused-vars\n ...obj\n } = this;\n\n return obj;\n }\n}\n\n/** @typedef {ConfigDependency} DependentParser */\n/** @typedef {ConfigDependency} DependentPlugin */\n\nexport { ConfigDependency };\n","/**\n * @fileoverview `OverrideTester` class.\n *\n * `OverrideTester` class handles `files` property and `excludedFiles` property\n * of `overrides` config.\n *\n * It provides one method.\n *\n * - `test(filePath)`\n * Test if a file path matches the pair of `files` property and\n * `excludedFiles` property. The `filePath` argument must be an absolute\n * path.\n *\n * `ConfigArrayFactory` creates `OverrideTester` objects when it processes\n * `overrides` properties.\n *\n * @author Toru Nagashima \n */\n\nimport assert from \"assert\";\nimport path from \"path\";\nimport util from \"util\";\nimport minimatch from \"minimatch\";\n\nconst { Minimatch } = minimatch;\n\nconst minimatchOpts = { dot: true, matchBase: true };\n\n/**\n * @typedef {Object} Pattern\n * @property {InstanceType[] | null} includes The positive matchers.\n * @property {InstanceType[] | null} excludes The negative matchers.\n */\n\n/**\n * Normalize a given pattern to an array.\n * @param {string|string[]|undefined} patterns A glob pattern or an array of glob patterns.\n * @returns {string[]|null} Normalized patterns.\n * @private\n */\nfunction normalizePatterns(patterns) {\n if (Array.isArray(patterns)) {\n return patterns.filter(Boolean);\n }\n if (typeof patterns === \"string\" && patterns) {\n return [patterns];\n }\n return [];\n}\n\n/**\n * Create the matchers of given patterns.\n * @param {string[]} patterns The patterns.\n * @returns {InstanceType[] | null} The matchers.\n */\nfunction toMatcher(patterns) {\n if (patterns.length === 0) {\n return null;\n }\n return patterns.map(pattern => {\n if (/^\\.[/\\\\]/u.test(pattern)) {\n return new Minimatch(\n pattern.slice(2),\n\n // `./*.js` should not match with `subdir/foo.js`\n { ...minimatchOpts, matchBase: false }\n );\n }\n return new Minimatch(pattern, minimatchOpts);\n });\n}\n\n/**\n * Convert a given matcher to string.\n * @param {Pattern} matchers The matchers.\n * @returns {string} The string expression of the matcher.\n */\nfunction patternToJson({ includes, excludes }) {\n return {\n includes: includes && includes.map(m => m.pattern),\n excludes: excludes && excludes.map(m => m.pattern)\n };\n}\n\n/**\n * The class to test given paths are matched by the patterns.\n */\nclass OverrideTester {\n\n /**\n * Create a tester with given criteria.\n * If there are no criteria, returns `null`.\n * @param {string|string[]} files The glob patterns for included files.\n * @param {string|string[]} excludedFiles The glob patterns for excluded files.\n * @param {string} basePath The path to the base directory to test paths.\n * @returns {OverrideTester|null} The created instance or `null`.\n */\n static create(files, excludedFiles, basePath) {\n const includePatterns = normalizePatterns(files);\n const excludePatterns = normalizePatterns(excludedFiles);\n let endsWithWildcard = false;\n\n if (includePatterns.length === 0) {\n return null;\n }\n\n // Rejects absolute paths or relative paths to parents.\n for (const pattern of includePatterns) {\n if (path.isAbsolute(pattern) || pattern.includes(\"..\")) {\n throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`);\n }\n if (pattern.endsWith(\"*\")) {\n endsWithWildcard = true;\n }\n }\n for (const pattern of excludePatterns) {\n if (path.isAbsolute(pattern) || pattern.includes(\"..\")) {\n throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`);\n }\n }\n\n const includes = toMatcher(includePatterns);\n const excludes = toMatcher(excludePatterns);\n\n return new OverrideTester(\n [{ includes, excludes }],\n basePath,\n endsWithWildcard\n );\n }\n\n /**\n * Combine two testers by logical and.\n * If either of the testers was `null`, returns the other tester.\n * The `basePath` property of the two must be the same value.\n * @param {OverrideTester|null} a A tester.\n * @param {OverrideTester|null} b Another tester.\n * @returns {OverrideTester|null} Combined tester.\n */\n static and(a, b) {\n if (!b) {\n return a && new OverrideTester(\n a.patterns,\n a.basePath,\n a.endsWithWildcard\n );\n }\n if (!a) {\n return new OverrideTester(\n b.patterns,\n b.basePath,\n b.endsWithWildcard\n );\n }\n\n assert.strictEqual(a.basePath, b.basePath);\n return new OverrideTester(\n a.patterns.concat(b.patterns),\n a.basePath,\n a.endsWithWildcard || b.endsWithWildcard\n );\n }\n\n /**\n * Initialize this instance.\n * @param {Pattern[]} patterns The matchers.\n * @param {string} basePath The base path.\n * @param {boolean} endsWithWildcard If `true` then a pattern ends with `*`.\n */\n constructor(patterns, basePath, endsWithWildcard = false) {\n\n /** @type {Pattern[]} */\n this.patterns = patterns;\n\n /** @type {string} */\n this.basePath = basePath;\n\n /** @type {boolean} */\n this.endsWithWildcard = endsWithWildcard;\n }\n\n /**\n * Test if a given path is matched or not.\n * @param {string} filePath The absolute path to the target file.\n * @returns {boolean} `true` if the path was matched.\n */\n test(filePath) {\n if (typeof filePath !== \"string\" || !path.isAbsolute(filePath)) {\n throw new Error(`'filePath' should be an absolute path, but got ${filePath}.`);\n }\n const relativePath = path.relative(this.basePath, filePath);\n\n return this.patterns.every(({ includes, excludes }) => (\n (!includes || includes.some(m => m.match(relativePath))) &&\n (!excludes || !excludes.some(m => m.match(relativePath)))\n ));\n }\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @returns {Object} a JSON compatible object.\n */\n toJSON() {\n if (this.patterns.length === 1) {\n return {\n ...patternToJson(this.patterns[0]),\n basePath: this.basePath\n };\n }\n return {\n AND: this.patterns.map(patternToJson),\n basePath: this.basePath\n };\n }\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @returns {Object} an object to display by `console.log()`.\n */\n [util.inspect.custom]() {\n return this.toJSON();\n }\n}\n\nexport { OverrideTester };\n","/**\n * @fileoverview `ConfigArray` class.\n * @author Toru Nagashima \n */\n\nimport { ConfigArray, getUsedExtractedConfigs } from \"./config-array.js\";\nimport { ConfigDependency } from \"./config-dependency.js\";\nimport { ExtractedConfig } from \"./extracted-config.js\";\nimport { IgnorePattern } from \"./ignore-pattern.js\";\nimport { OverrideTester } from \"./override-tester.js\";\n\nexport {\n ConfigArray,\n ConfigDependency,\n ExtractedConfig,\n IgnorePattern,\n OverrideTester,\n getUsedExtractedConfigs\n};\n","/**\n * @fileoverview Config file operations. This file must be usable in the browser,\n * so no Node-specific code can be here.\n * @author Nicholas C. Zakas\n */\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\nconst RULE_SEVERITY_STRINGS = [\"off\", \"warn\", \"error\"],\n RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => {\n map[value] = index;\n return map;\n }, {}),\n VALID_SEVERITIES = [0, 1, 2, \"off\", \"warn\", \"error\"];\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * Normalizes the severity value of a rule's configuration to a number\n * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally\n * received from the user. A valid config value is either 0, 1, 2, the string \"off\" (treated the same as 0),\n * the string \"warn\" (treated the same as 1), the string \"error\" (treated the same as 2), or an array\n * whose first element is one of the above values. Strings are matched case-insensitively.\n * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0.\n */\nfunction getRuleSeverity(ruleConfig) {\n const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (severityValue === 0 || severityValue === 1 || severityValue === 2) {\n return severityValue;\n }\n\n if (typeof severityValue === \"string\") {\n return RULE_SEVERITY[severityValue.toLowerCase()] || 0;\n }\n\n return 0;\n}\n\n/**\n * Converts old-style severity settings (0, 1, 2) into new-style\n * severity settings (off, warn, error) for all rules. Assumption is that severity\n * values have already been validated as correct.\n * @param {Object} config The config object to normalize.\n * @returns {void}\n */\nfunction normalizeToStrings(config) {\n\n if (config.rules) {\n Object.keys(config.rules).forEach(ruleId => {\n const ruleConfig = config.rules[ruleId];\n\n if (typeof ruleConfig === \"number\") {\n config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0];\n } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === \"number\") {\n ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0];\n }\n });\n }\n}\n\n/**\n * Determines if the severity for the given rule configuration represents an error.\n * @param {int|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} True if the rule represents an error, false if not.\n */\nfunction isErrorSeverity(ruleConfig) {\n return getRuleSeverity(ruleConfig) === 2;\n}\n\n/**\n * Checks whether a given config has valid severity or not.\n * @param {number|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isValidSeverity(ruleConfig) {\n let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (typeof severity === \"string\") {\n severity = severity.toLowerCase();\n }\n return VALID_SEVERITIES.indexOf(severity) !== -1;\n}\n\n/**\n * Checks whether every rule of a given config has valid severity or not.\n * @param {Object} config The configuration for rules.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isEverySeverityValid(config) {\n return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId]));\n}\n\n/**\n * Normalizes a value for a global in a config\n * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in\n * a global directive comment\n * @returns {(\"readable\"|\"writeable\"|\"off\")} The value normalized as a string\n * @throws Error if global value is invalid\n */\nfunction normalizeConfigGlobal(configuredValue) {\n switch (configuredValue) {\n case \"off\":\n return \"off\";\n\n case true:\n case \"true\":\n case \"writeable\":\n case \"writable\":\n return \"writable\";\n\n case null:\n case false:\n case \"false\":\n case \"readable\":\n case \"readonly\":\n return \"readonly\";\n\n default:\n throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`);\n }\n}\n\nexport {\n getRuleSeverity,\n normalizeToStrings,\n isErrorSeverity,\n isValidSeverity,\n isEverySeverityValid,\n normalizeConfigGlobal\n};\n","/**\n * @fileoverview Provide the function that emits deprecation warnings.\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport path from \"path\";\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\n// Defitions for deprecation warnings.\nconst deprecationWarningMessages = {\n ESLINT_LEGACY_ECMAFEATURES:\n \"The 'ecmaFeatures' config file property is deprecated and has no effect.\",\n ESLINT_PERSONAL_CONFIG_LOAD:\n \"'~/.eslintrc.*' config files have been deprecated. \" +\n \"Please use a config file per project or the '--config' option.\",\n ESLINT_PERSONAL_CONFIG_SUPPRESS:\n \"'~/.eslintrc.*' config files have been deprecated. \" +\n \"Please remove it or add 'root:true' to the config files in your \" +\n \"projects in order to avoid loading '~/.eslintrc.*' accidentally.\"\n};\n\nconst sourceFileErrorCache = new Set();\n\n/**\n * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted\n * for each unique file path, but repeated invocations with the same file path have no effect.\n * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active.\n * @param {string} source The name of the configuration source to report the warning for.\n * @param {string} errorCode The warning message to show.\n * @returns {void}\n */\nfunction emitDeprecationWarning(source, errorCode) {\n const cacheKey = JSON.stringify({ source, errorCode });\n\n if (sourceFileErrorCache.has(cacheKey)) {\n return;\n }\n sourceFileErrorCache.add(cacheKey);\n\n const rel = path.relative(process.cwd(), source);\n const message = deprecationWarningMessages[errorCode];\n\n process.emitWarning(\n `${message} (found in \"${rel}\")`,\n \"DeprecationWarning\",\n errorCode\n );\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport {\n emitDeprecationWarning\n};\n","/**\n * @fileoverview The instance of Ajv validator.\n * @author Evgeny Poberezkin\n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport Ajv from \"ajv\";\n\n//-----------------------------------------------------------------------------\n// Helpers\n//-----------------------------------------------------------------------------\n\n/*\n * Copied from ajv/lib/refs/json-schema-draft-04.json\n * The MIT License (MIT)\n * Copyright (c) 2015-2017 Evgeny Poberezkin\n */\nconst metaSchema = {\n id: \"http://json-schema.org/draft-04/schema#\",\n $schema: \"http://json-schema.org/draft-04/schema#\",\n description: \"Core schema meta-schema\",\n definitions: {\n schemaArray: {\n type: \"array\",\n minItems: 1,\n items: { $ref: \"#\" }\n },\n positiveInteger: {\n type: \"integer\",\n minimum: 0\n },\n positiveIntegerDefault0: {\n allOf: [{ $ref: \"#/definitions/positiveInteger\" }, { default: 0 }]\n },\n simpleTypes: {\n enum: [\"array\", \"boolean\", \"integer\", \"null\", \"number\", \"object\", \"string\"]\n },\n stringArray: {\n type: \"array\",\n items: { type: \"string\" },\n minItems: 1,\n uniqueItems: true\n }\n },\n type: \"object\",\n properties: {\n id: {\n type: \"string\"\n },\n $schema: {\n type: \"string\"\n },\n title: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n default: { },\n multipleOf: {\n type: \"number\",\n minimum: 0,\n exclusiveMinimum: true\n },\n maximum: {\n type: \"number\"\n },\n exclusiveMaximum: {\n type: \"boolean\",\n default: false\n },\n minimum: {\n type: \"number\"\n },\n exclusiveMinimum: {\n type: \"boolean\",\n default: false\n },\n maxLength: { $ref: \"#/definitions/positiveInteger\" },\n minLength: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n pattern: {\n type: \"string\",\n format: \"regex\"\n },\n additionalItems: {\n anyOf: [\n { type: \"boolean\" },\n { $ref: \"#\" }\n ],\n default: { }\n },\n items: {\n anyOf: [\n { $ref: \"#\" },\n { $ref: \"#/definitions/schemaArray\" }\n ],\n default: { }\n },\n maxItems: { $ref: \"#/definitions/positiveInteger\" },\n minItems: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n uniqueItems: {\n type: \"boolean\",\n default: false\n },\n maxProperties: { $ref: \"#/definitions/positiveInteger\" },\n minProperties: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n required: { $ref: \"#/definitions/stringArray\" },\n additionalProperties: {\n anyOf: [\n { type: \"boolean\" },\n { $ref: \"#\" }\n ],\n default: { }\n },\n definitions: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n properties: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n patternProperties: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n dependencies: {\n type: \"object\",\n additionalProperties: {\n anyOf: [\n { $ref: \"#\" },\n { $ref: \"#/definitions/stringArray\" }\n ]\n }\n },\n enum: {\n type: \"array\",\n minItems: 1,\n uniqueItems: true\n },\n type: {\n anyOf: [\n { $ref: \"#/definitions/simpleTypes\" },\n {\n type: \"array\",\n items: { $ref: \"#/definitions/simpleTypes\" },\n minItems: 1,\n uniqueItems: true\n }\n ]\n },\n format: { type: \"string\" },\n allOf: { $ref: \"#/definitions/schemaArray\" },\n anyOf: { $ref: \"#/definitions/schemaArray\" },\n oneOf: { $ref: \"#/definitions/schemaArray\" },\n not: { $ref: \"#\" }\n },\n dependencies: {\n exclusiveMaximum: [\"maximum\"],\n exclusiveMinimum: [\"minimum\"]\n },\n default: { }\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport default (additionalOptions = {}) => {\n const ajv = new Ajv({\n meta: false,\n useDefaults: true,\n validateSchema: false,\n missingRefs: \"ignore\",\n verbose: true,\n schemaId: \"auto\",\n ...additionalOptions\n });\n\n ajv.addMetaSchema(metaSchema);\n // eslint-disable-next-line no-underscore-dangle\n ajv._opts.defaultMeta = metaSchema.id;\n\n return ajv;\n};\n","/**\n * @fileoverview Defines a schema for configs.\n * @author Sylvan Mably\n */\n\nconst baseConfigProperties = {\n $schema: { type: \"string\" },\n env: { type: \"object\" },\n extends: { $ref: \"#/definitions/stringOrStrings\" },\n globals: { type: \"object\" },\n overrides: {\n type: \"array\",\n items: { $ref: \"#/definitions/overrideConfig\" },\n additionalItems: false\n },\n parser: { type: [\"string\", \"null\"] },\n parserOptions: { type: \"object\" },\n plugins: { type: \"array\" },\n processor: { type: \"string\" },\n rules: { type: \"object\" },\n settings: { type: \"object\" },\n noInlineConfig: { type: \"boolean\" },\n reportUnusedDisableDirectives: { type: \"boolean\" },\n\n ecmaFeatures: { type: \"object\" } // deprecated; logs a warning when used\n};\n\nconst configSchema = {\n definitions: {\n stringOrStrings: {\n oneOf: [\n { type: \"string\" },\n {\n type: \"array\",\n items: { type: \"string\" },\n additionalItems: false\n }\n ]\n },\n stringOrStringsRequired: {\n oneOf: [\n { type: \"string\" },\n {\n type: \"array\",\n items: { type: \"string\" },\n additionalItems: false,\n minItems: 1\n }\n ]\n },\n\n // Config at top-level.\n objectConfig: {\n type: \"object\",\n properties: {\n root: { type: \"boolean\" },\n ignorePatterns: { $ref: \"#/definitions/stringOrStrings\" },\n ...baseConfigProperties\n },\n additionalProperties: false\n },\n\n // Config in `overrides`.\n overrideConfig: {\n type: \"object\",\n properties: {\n excludedFiles: { $ref: \"#/definitions/stringOrStrings\" },\n files: { $ref: \"#/definitions/stringOrStringsRequired\" },\n ...baseConfigProperties\n },\n required: [\"files\"],\n additionalProperties: false\n }\n },\n\n $ref: \"#/definitions/objectConfig\"\n};\n\nexport default configSchema;\n","/**\n * @fileoverview Defines environment settings and globals.\n * @author Elan Shanker\n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport globals from \"globals\";\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Get the object that has difference.\n * @param {Record} current The newer object.\n * @param {Record} prev The older object.\n * @returns {Record} The difference object.\n */\nfunction getDiff(current, prev) {\n const retv = {};\n\n for (const [key, value] of Object.entries(current)) {\n if (!Object.hasOwnProperty.call(prev, key)) {\n retv[key] = value;\n }\n }\n\n return retv;\n}\n\nconst newGlobals2015 = getDiff(globals.es2015, globals.es5); // 19 variables such as Promise, Map, ...\nconst newGlobals2017 = {\n Atomics: false,\n SharedArrayBuffer: false\n};\nconst newGlobals2020 = {\n BigInt: false,\n BigInt64Array: false,\n BigUint64Array: false,\n globalThis: false\n};\n\nconst newGlobals2021 = {\n AggregateError: false,\n FinalizationRegistry: false,\n WeakRef: false\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/** @type {Map} */\nexport default new Map(Object.entries({\n\n // Language\n builtin: {\n globals: globals.es5\n },\n es6: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2015: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2016: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 7\n }\n },\n es2017: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 8\n }\n },\n es2018: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 9\n }\n },\n es2019: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 10\n }\n },\n es2020: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 },\n parserOptions: {\n ecmaVersion: 11\n }\n },\n es2021: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 12\n }\n },\n es2022: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 13\n }\n },\n\n // Platforms\n browser: {\n globals: globals.browser\n },\n node: {\n globals: globals.node,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n \"shared-node-browser\": {\n globals: globals[\"shared-node-browser\"]\n },\n worker: {\n globals: globals.worker\n },\n serviceworker: {\n globals: globals.serviceworker\n },\n\n // Frameworks\n commonjs: {\n globals: globals.commonjs,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n amd: {\n globals: globals.amd\n },\n mocha: {\n globals: globals.mocha\n },\n jasmine: {\n globals: globals.jasmine\n },\n jest: {\n globals: globals.jest\n },\n phantomjs: {\n globals: globals.phantomjs\n },\n jquery: {\n globals: globals.jquery\n },\n qunit: {\n globals: globals.qunit\n },\n prototypejs: {\n globals: globals.prototypejs\n },\n shelljs: {\n globals: globals.shelljs\n },\n meteor: {\n globals: globals.meteor\n },\n mongo: {\n globals: globals.mongo\n },\n protractor: {\n globals: globals.protractor\n },\n applescript: {\n globals: globals.applescript\n },\n nashorn: {\n globals: globals.nashorn\n },\n atomtest: {\n globals: globals.atomtest\n },\n embertest: {\n globals: globals.embertest\n },\n webextensions: {\n globals: globals.webextensions\n },\n greasemonkey: {\n globals: globals.greasemonkey\n }\n}));\n","/**\n * @fileoverview Validates configs.\n * @author Brandon Mills\n */\n\n/* eslint class-methods-use-this: \"off\" */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport util from \"util\";\nimport * as ConfigOps from \"./config-ops.js\";\nimport { emitDeprecationWarning } from \"./deprecation-warnings.js\";\nimport ajvOrig from \"./ajv.js\";\nimport configSchema from \"../../conf/config-schema.js\";\nimport BuiltInEnvironments from \"../../conf/environments.js\";\n\nconst ajv = ajvOrig();\n\nconst ruleValidators = new WeakMap();\nconst noop = Function.prototype;\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\nlet validateSchema;\nconst severityMap = {\n error: 2,\n warn: 1,\n off: 0\n};\n\nconst validated = new WeakSet();\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\nexport default class ConfigValidator {\n constructor({ builtInRules = new Map() } = {}) {\n this.builtInRules = builtInRules;\n }\n\n /**\n * Gets a complete options schema for a rule.\n * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object\n * @returns {Object} JSON Schema for the rule's options.\n */\n getRuleOptionsSchema(rule) {\n if (!rule) {\n return null;\n }\n\n const schema = rule.schema || rule.meta && rule.meta.schema;\n\n // Given a tuple of schemas, insert warning level at the beginning\n if (Array.isArray(schema)) {\n if (schema.length) {\n return {\n type: \"array\",\n items: schema,\n minItems: 0,\n maxItems: schema.length\n };\n }\n return {\n type: \"array\",\n minItems: 0,\n maxItems: 0\n };\n\n }\n\n // Given a full schema, leave it alone\n return schema || null;\n }\n\n /**\n * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid.\n * @param {options} options The given options for the rule.\n * @returns {number|string} The rule's severity value\n */\n validateRuleSeverity(options) {\n const severity = Array.isArray(options) ? options[0] : options;\n const normSeverity = typeof severity === \"string\" ? severityMap[severity.toLowerCase()] : severity;\n\n if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {\n return normSeverity;\n }\n\n throw new Error(`\\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, \"\\\"\").replace(/\\n/gu, \"\")}').\\n`);\n\n }\n\n /**\n * Validates the non-severity options passed to a rule, based on its schema.\n * @param {{create: Function}} rule The rule to validate\n * @param {Array} localOptions The options for the rule, excluding severity\n * @returns {void}\n */\n validateRuleSchema(rule, localOptions) {\n if (!ruleValidators.has(rule)) {\n const schema = this.getRuleOptionsSchema(rule);\n\n if (schema) {\n ruleValidators.set(rule, ajv.compile(schema));\n }\n }\n\n const validateRule = ruleValidators.get(rule);\n\n if (validateRule) {\n validateRule(localOptions);\n if (validateRule.errors) {\n throw new Error(validateRule.errors.map(\n error => `\\tValue ${JSON.stringify(error.data)} ${error.message}.\\n`\n ).join(\"\"));\n }\n }\n }\n\n /**\n * Validates a rule's options against its schema.\n * @param {{create: Function}|null} rule The rule that the config is being validated for\n * @param {string} ruleId The rule's unique name.\n * @param {Array|number} options The given options for the rule.\n * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined,\n * no source is prepended to the message.\n * @returns {void}\n */\n validateRuleOptions(rule, ruleId, options, source = null) {\n try {\n const severity = this.validateRuleSeverity(options);\n\n if (severity !== 0) {\n this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []);\n }\n } catch (err) {\n const enhancedMessage = `Configuration for rule \"${ruleId}\" is invalid:\\n${err.message}`;\n\n if (typeof source === \"string\") {\n throw new Error(`${source}:\\n\\t${enhancedMessage}`);\n } else {\n throw new Error(enhancedMessage);\n }\n }\n }\n\n /**\n * Validates an environment object\n * @param {Object} environment The environment config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded environments.\n * @returns {void}\n */\n validateEnvironment(\n environment,\n source,\n getAdditionalEnv = noop\n ) {\n\n // not having an environment is ok\n if (!environment) {\n return;\n }\n\n Object.keys(environment).forEach(id => {\n const env = getAdditionalEnv(id) || BuiltInEnvironments.get(id) || null;\n\n if (!env) {\n const message = `${source}:\\n\\tEnvironment key \"${id}\" is unknown\\n`;\n\n throw new Error(message);\n }\n });\n }\n\n /**\n * Validates a rules config object\n * @param {Object} rulesConfig The rules config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(ruleId:string): Object} getAdditionalRule A map from strings to loaded rules\n * @returns {void}\n */\n validateRules(\n rulesConfig,\n source,\n getAdditionalRule = noop\n ) {\n if (!rulesConfig) {\n return;\n }\n\n Object.keys(rulesConfig).forEach(id => {\n const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null;\n\n this.validateRuleOptions(rule, id, rulesConfig[id], source);\n });\n }\n\n /**\n * Validates a `globals` section of a config file\n * @param {Object} globalsConfig The `globals` section\n * @param {string|null} source The name of the configuration source to report in the event of an error.\n * @returns {void}\n */\n validateGlobals(globalsConfig, source = null) {\n if (!globalsConfig) {\n return;\n }\n\n Object.entries(globalsConfig)\n .forEach(([configuredGlobal, configuredValue]) => {\n try {\n ConfigOps.normalizeConfigGlobal(configuredValue);\n } catch (err) {\n throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\\n${err.message}`);\n }\n });\n }\n\n /**\n * Validate `processor` configuration.\n * @param {string|undefined} processorName The processor name.\n * @param {string} source The name of config file.\n * @param {function(id:string): Processor} getProcessor The getter of defined processors.\n * @returns {void}\n */\n validateProcessor(processorName, source, getProcessor) {\n if (processorName && !getProcessor(processorName)) {\n throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`);\n }\n }\n\n /**\n * Formats an array of schema validation errors.\n * @param {Array} errors An array of error messages to format.\n * @returns {string} Formatted error message\n */\n formatErrors(errors) {\n return errors.map(error => {\n if (error.keyword === \"additionalProperties\") {\n const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty;\n\n return `Unexpected top-level property \"${formattedPropertyPath}\"`;\n }\n if (error.keyword === \"type\") {\n const formattedField = error.dataPath.slice(1);\n const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join(\"/\") : error.schema;\n const formattedValue = JSON.stringify(error.data);\n\n return `Property \"${formattedField}\" is the wrong type (expected ${formattedExpectedType} but got \\`${formattedValue}\\`)`;\n }\n\n const field = error.dataPath[0] === \".\" ? error.dataPath.slice(1) : error.dataPath;\n\n return `\"${field}\" ${error.message}. Value: ${JSON.stringify(error.data)}`;\n }).map(message => `\\t- ${message}.\\n`).join(\"\");\n }\n\n /**\n * Validates the top level properties of the config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @returns {void}\n */\n validateConfigSchema(config, source = null) {\n validateSchema = validateSchema || ajv.compile(configSchema);\n\n if (!validateSchema(config)) {\n throw new Error(`ESLint configuration in ${source} is invalid:\\n${this.formatErrors(validateSchema.errors)}`);\n }\n\n if (Object.hasOwnProperty.call(config, \"ecmaFeatures\")) {\n emitDeprecationWarning(source, \"ESLINT_LEGACY_ECMAFEATURES\");\n }\n }\n\n /**\n * Validates an entire config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(ruleId:string): Object} [getAdditionalRule] A map from strings to loaded rules.\n * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded envs.\n * @returns {void}\n */\n validate(config, source, getAdditionalRule, getAdditionalEnv) {\n this.validateConfigSchema(config, source);\n this.validateRules(config.rules, source, getAdditionalRule);\n this.validateEnvironment(config.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n\n for (const override of config.overrides || []) {\n this.validateRules(override.rules, source, getAdditionalRule);\n this.validateEnvironment(override.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n }\n }\n\n /**\n * Validate config array object.\n * @param {ConfigArray} configArray The config array to validate.\n * @returns {void}\n */\n validateConfigArray(configArray) {\n const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments);\n const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors);\n const getPluginRule = Map.prototype.get.bind(configArray.pluginRules);\n\n // Validate.\n for (const element of configArray) {\n if (validated.has(element)) {\n continue;\n }\n validated.add(element);\n\n this.validateEnvironment(element.env, element.name, getPluginEnv);\n this.validateGlobals(element.globals, element.name);\n this.validateProcessor(element.processor, element.name, getPluginProcessor);\n this.validateRules(element.rules, element.name, getPluginRule);\n }\n }\n\n}\n","/**\n * @fileoverview Common helpers for naming of plugins, formatters and configs\n */\n\nconst NAMESPACE_REGEX = /^@.*\\//iu;\n\n/**\n * Brings package name to correct format based on prefix\n * @param {string} name The name of the package.\n * @param {string} prefix Can be either \"eslint-plugin\", \"eslint-config\" or \"eslint-formatter\"\n * @returns {string} Normalized name of the package\n * @private\n */\nfunction normalizePackageName(name, prefix) {\n let normalizedName = name;\n\n /**\n * On Windows, name can come in with Windows slashes instead of Unix slashes.\n * Normalize to Unix first to avoid errors later on.\n * https://github.com/eslint/eslint/issues/5644\n */\n if (normalizedName.includes(\"\\\\\")) {\n normalizedName = normalizedName.replace(/\\\\/gu, \"/\");\n }\n\n if (normalizedName.charAt(0) === \"@\") {\n\n /**\n * it's a scoped package\n * package name is the prefix, or just a username\n */\n const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, \"u\"),\n scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, \"u\");\n\n if (scopedPackageShortcutRegex.test(normalizedName)) {\n normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`);\n } else if (!scopedPackageNameRegex.test(normalizedName.split(\"/\")[1])) {\n\n /**\n * for scoped packages, insert the prefix after the first / unless\n * the path is already @scope/eslint or @scope/eslint-xxx-yyy\n */\n normalizedName = normalizedName.replace(/^@([^/]+)\\/(.*)$/u, `@$1/${prefix}-$2`);\n }\n } else if (!normalizedName.startsWith(`${prefix}-`)) {\n normalizedName = `${prefix}-${normalizedName}`;\n }\n\n return normalizedName;\n}\n\n/**\n * Removes the prefix from a fullname.\n * @param {string} fullname The term which may have the prefix.\n * @param {string} prefix The prefix to remove.\n * @returns {string} The term without prefix.\n */\nfunction getShorthandName(fullname, prefix) {\n if (fullname[0] === \"@\") {\n let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, \"u\").exec(fullname);\n\n if (matchResult) {\n return matchResult[1];\n }\n\n matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, \"u\").exec(fullname);\n if (matchResult) {\n return `${matchResult[1]}/${matchResult[2]}`;\n }\n } else if (fullname.startsWith(`${prefix}-`)) {\n return fullname.slice(prefix.length + 1);\n }\n\n return fullname;\n}\n\n/**\n * Gets the scope (namespace) of a term.\n * @param {string} term The term which may have the namespace.\n * @returns {string} The namespace of the term if it has one.\n */\nfunction getNamespaceFromTerm(term) {\n const match = term.match(NAMESPACE_REGEX);\n\n return match ? match[0] : \"\";\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport {\n normalizePackageName,\n getShorthandName,\n getNamespaceFromTerm\n};\n","/**\n * Utility for resolving a module relative to another module\n * @author Teddy Katz\n */\n\nimport Module from \"module\";\n\n/*\n * `Module.createRequire` is added in v12.2.0. It supports URL as well.\n * We only support the case where the argument is a filepath, not a URL.\n */\nconst createRequire = Module.createRequire;\n\n/**\n * Resolves a Node module relative to another module\n * @param {string} moduleName The name of a Node module, or a path to a Node module.\n * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be\n * a file rather than a directory, but the file need not actually exist.\n * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath`\n */\nfunction resolve(moduleName, relativeToPath) {\n try {\n return createRequire(relativeToPath).resolve(moduleName);\n } catch (error) {\n\n // This `if` block is for older Node.js than 12.0.0. We can remove this block in the future.\n if (\n typeof error === \"object\" &&\n error !== null &&\n error.code === \"MODULE_NOT_FOUND\" &&\n !error.requireStack &&\n error.message.includes(moduleName)\n ) {\n error.message += `\\nRequire stack:\\n- ${relativeToPath}`;\n }\n throw error;\n }\n}\n\nexport {\n resolve\n};\n","/**\n * @fileoverview The factory of `ConfigArray` objects.\n *\n * This class provides methods to create `ConfigArray` instance.\n *\n * - `create(configData, options)`\n * Create a `ConfigArray` instance from a config data. This is to handle CLI\n * options except `--config`.\n * - `loadFile(filePath, options)`\n * Create a `ConfigArray` instance from a config file. This is to handle\n * `--config` option. If the file was not found, throws the following error:\n * - If the filename was `*.js`, a `MODULE_NOT_FOUND` error.\n * - If the filename was `package.json`, an IO error or an\n * `ESLINT_CONFIG_FIELD_NOT_FOUND` error.\n * - Otherwise, an IO error such as `ENOENT`.\n * - `loadInDirectory(directoryPath, options)`\n * Create a `ConfigArray` instance from a config file which is on a given\n * directory. This tries to load `.eslintrc.*` or `package.json`. If not\n * found, returns an empty `ConfigArray`.\n * - `loadESLintIgnore(filePath)`\n * Create a `ConfigArray` instance from a config file that is `.eslintignore`\n * format. This is to handle `--ignore-path` option.\n * - `loadDefaultESLintIgnore()`\n * Create a `ConfigArray` instance from `.eslintignore` or `package.json` in\n * the current working directory.\n *\n * `ConfigArrayFactory` class has the responsibility that loads configuration\n * files, including loading `extends`, `parser`, and `plugins`. The created\n * `ConfigArray` instance has the loaded `extends`, `parser`, and `plugins`.\n *\n * But this class doesn't handle cascading. `CascadingConfigArrayFactory` class\n * handles cascading and hierarchy.\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport debugOrig from \"debug\";\nimport fs from \"fs\";\nimport importFresh from \"import-fresh\";\nimport { createRequire } from \"module\";\nimport path from \"path\";\nimport stripComments from \"strip-json-comments\";\n\nimport {\n ConfigArray,\n ConfigDependency,\n IgnorePattern,\n OverrideTester\n} from \"./config-array/index.js\";\nimport ConfigValidator from \"./shared/config-validator.js\";\nimport * as naming from \"./shared/naming.js\";\nimport * as ModuleResolver from \"./shared/relative-module-resolver.js\";\n\nconst require = createRequire(import.meta.url);\n\nconst debug = debugOrig(\"eslintrc:config-array-factory\");\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\nconst configFilenames = [\n \".eslintrc.js\",\n \".eslintrc.cjs\",\n \".eslintrc.yaml\",\n \".eslintrc.yml\",\n \".eslintrc.json\",\n \".eslintrc\",\n \"package.json\"\n];\n\n// Define types for VSCode IntelliSense.\n/** @typedef {import(\"./shared/types\").ConfigData} ConfigData */\n/** @typedef {import(\"./shared/types\").OverrideConfigData} OverrideConfigData */\n/** @typedef {import(\"./shared/types\").Parser} Parser */\n/** @typedef {import(\"./shared/types\").Plugin} Plugin */\n/** @typedef {import(\"./shared/types\").Rule} Rule */\n/** @typedef {import(\"./config-array/config-dependency\").DependentParser} DependentParser */\n/** @typedef {import(\"./config-array/config-dependency\").DependentPlugin} DependentPlugin */\n/** @typedef {ConfigArray[0]} ConfigArrayElement */\n\n/**\n * @typedef {Object} ConfigArrayFactoryOptions\n * @property {Map} [additionalPluginPool] The map for additional plugins.\n * @property {string} [cwd] The path to the current working directory.\n * @property {string} [resolvePluginsRelativeTo] A path to the directory that plugins should be resolved from. Defaults to `cwd`.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/**\n * @typedef {Object} ConfigArrayFactoryInternalSlots\n * @property {Map} additionalPluginPool The map for additional plugins.\n * @property {string} cwd The path to the current working directory.\n * @property {string | undefined} resolvePluginsRelativeTo An absolute path the the directory that plugins should be resolved from.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/**\n * @typedef {Object} ConfigArrayFactoryLoadingContext\n * @property {string} filePath The path to the current configuration.\n * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @property {string} name The name of the current configuration.\n * @property {string} pluginBasePath The base path to resolve plugins.\n * @property {\"config\" | \"ignore\" | \"implicit-processor\"} type The type of the current configuration. This is `\"config\"` in normal. This is `\"ignore\"` if it came from `.eslintignore`. This is `\"implicit-processor\"` if it came from legacy file-extension processors.\n */\n\n/**\n * @typedef {Object} ConfigArrayFactoryLoadingContext\n * @property {string} filePath The path to the current configuration.\n * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @property {string} name The name of the current configuration.\n * @property {\"config\" | \"ignore\" | \"implicit-processor\"} type The type of the current configuration. This is `\"config\"` in normal. This is `\"ignore\"` if it came from `.eslintignore`. This is `\"implicit-processor\"` if it came from legacy file-extension processors.\n */\n\n/** @type {WeakMap} */\nconst internalSlotsMap = new WeakMap();\n\n/** @type {WeakMap} */\nconst normalizedPlugins = new WeakMap();\n\n/**\n * Check if a given string is a file path.\n * @param {string} nameOrPath A module name or file path.\n * @returns {boolean} `true` if the `nameOrPath` is a file path.\n */\nfunction isFilePath(nameOrPath) {\n return (\n /^\\.{1,2}[/\\\\]/u.test(nameOrPath) ||\n path.isAbsolute(nameOrPath)\n );\n}\n\n/**\n * Convenience wrapper for synchronously reading file contents.\n * @param {string} filePath The filename to read.\n * @returns {string} The file contents, with the BOM removed.\n * @private\n */\nfunction readFile(filePath) {\n return fs.readFileSync(filePath, \"utf8\").replace(/^\\ufeff/u, \"\");\n}\n\n/**\n * Loads a YAML configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadYAMLConfigFile(filePath) {\n debug(`Loading YAML config file: ${filePath}`);\n\n // lazy load YAML to improve performance when not used\n const yaml = require(\"js-yaml\");\n\n try {\n\n // empty YAML file can be null, so always use\n return yaml.load(readFile(filePath)) || {};\n } catch (e) {\n debug(`Error reading YAML file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a JSON configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadJSONConfigFile(filePath) {\n debug(`Loading JSON config file: ${filePath}`);\n\n try {\n return JSON.parse(stripComments(readFile(filePath)));\n } catch (e) {\n debug(`Error reading JSON file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n e.messageTemplate = \"failed-to-read-json\";\n e.messageData = {\n path: filePath,\n message: e.message\n };\n throw e;\n }\n}\n\n/**\n * Loads a legacy (.eslintrc) configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadLegacyConfigFile(filePath) {\n debug(`Loading legacy config file: ${filePath}`);\n\n // lazy load YAML to improve performance when not used\n const yaml = require(\"js-yaml\");\n\n try {\n return yaml.load(stripComments(readFile(filePath))) || /* istanbul ignore next */ {};\n } catch (e) {\n debug(\"Error reading YAML file: %s\\n%o\", filePath, e);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a JavaScript configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadJSConfigFile(filePath) {\n debug(`Loading JS config file: ${filePath}`);\n try {\n return importFresh(filePath);\n } catch (e) {\n debug(`Error reading JavaScript file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a configuration from a package.json file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadPackageJSONConfigFile(filePath) {\n debug(`Loading package.json config file: ${filePath}`);\n try {\n const packageData = loadJSONConfigFile(filePath);\n\n if (!Object.hasOwnProperty.call(packageData, \"eslintConfig\")) {\n throw Object.assign(\n new Error(\"package.json file doesn't have 'eslintConfig' field.\"),\n { code: \"ESLINT_CONFIG_FIELD_NOT_FOUND\" }\n );\n }\n\n return packageData.eslintConfig;\n } catch (e) {\n debug(`Error reading package.json file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a `.eslintignore` from a file.\n * @param {string} filePath The filename to load.\n * @returns {string[]} The ignore patterns from the file.\n * @private\n */\nfunction loadESLintIgnoreFile(filePath) {\n debug(`Loading .eslintignore file: ${filePath}`);\n\n try {\n return readFile(filePath)\n .split(/\\r?\\n/gu)\n .filter(line => line.trim() !== \"\" && !line.startsWith(\"#\"));\n } catch (e) {\n debug(`Error reading .eslintignore file: ${filePath}`);\n e.message = `Cannot read .eslintignore file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Creates an error to notify about a missing config to extend from.\n * @param {string} configName The name of the missing config.\n * @param {string} importerName The name of the config that imported the missing config\n * @param {string} messageTemplate The text template to source error strings from.\n * @returns {Error} The error object to throw\n * @private\n */\nfunction configInvalidError(configName, importerName, messageTemplate) {\n return Object.assign(\n new Error(`Failed to load config \"${configName}\" to extend from.`),\n {\n messageTemplate,\n messageData: { configName, importerName }\n }\n );\n}\n\n/**\n * Loads a configuration file regardless of the source. Inspects the file path\n * to determine the correctly way to load the config file.\n * @param {string} filePath The path to the configuration.\n * @returns {ConfigData|null} The configuration information.\n * @private\n */\nfunction loadConfigFile(filePath) {\n switch (path.extname(filePath)) {\n case \".js\":\n case \".cjs\":\n return loadJSConfigFile(filePath);\n\n case \".json\":\n if (path.basename(filePath) === \"package.json\") {\n return loadPackageJSONConfigFile(filePath);\n }\n return loadJSONConfigFile(filePath);\n\n case \".yaml\":\n case \".yml\":\n return loadYAMLConfigFile(filePath);\n\n default:\n return loadLegacyConfigFile(filePath);\n }\n}\n\n/**\n * Write debug log.\n * @param {string} request The requested module name.\n * @param {string} relativeTo The file path to resolve the request relative to.\n * @param {string} filePath The resolved file path.\n * @returns {void}\n */\nfunction writeDebugLogForLoading(request, relativeTo, filePath) {\n /* istanbul ignore next */\n if (debug.enabled) {\n let nameAndVersion = null;\n\n try {\n const packageJsonPath = ModuleResolver.resolve(\n `${request}/package.json`,\n relativeTo\n );\n const { version = \"unknown\" } = require(packageJsonPath);\n\n nameAndVersion = `${request}@${version}`;\n } catch (error) {\n debug(\"package.json was not found:\", error.message);\n nameAndVersion = request;\n }\n\n debug(\"Loaded: %s (%s)\", nameAndVersion, filePath);\n }\n}\n\n/**\n * Create a new context with default values.\n * @param {ConfigArrayFactoryInternalSlots} slots The internal slots.\n * @param {\"config\" | \"ignore\" | \"implicit-processor\" | undefined} providedType The type of the current configuration. Default is `\"config\"`.\n * @param {string | undefined} providedName The name of the current configuration. Default is the relative path from `cwd` to `filePath`.\n * @param {string | undefined} providedFilePath The path to the current configuration. Default is empty string.\n * @param {string | undefined} providedMatchBasePath The type of the current configuration. Default is the directory of `filePath` or `cwd`.\n * @returns {ConfigArrayFactoryLoadingContext} The created context.\n */\nfunction createContext(\n { cwd, resolvePluginsRelativeTo },\n providedType,\n providedName,\n providedFilePath,\n providedMatchBasePath\n) {\n const filePath = providedFilePath\n ? path.resolve(cwd, providedFilePath)\n : \"\";\n const matchBasePath =\n (providedMatchBasePath && path.resolve(cwd, providedMatchBasePath)) ||\n (filePath && path.dirname(filePath)) ||\n cwd;\n const name =\n providedName ||\n (filePath && path.relative(cwd, filePath)) ||\n \"\";\n const pluginBasePath =\n resolvePluginsRelativeTo ||\n (filePath && path.dirname(filePath)) ||\n cwd;\n const type = providedType || \"config\";\n\n return { filePath, matchBasePath, name, pluginBasePath, type };\n}\n\n/**\n * Normalize a given plugin.\n * - Ensure the object to have four properties: configs, environments, processors, and rules.\n * - Ensure the object to not have other properties.\n * @param {Plugin} plugin The plugin to normalize.\n * @returns {Plugin} The normalized plugin.\n */\nfunction normalizePlugin(plugin) {\n\n // first check the cache\n let normalizedPlugin = normalizedPlugins.get(plugin);\n\n if (normalizedPlugin) {\n return normalizedPlugin;\n }\n\n normalizedPlugin = {\n configs: plugin.configs || {},\n environments: plugin.environments || {},\n processors: plugin.processors || {},\n rules: plugin.rules || {}\n };\n\n // save the reference for later\n normalizedPlugins.set(plugin, normalizedPlugin);\n\n return normalizedPlugin;\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * The factory of `ConfigArray` objects.\n */\nclass ConfigArrayFactory {\n\n /**\n * Initialize this instance.\n * @param {ConfigArrayFactoryOptions} [options] The map for additional plugins.\n */\n constructor({\n additionalPluginPool = new Map(),\n cwd = process.cwd(),\n resolvePluginsRelativeTo,\n builtInRules,\n resolver = ModuleResolver,\n eslintAllPath,\n getEslintAllConfig,\n eslintRecommendedPath,\n getEslintRecommendedConfig\n } = {}) {\n internalSlotsMap.set(this, {\n additionalPluginPool,\n cwd,\n resolvePluginsRelativeTo:\n resolvePluginsRelativeTo &&\n path.resolve(cwd, resolvePluginsRelativeTo),\n builtInRules,\n resolver,\n eslintAllPath,\n getEslintAllConfig,\n eslintRecommendedPath,\n getEslintRecommendedConfig\n });\n }\n\n /**\n * Create `ConfigArray` instance from a config data.\n * @param {ConfigData|null} configData The config data to create.\n * @param {Object} [options] The options.\n * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @param {string} [options.filePath] The path to this config data.\n * @param {string} [options.name] The config name.\n * @returns {ConfigArray} Loaded config.\n */\n create(configData, { basePath, filePath, name } = {}) {\n if (!configData) {\n return new ConfigArray();\n }\n\n const slots = internalSlotsMap.get(this);\n const ctx = createContext(slots, \"config\", name, filePath, basePath);\n const elements = this._normalizeConfigData(configData, ctx);\n\n return new ConfigArray(...elements);\n }\n\n /**\n * Load a config file.\n * @param {string} filePath The path to a config file.\n * @param {Object} [options] The options.\n * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @param {string} [options.name] The config name.\n * @returns {ConfigArray} Loaded config.\n */\n loadFile(filePath, { basePath, name } = {}) {\n const slots = internalSlotsMap.get(this);\n const ctx = createContext(slots, \"config\", name, filePath, basePath);\n\n return new ConfigArray(...this._loadConfigData(ctx));\n }\n\n /**\n * Load the config file on a given directory if exists.\n * @param {string} directoryPath The path to a directory.\n * @param {Object} [options] The options.\n * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @param {string} [options.name] The config name.\n * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.\n */\n loadInDirectory(directoryPath, { basePath, name } = {}) {\n const slots = internalSlotsMap.get(this);\n\n for (const filename of configFilenames) {\n const ctx = createContext(\n slots,\n \"config\",\n name,\n path.join(directoryPath, filename),\n basePath\n );\n\n if (fs.existsSync(ctx.filePath) && fs.statSync(ctx.filePath).isFile()) {\n let configData;\n\n try {\n configData = loadConfigFile(ctx.filePath);\n } catch (error) {\n if (!error || error.code !== \"ESLINT_CONFIG_FIELD_NOT_FOUND\") {\n throw error;\n }\n }\n\n if (configData) {\n debug(`Config file found: ${ctx.filePath}`);\n return new ConfigArray(\n ...this._normalizeConfigData(configData, ctx)\n );\n }\n }\n }\n\n debug(`Config file not found on ${directoryPath}`);\n return new ConfigArray();\n }\n\n /**\n * Check if a config file on a given directory exists or not.\n * @param {string} directoryPath The path to a directory.\n * @returns {string | null} The path to the found config file. If not found then null.\n */\n static getPathToConfigFileInDirectory(directoryPath) {\n for (const filename of configFilenames) {\n const filePath = path.join(directoryPath, filename);\n\n if (fs.existsSync(filePath)) {\n if (filename === \"package.json\") {\n try {\n loadPackageJSONConfigFile(filePath);\n return filePath;\n } catch { /* ignore */ }\n } else {\n return filePath;\n }\n }\n }\n return null;\n }\n\n /**\n * Load `.eslintignore` file.\n * @param {string} filePath The path to a `.eslintignore` file to load.\n * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.\n */\n loadESLintIgnore(filePath) {\n const slots = internalSlotsMap.get(this);\n const ctx = createContext(\n slots,\n \"ignore\",\n void 0,\n filePath,\n slots.cwd\n );\n const ignorePatterns = loadESLintIgnoreFile(ctx.filePath);\n\n return new ConfigArray(\n ...this._normalizeESLintIgnoreData(ignorePatterns, ctx)\n );\n }\n\n /**\n * Load `.eslintignore` file in the current working directory.\n * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.\n */\n loadDefaultESLintIgnore() {\n const slots = internalSlotsMap.get(this);\n const eslintIgnorePath = path.resolve(slots.cwd, \".eslintignore\");\n const packageJsonPath = path.resolve(slots.cwd, \"package.json\");\n\n if (fs.existsSync(eslintIgnorePath)) {\n return this.loadESLintIgnore(eslintIgnorePath);\n }\n if (fs.existsSync(packageJsonPath)) {\n const data = loadJSONConfigFile(packageJsonPath);\n\n if (Object.hasOwnProperty.call(data, \"eslintIgnore\")) {\n if (!Array.isArray(data.eslintIgnore)) {\n throw new Error(\"Package.json eslintIgnore property requires an array of paths\");\n }\n const ctx = createContext(\n slots,\n \"ignore\",\n \"eslintIgnore in package.json\",\n packageJsonPath,\n slots.cwd\n );\n\n return new ConfigArray(\n ...this._normalizeESLintIgnoreData(data.eslintIgnore, ctx)\n );\n }\n }\n\n return new ConfigArray();\n }\n\n /**\n * Load a given config file.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} Loaded config.\n * @private\n */\n _loadConfigData(ctx) {\n return this._normalizeConfigData(loadConfigFile(ctx.filePath), ctx);\n }\n\n /**\n * Normalize a given `.eslintignore` data to config array elements.\n * @param {string[]} ignorePatterns The patterns to ignore files.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n *_normalizeESLintIgnoreData(ignorePatterns, ctx) {\n const elements = this._normalizeObjectConfigData(\n { ignorePatterns },\n ctx\n );\n\n // Set `ignorePattern.loose` flag for backward compatibility.\n for (const element of elements) {\n if (element.ignorePattern) {\n element.ignorePattern.loose = true;\n }\n yield element;\n }\n }\n\n /**\n * Normalize a given config to an array.\n * @param {ConfigData} configData The config data to normalize.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _normalizeConfigData(configData, ctx) {\n const validator = new ConfigValidator();\n\n validator.validateConfigSchema(configData, ctx.name || ctx.filePath);\n return this._normalizeObjectConfigData(configData, ctx);\n }\n\n /**\n * Normalize a given config to an array.\n * @param {ConfigData|OverrideConfigData} configData The config data to normalize.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n *_normalizeObjectConfigData(configData, ctx) {\n const { files, excludedFiles, ...configBody } = configData;\n const criteria = OverrideTester.create(\n files,\n excludedFiles,\n ctx.matchBasePath\n );\n const elements = this._normalizeObjectConfigDataBody(configBody, ctx);\n\n // Apply the criteria to every element.\n for (const element of elements) {\n\n /*\n * Merge the criteria.\n * This is for the `overrides` entries that came from the\n * configurations of `overrides[].extends`.\n */\n element.criteria = OverrideTester.and(criteria, element.criteria);\n\n /*\n * Remove `root` property to ignore `root` settings which came from\n * `extends` in `overrides`.\n */\n if (element.criteria) {\n element.root = void 0;\n }\n\n yield element;\n }\n }\n\n /**\n * Normalize a given config to an array.\n * @param {ConfigData} configData The config data to normalize.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n *_normalizeObjectConfigDataBody(\n {\n env,\n extends: extend,\n globals,\n ignorePatterns,\n noInlineConfig,\n parser: parserName,\n parserOptions,\n plugins: pluginList,\n processor,\n reportUnusedDisableDirectives,\n root,\n rules,\n settings,\n overrides: overrideList = []\n },\n ctx\n ) {\n const extendList = Array.isArray(extend) ? extend : [extend];\n const ignorePattern = ignorePatterns && new IgnorePattern(\n Array.isArray(ignorePatterns) ? ignorePatterns : [ignorePatterns],\n ctx.matchBasePath\n );\n\n // Flatten `extends`.\n for (const extendName of extendList.filter(Boolean)) {\n yield* this._loadExtends(extendName, ctx);\n }\n\n // Load parser & plugins.\n const parser = parserName && this._loadParser(parserName, ctx);\n const plugins = pluginList && this._loadPlugins(pluginList, ctx);\n\n // Yield pseudo config data for file extension processors.\n if (plugins) {\n yield* this._takeFileExtensionProcessors(plugins, ctx);\n }\n\n // Yield the config data except `extends` and `overrides`.\n yield {\n\n // Debug information.\n type: ctx.type,\n name: ctx.name,\n filePath: ctx.filePath,\n\n // Config data.\n criteria: null,\n env,\n globals,\n ignorePattern,\n noInlineConfig,\n parser,\n parserOptions,\n plugins,\n processor,\n reportUnusedDisableDirectives,\n root,\n rules,\n settings\n };\n\n // Flatten `overries`.\n for (let i = 0; i < overrideList.length; ++i) {\n yield* this._normalizeObjectConfigData(\n overrideList[i],\n { ...ctx, name: `${ctx.name}#overrides[${i}]` }\n );\n }\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _loadExtends(extendName, ctx) {\n debug(\"Loading {extends:%j} relative to %s\", extendName, ctx.filePath);\n try {\n if (extendName.startsWith(\"eslint:\")) {\n return this._loadExtendedBuiltInConfig(extendName, ctx);\n }\n if (extendName.startsWith(\"plugin:\")) {\n return this._loadExtendedPluginConfig(extendName, ctx);\n }\n return this._loadExtendedShareableConfig(extendName, ctx);\n } catch (error) {\n error.message += `\\nReferenced from: ${ctx.filePath || ctx.name}`;\n throw error;\n }\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _loadExtendedBuiltInConfig(extendName, ctx) {\n const {\n eslintAllPath,\n getEslintAllConfig,\n eslintRecommendedPath,\n getEslintRecommendedConfig\n } = internalSlotsMap.get(this);\n\n if (extendName === \"eslint:recommended\") {\n const name = `${ctx.name} » ${extendName}`;\n\n if (getEslintRecommendedConfig) {\n if (typeof getEslintRecommendedConfig !== \"function\") {\n throw new Error(`getEslintRecommendedConfig must be a function instead of '${getEslintRecommendedConfig}'`);\n }\n return this._normalizeConfigData(getEslintRecommendedConfig(), { ...ctx, name, filePath: \"\" });\n }\n return this._loadConfigData({\n ...ctx,\n name,\n filePath: eslintRecommendedPath\n });\n }\n if (extendName === \"eslint:all\") {\n const name = `${ctx.name} » ${extendName}`;\n\n if (getEslintAllConfig) {\n if (typeof getEslintAllConfig !== \"function\") {\n throw new Error(`getEslintAllConfig must be a function instead of '${getEslintAllConfig}'`);\n }\n return this._normalizeConfigData(getEslintAllConfig(), { ...ctx, name, filePath: \"\" });\n }\n return this._loadConfigData({\n ...ctx,\n name,\n filePath: eslintAllPath\n });\n }\n\n throw configInvalidError(extendName, ctx.name, \"extend-config-missing\");\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _loadExtendedPluginConfig(extendName, ctx) {\n const slashIndex = extendName.lastIndexOf(\"/\");\n\n if (slashIndex === -1) {\n throw configInvalidError(extendName, ctx.filePath, \"plugin-invalid\");\n }\n\n const pluginName = extendName.slice(\"plugin:\".length, slashIndex);\n const configName = extendName.slice(slashIndex + 1);\n\n if (isFilePath(pluginName)) {\n throw new Error(\"'extends' cannot use a file path for plugins.\");\n }\n\n const plugin = this._loadPlugin(pluginName, ctx);\n const configData =\n plugin.definition &&\n plugin.definition.configs[configName];\n\n if (configData) {\n return this._normalizeConfigData(configData, {\n ...ctx,\n filePath: plugin.filePath || ctx.filePath,\n name: `${ctx.name} » plugin:${plugin.id}/${configName}`\n });\n }\n\n throw plugin.error || configInvalidError(extendName, ctx.filePath, \"extend-config-missing\");\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _loadExtendedShareableConfig(extendName, ctx) {\n const { cwd, resolver } = internalSlotsMap.get(this);\n const relativeTo = ctx.filePath || path.join(cwd, \"__placeholder__.js\");\n let request;\n\n if (isFilePath(extendName)) {\n request = extendName;\n } else if (extendName.startsWith(\".\")) {\n request = `./${extendName}`; // For backward compatibility. A ton of tests depended on this behavior.\n } else {\n request = naming.normalizePackageName(\n extendName,\n \"eslint-config\"\n );\n }\n\n let filePath;\n\n try {\n filePath = resolver.resolve(request, relativeTo);\n } catch (error) {\n /* istanbul ignore else */\n if (error && error.code === \"MODULE_NOT_FOUND\") {\n throw configInvalidError(extendName, ctx.filePath, \"extend-config-missing\");\n }\n throw error;\n }\n\n writeDebugLogForLoading(request, relativeTo, filePath);\n return this._loadConfigData({\n ...ctx,\n filePath,\n name: `${ctx.name} » ${request}`\n });\n }\n\n /**\n * Load given plugins.\n * @param {string[]} names The plugin names to load.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {Record} The loaded parser.\n * @private\n */\n _loadPlugins(names, ctx) {\n return names.reduce((map, name) => {\n if (isFilePath(name)) {\n throw new Error(\"Plugins array cannot includes file paths.\");\n }\n const plugin = this._loadPlugin(name, ctx);\n\n map[plugin.id] = plugin;\n\n return map;\n }, {});\n }\n\n /**\n * Load a given parser.\n * @param {string} nameOrPath The package name or the path to a parser file.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {DependentParser} The loaded parser.\n */\n _loadParser(nameOrPath, ctx) {\n debug(\"Loading parser %j from %s\", nameOrPath, ctx.filePath);\n\n const { cwd, resolver } = internalSlotsMap.get(this);\n const relativeTo = ctx.filePath || path.join(cwd, \"__placeholder__.js\");\n\n try {\n const filePath = resolver.resolve(nameOrPath, relativeTo);\n\n writeDebugLogForLoading(nameOrPath, relativeTo, filePath);\n\n return new ConfigDependency({\n definition: require(filePath),\n filePath,\n id: nameOrPath,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n } catch (error) {\n\n // If the parser name is \"espree\", load the espree of ESLint.\n if (nameOrPath === \"espree\") {\n debug(\"Fallback espree.\");\n return new ConfigDependency({\n definition: require(\"espree\"),\n filePath: require.resolve(\"espree\"),\n id: nameOrPath,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n debug(\"Failed to load parser '%s' declared in '%s'.\", nameOrPath, ctx.name);\n error.message = `Failed to load parser '${nameOrPath}' declared in '${ctx.name}': ${error.message}`;\n\n return new ConfigDependency({\n error,\n id: nameOrPath,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n }\n\n /**\n * Load a given plugin.\n * @param {string} name The plugin name to load.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {DependentPlugin} The loaded plugin.\n * @private\n */\n _loadPlugin(name, ctx) {\n debug(\"Loading plugin %j from %s\", name, ctx.filePath);\n\n const { additionalPluginPool, resolver } = internalSlotsMap.get(this);\n const request = naming.normalizePackageName(name, \"eslint-plugin\");\n const id = naming.getShorthandName(request, \"eslint-plugin\");\n const relativeTo = path.join(ctx.pluginBasePath, \"__placeholder__.js\");\n\n if (name.match(/\\s+/u)) {\n const error = Object.assign(\n new Error(`Whitespace found in plugin name '${name}'`),\n {\n messageTemplate: \"whitespace-found\",\n messageData: { pluginName: request }\n }\n );\n\n return new ConfigDependency({\n error,\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n // Check for additional pool.\n const plugin =\n additionalPluginPool.get(request) ||\n additionalPluginPool.get(id);\n\n if (plugin) {\n return new ConfigDependency({\n definition: normalizePlugin(plugin),\n filePath: \"\", // It's unknown where the plugin came from.\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n let filePath;\n let error;\n\n try {\n filePath = resolver.resolve(request, relativeTo);\n } catch (resolveError) {\n error = resolveError;\n /* istanbul ignore else */\n if (error && error.code === \"MODULE_NOT_FOUND\") {\n error.messageTemplate = \"plugin-missing\";\n error.messageData = {\n pluginName: request,\n resolvePluginsRelativeTo: ctx.pluginBasePath,\n importerName: ctx.name\n };\n }\n }\n\n if (filePath) {\n try {\n writeDebugLogForLoading(request, relativeTo, filePath);\n\n const startTime = Date.now();\n const pluginDefinition = require(filePath);\n\n debug(`Plugin ${filePath} loaded in: ${Date.now() - startTime}ms`);\n\n return new ConfigDependency({\n definition: normalizePlugin(pluginDefinition),\n filePath,\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n } catch (loadError) {\n error = loadError;\n }\n }\n\n debug(\"Failed to load plugin '%s' declared in '%s'.\", name, ctx.name);\n error.message = `Failed to load plugin '${name}' declared in '${ctx.name}': ${error.message}`;\n return new ConfigDependency({\n error,\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n /**\n * Take file expression processors as config array elements.\n * @param {Record} plugins The plugin definitions.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The config array elements of file expression processors.\n * @private\n */\n *_takeFileExtensionProcessors(plugins, ctx) {\n for (const pluginId of Object.keys(plugins)) {\n const processors =\n plugins[pluginId] &&\n plugins[pluginId].definition &&\n plugins[pluginId].definition.processors;\n\n if (!processors) {\n continue;\n }\n\n for (const processorId of Object.keys(processors)) {\n if (processorId.startsWith(\".\")) {\n yield* this._normalizeObjectConfigData(\n {\n files: [`*${processorId}`],\n processor: `${pluginId}/${processorId}`\n },\n {\n ...ctx,\n type: \"implicit-processor\",\n name: `${ctx.name}#processors[\"${pluginId}/${processorId}\"]`\n }\n );\n }\n }\n }\n }\n}\n\nexport { ConfigArrayFactory, createContext };\n","/**\n * @fileoverview `CascadingConfigArrayFactory` class.\n *\n * `CascadingConfigArrayFactory` class has a responsibility:\n *\n * 1. Handles cascading of config files.\n *\n * It provides two methods:\n *\n * - `getConfigArrayForFile(filePath)`\n * Get the corresponded configuration of a given file. This method doesn't\n * throw even if the given file didn't exist.\n * - `clearCache()`\n * Clear the internal cache. You have to call this method when\n * `additionalPluginPool` was updated if `baseConfig` or `cliConfig` depends\n * on the additional plugins. (`CLIEngine#addPlugin()` method calls this.)\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport debugOrig from \"debug\";\nimport os from \"os\";\nimport path from \"path\";\n\nimport { ConfigArrayFactory } from \"./config-array-factory.js\";\nimport {\n ConfigArray,\n ConfigDependency,\n IgnorePattern\n} from \"./config-array/index.js\";\nimport ConfigValidator from \"./shared/config-validator.js\";\nimport { emitDeprecationWarning } from \"./shared/deprecation-warnings.js\";\n\nconst debug = debugOrig(\"eslintrc:cascading-config-array-factory\");\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n// Define types for VSCode IntelliSense.\n/** @typedef {import(\"./shared/types\").ConfigData} ConfigData */\n/** @typedef {import(\"./shared/types\").Parser} Parser */\n/** @typedef {import(\"./shared/types\").Plugin} Plugin */\n/** @typedef {import(\"./shared/types\").Rule} Rule */\n/** @typedef {ReturnType} ConfigArray */\n\n/**\n * @typedef {Object} CascadingConfigArrayFactoryOptions\n * @property {Map} [additionalPluginPool] The map for additional plugins.\n * @property {ConfigData} [baseConfig] The config by `baseConfig` option.\n * @property {ConfigData} [cliConfig] The config by CLI options (`--env`, `--global`, `--ignore-pattern`, `--parser`, `--parser-options`, `--plugin`, and `--rule`). CLI options overwrite the setting in config files.\n * @property {string} [cwd] The base directory to start lookup.\n * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`.\n * @property {string[]} [rulePaths] The value of `--rulesdir` option.\n * @property {string} [specificConfigPath] The value of `--config` option.\n * @property {boolean} [useEslintrc] if `false` then it doesn't load config files.\n * @property {Function} loadRules The function to use to load rules.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/**\n * @typedef {Object} CascadingConfigArrayFactoryInternalSlots\n * @property {ConfigArray} baseConfigArray The config array of `baseConfig` option.\n * @property {ConfigData} baseConfigData The config data of `baseConfig` option. This is used to reset `baseConfigArray`.\n * @property {ConfigArray} cliConfigArray The config array of CLI options.\n * @property {ConfigData} cliConfigData The config data of CLI options. This is used to reset `cliConfigArray`.\n * @property {ConfigArrayFactory} configArrayFactory The factory for config arrays.\n * @property {Map} configCache The cache from directory paths to config arrays.\n * @property {string} cwd The base directory to start lookup.\n * @property {WeakMap} finalizeCache The cache from config arrays to finalized config arrays.\n * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`.\n * @property {string[]|null} rulePaths The value of `--rulesdir` option. This is used to reset `baseConfigArray`.\n * @property {string|null} specificConfigPath The value of `--config` option. This is used to reset `cliConfigArray`.\n * @property {boolean} useEslintrc if `false` then it doesn't load config files.\n * @property {Function} loadRules The function to use to load rules.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/** @type {WeakMap} */\nconst internalSlotsMap = new WeakMap();\n\n/**\n * Create the config array from `baseConfig` and `rulePaths`.\n * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots.\n * @returns {ConfigArray} The config array of the base configs.\n */\nfunction createBaseConfigArray({\n configArrayFactory,\n baseConfigData,\n rulePaths,\n cwd,\n loadRules\n}) {\n const baseConfigArray = configArrayFactory.create(\n baseConfigData,\n { name: \"BaseConfig\" }\n );\n\n /*\n * Create the config array element for the default ignore patterns.\n * This element has `ignorePattern` property that ignores the default\n * patterns in the current working directory.\n */\n baseConfigArray.unshift(configArrayFactory.create(\n { ignorePatterns: IgnorePattern.DefaultPatterns },\n { name: \"DefaultIgnorePattern\" }\n )[0]);\n\n /*\n * Load rules `--rulesdir` option as a pseudo plugin.\n * Use a pseudo plugin to define rules of `--rulesdir`, so we can validate\n * the rule's options with only information in the config array.\n */\n if (rulePaths && rulePaths.length > 0) {\n baseConfigArray.push({\n type: \"config\",\n name: \"--rulesdir\",\n filePath: \"\",\n plugins: {\n \"\": new ConfigDependency({\n definition: {\n rules: rulePaths.reduce(\n (map, rulesPath) => Object.assign(\n map,\n loadRules(rulesPath, cwd)\n ),\n {}\n )\n },\n filePath: \"\",\n id: \"\",\n importerName: \"--rulesdir\",\n importerPath: \"\"\n })\n }\n });\n }\n\n return baseConfigArray;\n}\n\n/**\n * Create the config array from CLI options.\n * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots.\n * @returns {ConfigArray} The config array of the base configs.\n */\nfunction createCLIConfigArray({\n cliConfigData,\n configArrayFactory,\n cwd,\n ignorePath,\n specificConfigPath\n}) {\n const cliConfigArray = configArrayFactory.create(\n cliConfigData,\n { name: \"CLIOptions\" }\n );\n\n cliConfigArray.unshift(\n ...(ignorePath\n ? configArrayFactory.loadESLintIgnore(ignorePath)\n : configArrayFactory.loadDefaultESLintIgnore())\n );\n\n if (specificConfigPath) {\n cliConfigArray.unshift(\n ...configArrayFactory.loadFile(\n specificConfigPath,\n { name: \"--config\", basePath: cwd }\n )\n );\n }\n\n return cliConfigArray;\n}\n\n/**\n * The error type when there are files matched by a glob, but all of them have been ignored.\n */\nclass ConfigurationNotFoundError extends Error {\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @param {string} directoryPath The directory path.\n */\n constructor(directoryPath) {\n super(`No ESLint configuration found in ${directoryPath}.`);\n this.messageTemplate = \"no-config-found\";\n this.messageData = { directoryPath };\n }\n}\n\n/**\n * This class provides the functionality that enumerates every file which is\n * matched by given glob patterns and that configuration.\n */\nclass CascadingConfigArrayFactory {\n\n /**\n * Initialize this enumerator.\n * @param {CascadingConfigArrayFactoryOptions} options The options.\n */\n constructor({\n additionalPluginPool = new Map(),\n baseConfig: baseConfigData = null,\n cliConfig: cliConfigData = null,\n cwd = process.cwd(),\n ignorePath,\n resolvePluginsRelativeTo,\n rulePaths = [],\n specificConfigPath = null,\n useEslintrc = true,\n builtInRules = new Map(),\n loadRules,\n resolver,\n eslintRecommendedPath,\n getEslintRecommendedConfig,\n eslintAllPath,\n getEslintAllConfig\n } = {}) {\n const configArrayFactory = new ConfigArrayFactory({\n additionalPluginPool,\n cwd,\n resolvePluginsRelativeTo,\n builtInRules,\n resolver,\n eslintRecommendedPath,\n getEslintRecommendedConfig,\n eslintAllPath,\n getEslintAllConfig\n });\n\n internalSlotsMap.set(this, {\n baseConfigArray: createBaseConfigArray({\n baseConfigData,\n configArrayFactory,\n cwd,\n rulePaths,\n loadRules\n }),\n baseConfigData,\n cliConfigArray: createCLIConfigArray({\n cliConfigData,\n configArrayFactory,\n cwd,\n ignorePath,\n specificConfigPath\n }),\n cliConfigData,\n configArrayFactory,\n configCache: new Map(),\n cwd,\n finalizeCache: new WeakMap(),\n ignorePath,\n rulePaths,\n specificConfigPath,\n useEslintrc,\n builtInRules,\n loadRules\n });\n }\n\n /**\n * The path to the current working directory.\n * This is used by tests.\n * @type {string}\n */\n get cwd() {\n const { cwd } = internalSlotsMap.get(this);\n\n return cwd;\n }\n\n /**\n * Get the config array of a given file.\n * If `filePath` was not given, it returns the config which contains only\n * `baseConfigData` and `cliConfigData`.\n * @param {string} [filePath] The file path to a file.\n * @param {Object} [options] The options.\n * @param {boolean} [options.ignoreNotFoundError] If `true` then it doesn't throw `ConfigurationNotFoundError`.\n * @returns {ConfigArray} The config array of the file.\n */\n getConfigArrayForFile(filePath, { ignoreNotFoundError = false } = {}) {\n const {\n baseConfigArray,\n cliConfigArray,\n cwd\n } = internalSlotsMap.get(this);\n\n if (!filePath) {\n return new ConfigArray(...baseConfigArray, ...cliConfigArray);\n }\n\n const directoryPath = path.dirname(path.resolve(cwd, filePath));\n\n debug(`Load config files for ${directoryPath}.`);\n\n return this._finalizeConfigArray(\n this._loadConfigInAncestors(directoryPath),\n directoryPath,\n ignoreNotFoundError\n );\n }\n\n /**\n * Set the config data to override all configs.\n * Require to call `clearCache()` method after this method is called.\n * @param {ConfigData} configData The config data to override all configs.\n * @returns {void}\n */\n setOverrideConfig(configData) {\n const slots = internalSlotsMap.get(this);\n\n slots.cliConfigData = configData;\n }\n\n /**\n * Clear config cache.\n * @returns {void}\n */\n clearCache() {\n const slots = internalSlotsMap.get(this);\n\n slots.baseConfigArray = createBaseConfigArray(slots);\n slots.cliConfigArray = createCLIConfigArray(slots);\n slots.configCache.clear();\n }\n\n /**\n * Load and normalize config files from the ancestor directories.\n * @param {string} directoryPath The path to a leaf directory.\n * @param {boolean} configsExistInSubdirs `true` if configurations exist in subdirectories.\n * @returns {ConfigArray} The loaded config.\n * @private\n */\n _loadConfigInAncestors(directoryPath, configsExistInSubdirs = false) {\n const {\n baseConfigArray,\n configArrayFactory,\n configCache,\n cwd,\n useEslintrc\n } = internalSlotsMap.get(this);\n\n if (!useEslintrc) {\n return baseConfigArray;\n }\n\n let configArray = configCache.get(directoryPath);\n\n // Hit cache.\n if (configArray) {\n debug(`Cache hit: ${directoryPath}.`);\n return configArray;\n }\n debug(`No cache found: ${directoryPath}.`);\n\n const homePath = os.homedir();\n\n // Consider this is root.\n if (directoryPath === homePath && cwd !== homePath) {\n debug(\"Stop traversing because of considered root.\");\n if (configsExistInSubdirs) {\n const filePath = ConfigArrayFactory.getPathToConfigFileInDirectory(directoryPath);\n\n if (filePath) {\n emitDeprecationWarning(\n filePath,\n \"ESLINT_PERSONAL_CONFIG_SUPPRESS\"\n );\n }\n }\n return this._cacheConfig(directoryPath, baseConfigArray);\n }\n\n // Load the config on this directory.\n try {\n configArray = configArrayFactory.loadInDirectory(directoryPath);\n } catch (error) {\n /* istanbul ignore next */\n if (error.code === \"EACCES\") {\n debug(\"Stop traversing because of 'EACCES' error.\");\n return this._cacheConfig(directoryPath, baseConfigArray);\n }\n throw error;\n }\n\n if (configArray.length > 0 && configArray.isRoot()) {\n debug(\"Stop traversing because of 'root:true'.\");\n configArray.unshift(...baseConfigArray);\n return this._cacheConfig(directoryPath, configArray);\n }\n\n // Load from the ancestors and merge it.\n const parentPath = path.dirname(directoryPath);\n const parentConfigArray = parentPath && parentPath !== directoryPath\n ? this._loadConfigInAncestors(\n parentPath,\n configsExistInSubdirs || configArray.length > 0\n )\n : baseConfigArray;\n\n if (configArray.length > 0) {\n configArray.unshift(...parentConfigArray);\n } else {\n configArray = parentConfigArray;\n }\n\n // Cache and return.\n return this._cacheConfig(directoryPath, configArray);\n }\n\n /**\n * Freeze and cache a given config.\n * @param {string} directoryPath The path to a directory as a cache key.\n * @param {ConfigArray} configArray The config array as a cache value.\n * @returns {ConfigArray} The `configArray` (frozen).\n */\n _cacheConfig(directoryPath, configArray) {\n const { configCache } = internalSlotsMap.get(this);\n\n Object.freeze(configArray);\n configCache.set(directoryPath, configArray);\n\n return configArray;\n }\n\n /**\n * Finalize a given config array.\n * Concatenate `--config` and other CLI options.\n * @param {ConfigArray} configArray The parent config array.\n * @param {string} directoryPath The path to the leaf directory to find config files.\n * @param {boolean} ignoreNotFoundError If `true` then it doesn't throw `ConfigurationNotFoundError`.\n * @returns {ConfigArray} The loaded config.\n * @private\n */\n _finalizeConfigArray(configArray, directoryPath, ignoreNotFoundError) {\n const {\n cliConfigArray,\n configArrayFactory,\n finalizeCache,\n useEslintrc,\n builtInRules\n } = internalSlotsMap.get(this);\n\n let finalConfigArray = finalizeCache.get(configArray);\n\n if (!finalConfigArray) {\n finalConfigArray = configArray;\n\n // Load the personal config if there are no regular config files.\n if (\n useEslintrc &&\n configArray.every(c => !c.filePath) &&\n cliConfigArray.every(c => !c.filePath) // `--config` option can be a file.\n ) {\n const homePath = os.homedir();\n\n debug(\"Loading the config file of the home directory:\", homePath);\n\n const personalConfigArray = configArrayFactory.loadInDirectory(\n homePath,\n { name: \"PersonalConfig\" }\n );\n\n if (\n personalConfigArray.length > 0 &&\n !directoryPath.startsWith(homePath)\n ) {\n const lastElement =\n personalConfigArray[personalConfigArray.length - 1];\n\n emitDeprecationWarning(\n lastElement.filePath,\n \"ESLINT_PERSONAL_CONFIG_LOAD\"\n );\n }\n\n finalConfigArray = finalConfigArray.concat(personalConfigArray);\n }\n\n // Apply CLI options.\n if (cliConfigArray.length > 0) {\n finalConfigArray = finalConfigArray.concat(cliConfigArray);\n }\n\n // Validate rule settings and environments.\n const validator = new ConfigValidator({\n builtInRules\n });\n\n validator.validateConfigArray(finalConfigArray);\n\n // Cache it.\n Object.freeze(finalConfigArray);\n finalizeCache.set(configArray, finalConfigArray);\n\n debug(\n \"Configuration was determined: %o on %s\",\n finalConfigArray,\n directoryPath\n );\n }\n\n // At least one element (the default ignore patterns) exists.\n if (!ignoreNotFoundError && useEslintrc && finalConfigArray.length <= 1) {\n throw new ConfigurationNotFoundError(directoryPath);\n }\n\n return finalConfigArray;\n }\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport { CascadingConfigArrayFactory };\n","/**\n * @fileoverview Compatibility class for flat config.\n * @author Nicholas C. Zakas\n */\n\n//-----------------------------------------------------------------------------\n// Requirements\n//-----------------------------------------------------------------------------\n\nimport createDebug from \"debug\";\nimport path from \"path\";\n\nimport environments from \"../conf/environments.js\";\nimport { ConfigArrayFactory } from \"./config-array-factory.js\";\n\n//-----------------------------------------------------------------------------\n// Helpers\n//-----------------------------------------------------------------------------\n\n/** @typedef {import(\"../../shared/types\").Environment} Environment */\n/** @typedef {import(\"../../shared/types\").Processor} Processor */\n\nconst debug = createDebug(\"eslintrc:flat-compat\");\nconst cafactory = Symbol(\"cafactory\");\n\n/**\n * Translates an ESLintRC-style config object into a flag-config-style config\n * object.\n * @param {Object} eslintrcConfig An ESLintRC-style config object.\n * @param {Object} options Options to help translate the config.\n * @param {string} options.resolveConfigRelativeTo To the directory to resolve\n * configs from.\n * @param {string} options.resolvePluginsRelativeTo The directory to resolve\n * plugins from.\n * @param {ReadOnlyMap} options.pluginEnvironments A map of plugin environment\n * names to objects.\n * @param {ReadOnlyMap} options.pluginProcessors A map of plugin processor\n * names to objects.\n * @returns {Object} A flag-config-style config object.\n */\nfunction translateESLintRC(eslintrcConfig, {\n resolveConfigRelativeTo,\n resolvePluginsRelativeTo,\n pluginEnvironments,\n pluginProcessors\n}) {\n\n const flatConfig = {};\n const configs = [];\n const languageOptions = {};\n const linterOptions = {};\n const keysToCopy = [\"settings\", \"rules\", \"processor\"];\n const languageOptionsKeysToCopy = [\"globals\", \"parser\", \"parserOptions\"];\n const linterOptionsKeysToCopy = [\"noInlineConfig\", \"reportUnusedDisableDirectives\"];\n\n // check for special settings for eslint:all and eslint:recommended:\n if (eslintrcConfig.settings) {\n if (eslintrcConfig.settings[\"eslint:all\"] === true) {\n return [\"eslint:all\"];\n }\n\n if (eslintrcConfig.settings[\"eslint:recommended\"] === true) {\n return [\"eslint:recommended\"];\n }\n }\n\n // copy over simple translations\n for (const key of keysToCopy) {\n if (key in eslintrcConfig && typeof eslintrcConfig[key] !== \"undefined\") {\n flatConfig[key] = eslintrcConfig[key];\n }\n }\n\n // copy over languageOptions\n for (const key of languageOptionsKeysToCopy) {\n if (key in eslintrcConfig && typeof eslintrcConfig[key] !== \"undefined\") {\n\n // create the languageOptions key in the flat config\n flatConfig.languageOptions = languageOptions;\n\n if (key === \"parser\") {\n debug(`Resolving parser '${languageOptions[key]}' relative to ${resolveConfigRelativeTo}`);\n\n if (eslintrcConfig[key].error) {\n throw eslintrcConfig[key].error;\n }\n\n languageOptions[key] = eslintrcConfig[key].definition;\n continue;\n }\n\n // clone any object values that are in the eslintrc config\n if (eslintrcConfig[key] && typeof eslintrcConfig[key] === \"object\") {\n languageOptions[key] = {\n ...eslintrcConfig[key]\n };\n } else {\n languageOptions[key] = eslintrcConfig[key];\n }\n }\n }\n\n // copy over linterOptions\n for (const key of linterOptionsKeysToCopy) {\n if (key in eslintrcConfig && typeof eslintrcConfig[key] !== \"undefined\") {\n flatConfig.linterOptions = linterOptions;\n linterOptions[key] = eslintrcConfig[key];\n }\n }\n\n // move ecmaVersion a level up\n if (languageOptions.parserOptions) {\n\n if (\"ecmaVersion\" in languageOptions.parserOptions) {\n languageOptions.ecmaVersion = languageOptions.parserOptions.ecmaVersion;\n delete languageOptions.parserOptions.ecmaVersion;\n }\n\n if (\"sourceType\" in languageOptions.parserOptions) {\n languageOptions.sourceType = languageOptions.parserOptions.sourceType;\n delete languageOptions.parserOptions.sourceType;\n }\n\n // check to see if we even need parserOptions anymore and remove it if not\n if (Object.keys(languageOptions.parserOptions).length === 0) {\n delete languageOptions.parserOptions;\n }\n }\n\n // overrides\n if (eslintrcConfig.criteria) {\n flatConfig.files = [absoluteFilePath => eslintrcConfig.criteria.test(absoluteFilePath)];\n }\n\n // translate plugins\n if (eslintrcConfig.plugins && typeof eslintrcConfig.plugins === \"object\") {\n debug(`Translating plugins: ${eslintrcConfig.plugins}`);\n\n flatConfig.plugins = {};\n\n for (const pluginName of Object.keys(eslintrcConfig.plugins)) {\n\n debug(`Translating plugin: ${pluginName}`);\n debug(`Resolving plugin '${pluginName} relative to ${resolvePluginsRelativeTo}`);\n\n const { definition: plugin, error } = eslintrcConfig.plugins[pluginName];\n\n if (error) {\n throw error;\n }\n\n flatConfig.plugins[pluginName] = plugin;\n\n // create a config for any processors\n if (plugin.processors) {\n for (const processorName of Object.keys(plugin.processors)) {\n if (processorName.startsWith(\".\")) {\n debug(`Assigning processor: ${pluginName}/${processorName}`);\n\n configs.unshift({\n files: [`**/*${processorName}`],\n processor: pluginProcessors.get(`${pluginName}/${processorName}`)\n });\n }\n\n }\n }\n }\n }\n\n // translate env - must come after plugins\n if (eslintrcConfig.env && typeof eslintrcConfig.env === \"object\") {\n for (const envName of Object.keys(eslintrcConfig.env)) {\n\n // only add environments that are true\n if (eslintrcConfig.env[envName]) {\n debug(`Translating environment: ${envName}`);\n\n if (environments.has(envName)) {\n\n // built-in environments should be defined first\n configs.unshift(...translateESLintRC(environments.get(envName), {\n resolveConfigRelativeTo,\n resolvePluginsRelativeTo\n }));\n } else if (pluginEnvironments.has(envName)) {\n\n // if the environment comes from a plugin, it should come after the plugin config\n configs.push(...translateESLintRC(pluginEnvironments.get(envName), {\n resolveConfigRelativeTo,\n resolvePluginsRelativeTo\n }));\n }\n }\n }\n }\n\n // only add if there are actually keys in the config\n if (Object.keys(flatConfig).length > 0) {\n configs.push(flatConfig);\n }\n\n return configs;\n}\n\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\n/**\n * A compatibility class for working with configs.\n */\nclass FlatCompat {\n\n constructor({\n baseDirectory = process.cwd(),\n resolvePluginsRelativeTo = baseDirectory\n } = {}) {\n this.baseDirectory = baseDirectory;\n this.resolvePluginsRelativeTo = resolvePluginsRelativeTo;\n this[cafactory] = new ConfigArrayFactory({\n cwd: baseDirectory,\n resolvePluginsRelativeTo,\n getEslintAllConfig: () => ({ settings: { \"eslint:all\": true } }),\n getEslintRecommendedConfig: () => ({ settings: { \"eslint:recommended\": true } })\n });\n }\n\n /**\n * Translates an ESLintRC-style config into a flag-config-style config.\n * @param {Object} eslintrcConfig The ESLintRC-style config object.\n * @returns {Object} A flag-config-style config object.\n */\n config(eslintrcConfig) {\n const eslintrcArray = this[cafactory].create(eslintrcConfig, {\n basePath: this.baseDirectory\n });\n\n const flatArray = [];\n let hasIgnorePatterns = false;\n\n eslintrcArray.forEach(configData => {\n if (configData.type === \"config\") {\n hasIgnorePatterns = hasIgnorePatterns || configData.ignorePattern;\n flatArray.push(...translateESLintRC(configData, {\n resolveConfigRelativeTo: path.join(this.baseDirectory, \"__placeholder.js\"),\n resolvePluginsRelativeTo: path.join(this.resolvePluginsRelativeTo, \"__placeholder.js\"),\n pluginEnvironments: eslintrcArray.pluginEnvironments,\n pluginProcessors: eslintrcArray.pluginProcessors\n }));\n }\n });\n\n // combine ignorePatterns to emulate ESLintRC behavior better\n if (hasIgnorePatterns) {\n flatArray.unshift({\n ignores: [filePath => {\n\n // Compute the final config for this file.\n // This filters config array elements by `files`/`excludedFiles` then merges the elements.\n const finalConfig = eslintrcArray.extractConfig(filePath);\n\n // Test the `ignorePattern` properties of the final config.\n return Boolean(finalConfig.ignores) && finalConfig.ignores(filePath);\n }]\n });\n }\n\n return flatArray;\n }\n\n /**\n * Translates the `env` section of an ESLintRC-style config.\n * @param {Object} envConfig The `env` section of an ESLintRC config.\n * @returns {Object} A flag-config object representing the environments.\n */\n env(envConfig) {\n return this.config({\n env: envConfig\n });\n }\n\n /**\n * Translates the `extends` section of an ESLintRC-style config.\n * @param {...string} configsToExtend The names of the configs to load.\n * @returns {Object} A flag-config object representing the config.\n */\n extends(...configsToExtend) {\n return this.config({\n extends: configsToExtend\n });\n }\n\n /**\n * Translates the `plugins` section of an ESLintRC-style config.\n * @param {...string} plugins The names of the plugins to load.\n * @returns {Object} A flag-config object representing the plugins.\n */\n plugins(...plugins) {\n return this.config({\n plugins\n });\n }\n}\n\nexport { FlatCompat };\n","/**\n * @fileoverview Package exports for @eslint/eslintrc\n * @author Nicholas C. Zakas\n */\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport {\n ConfigArrayFactory,\n createContext as createConfigArrayFactoryContext\n} from \"./config-array-factory.js\";\n\nimport { CascadingConfigArrayFactory } from \"./cascading-config-array-factory.js\";\nimport * as ModuleResolver from \"./shared/relative-module-resolver.js\";\nimport { ConfigArray, getUsedExtractedConfigs } from \"./config-array/index.js\";\nimport { ConfigDependency } from \"./config-array/config-dependency.js\";\nimport { ExtractedConfig } from \"./config-array/extracted-config.js\";\nimport { IgnorePattern } from \"./config-array/ignore-pattern.js\";\nimport { OverrideTester } from \"./config-array/override-tester.js\";\nimport * as ConfigOps from \"./shared/config-ops.js\";\nimport ConfigValidator from \"./shared/config-validator.js\";\nimport * as naming from \"./shared/naming.js\";\nimport { FlatCompat } from \"./flat-compat.js\";\nimport environments from \"../conf/environments.js\";\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\nconst Legacy = {\n ConfigArray,\n createConfigArrayFactoryContext,\n CascadingConfigArrayFactory,\n ConfigArrayFactory,\n ConfigDependency,\n ExtractedConfig,\n IgnorePattern,\n OverrideTester,\n getUsedExtractedConfigs,\n environments,\n\n // shared\n ConfigOps,\n ConfigValidator,\n ModuleResolver,\n naming\n};\n\nexport {\n\n Legacy,\n\n FlatCompat\n\n};\n"],"names":["debug","debugOrig","path","ignore","assert","internalSlotsMap","util","minimatch","Ajv","globals","BuiltInEnvironments","ConfigOps.normalizeConfigGlobal","Module","require","createRequire","fs","stripComments","importFresh","ModuleResolver.resolve","naming.normalizePackageName","naming.getShorthandName","os","createDebug","createConfigArrayFactoryContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUA;AACA,MAAMA,OAAK,GAAGC,6BAAS,CAAC,yBAAyB,CAAC,CAAC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qBAAqB,CAAC,WAAW,EAAE;AAC5C,IAAI,IAAI,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AAChC;AACA,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;AACjD,QAAQ,MAA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;AACA;AACA;AACA;AACA;AACA;AACA;AAsBA;AACA,MAAMC,SAAO,GAAGC,oBAAa,CAAC,mDAAe,CAAC,CAAC;AAC/C;AACA,MAAMd,OAAK,GAAGC,6BAAS,CAAC,+BAA+B,CAAC,CAAC;AACzD;AACA;AACA;AACA;AACA;AACA,MAAM,eAAe,GAAG;AACxB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,WAAW;AACf,IAAI,cAAc;AAClB,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,kBAAgB,GAAG,IAAI,OAAO,EAAE,CAAC;AACvC;AACA;AACA,MAAM,iBAAiB,GAAG,IAAI,OAAO,EAAE,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,UAAU,EAAE;AAChC,IAAI;AACJ,QAAQ,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC;AACzC,QAAQH,wBAAI,CAAC,UAAU,CAAC,UAAU,CAAC;AACnC,MAAM;AACN,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ,CAAC,QAAQ,EAAE;AAC5B,IAAI,OAAOa,sBAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AACrE,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,kBAAkB,CAAC,QAAQ,EAAE;AACtC,IAAIf,OAAK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,GAAG;AAClC,4BAA4B,IAAI,EAAE,oBAAoB;AACtD,4BAA4B,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,CAAC;AACxF,yBAAyB;AACzB,qBAAqB,CAAC;AACtB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;;AC1nCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAkBA;AACA,MAAMA,OAAK,GAAGC,6BAAS,CAAC,yCAAyC,CAAC,CAAC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAAE,CAAC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qBAAqB,CAAC;AAC/B,IAAI,kBAAkB;AACtB,IAAI,cAAc;AAClB,IAAI,SAAS;AACb,IAAI,GAAG;AACP,IAAI,SAAS;AACb,CAAC,EAAE;AACH,IAAI,MAAM,eAAe,GAAG,kBAAkB,CAAC,MAAM;AACrD,QAAQ,cAAc;AACtB,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE;AAC9B,KAAK,CAAC;AACN;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,eAAe,CAAC,OAAO,CAAC,kBAAkB,CAAC,MAAM;AACrD,QAAQ,EAAE,cAAc,EAAE,aAAa,CAAC,eAAe,EAAE;AACzD,QAAQ,EAAE,IAAI,EAAE,sBAAsB,EAAE;AACxC,KAAK,CAAC,CA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O,CAAC,GAAG,OAAO,EAAE;AACxB,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC;AAC3B,YAAY,OAAO;AACnB,SAAS,CAAC,CAAC;AACX,KAAK;AACL;;AChTA;AACA;AACA;AACA;AAsBA;AACA;AACA;AACA;AACA;AACK,MAAC,MAAM,GAAG;AACf,IAAI,WAAW;AACf,qCAAIqB,aAA+B;AACnC,IAAI,2BAA2B;AAC/B,IAAI,kBAAkB;AACtB,IAAI,gBAAgB;AACpB,IAAI,eAAe;AACnB,IAAI,aAAa;AACjB,IAAI,cAAc;AAClB,IAAI,uBAAuB;AAC3B,IAAI,YAAY;AAChB;AACA;AACA,IAAI,SAAS;AACb,IAAI,eAAe;AACnB,IAAI,cAAc;AAClB,IAAI,MAAM;AACV;;;;;"} \ No newline at end of file diff --git a/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js b/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js new file mode 100644 index 000000000..597352e43 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js @@ -0,0 +1,532 @@ +/** + * @fileoverview `CascadingConfigArrayFactory` class. + * + * `CascadingConfigArrayFactory` class has a responsibility: + * + * 1. Handles cascading of config files. + * + * It provides two methods: + * + * - `getConfigArrayForFile(filePath)` + * Get the corresponded configuration of a given file. This method doesn't + * throw even if the given file didn't exist. + * - `clearCache()` + * Clear the internal cache. You have to call this method when + * `additionalPluginPool` was updated if `baseConfig` or `cliConfig` depends + * on the additional plugins. (`CLIEngine#addPlugin()` method calls this.) + * + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import debugOrig from "debug"; +import os from "os"; +import path from "path"; + +import { ConfigArrayFactory } from "./config-array-factory.js"; +import { + ConfigArray, + ConfigDependency, + IgnorePattern +} from "./config-array/index.js"; +import ConfigValidator from "./shared/config-validator.js"; +import { emitDeprecationWarning } from "./shared/deprecation-warnings.js"; + +const debug = debugOrig("eslintrc:cascading-config-array-factory"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// Define types for VSCode IntelliSense. +/** @typedef {import("./shared/types").ConfigData} ConfigData */ +/** @typedef {import("./shared/types").Parser} Parser */ +/** @typedef {import("./shared/types").Plugin} Plugin */ +/** @typedef {import("./shared/types").Rule} Rule */ +/** @typedef {ReturnType} ConfigArray */ + +/** + * @typedef {Object} CascadingConfigArrayFactoryOptions + * @property {Map} [additionalPluginPool] The map for additional plugins. + * @property {ConfigData} [baseConfig] The config by `baseConfig` option. + * @property {ConfigData} [cliConfig] The config by CLI options (`--env`, `--global`, `--ignore-pattern`, `--parser`, `--parser-options`, `--plugin`, and `--rule`). CLI options overwrite the setting in config files. + * @property {string} [cwd] The base directory to start lookup. + * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`. + * @property {string[]} [rulePaths] The value of `--rulesdir` option. + * @property {string} [specificConfigPath] The value of `--config` option. + * @property {boolean} [useEslintrc] if `false` then it doesn't load config files. + * @property {Function} loadRules The function to use to load rules. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** + * @typedef {Object} CascadingConfigArrayFactoryInternalSlots + * @property {ConfigArray} baseConfigArray The config array of `baseConfig` option. + * @property {ConfigData} baseConfigData The config data of `baseConfig` option. This is used to reset `baseConfigArray`. + * @property {ConfigArray} cliConfigArray The config array of CLI options. + * @property {ConfigData} cliConfigData The config data of CLI options. This is used to reset `cliConfigArray`. + * @property {ConfigArrayFactory} configArrayFactory The factory for config arrays. + * @property {Map} configCache The cache from directory paths to config arrays. + * @property {string} cwd The base directory to start lookup. + * @property {WeakMap} finalizeCache The cache from config arrays to finalized config arrays. + * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`. + * @property {string[]|null} rulePaths The value of `--rulesdir` option. This is used to reset `baseConfigArray`. + * @property {string|null} specificConfigPath The value of `--config` option. This is used to reset `cliConfigArray`. + * @property {boolean} useEslintrc if `false` then it doesn't load config files. + * @property {Function} loadRules The function to use to load rules. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** @type {WeakMap} */ +const internalSlotsMap = new WeakMap(); + +/** + * Create the config array from `baseConfig` and `rulePaths`. + * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots. + * @returns {ConfigArray} The config array of the base configs. + */ +function createBaseConfigArray({ + configArrayFactory, + baseConfigData, + rulePaths, + cwd, + loadRules +}) { + const baseConfigArray = configArrayFactory.create( + baseConfigData, + { name: "BaseConfig" } + ); + + /* + * Create the config array element for the default ignore patterns. + * This element has `ignorePattern` property that ignores the default + * patterns in the current working directory. + */ + baseConfigArray.unshift(configArrayFactory.create( + { ignorePatterns: IgnorePattern.DefaultPatterns }, + { name: "DefaultIgnorePattern" } + )[0]); + + /* + * Load rules `--rulesdir` option as a pseudo plugin. + * Use a pseudo plugin to define rules of `--rulesdir`, so we can validate + * the rule's options with only information in the config array. + */ + if (rulePaths && rulePaths.length > 0) { + baseConfigArray.push({ + type: "config", + name: "--rulesdir", + filePath: "", + plugins: { + "": new ConfigDependency({ + definition: { + rules: rulePaths.reduce( + (map, rulesPath) => Object.assign( + map, + loadRules(rulesPath, cwd) + ), + {} + ) + }, + filePath: "", + id: "", + importerName: "--rulesdir", + importerPath: "" + }) + } + }); + } + + return baseConfigArray; +} + +/** + * Create the config array from CLI options. + * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots. + * @returns {ConfigArray} The config array of the base configs. + */ +function createCLIConfigArray({ + cliConfigData, + configArrayFactory, + cwd, + ignorePath, + specificConfigPath +}) { + const cliConfigArray = configArrayFactory.create( + cliConfigData, + { name: "CLIOptions" } + ); + + cliConfigArray.unshift( + ...(ignorePath + ? configArrayFactory.loadESLintIgnore(ignorePath) + : configArrayFactory.loadDefaultESLintIgnore()) + ); + + if (specificConfigPath) { + cliConfigArray.unshift( + ...configArrayFactory.loadFile( + specificConfigPath, + { name: "--config", basePath: cwd } + ) + ); + } + + return cliConfigArray; +} + +/** + * The error type when there are files matched by a glob, but all of them have been ignored. + */ +class ConfigurationNotFoundError extends Error { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {string} directoryPath The directory path. + */ + constructor(directoryPath) { + super(`No ESLint configuration found in ${directoryPath}.`); + this.messageTemplate = "no-config-found"; + this.messageData = { directoryPath }; + } +} + +/** + * This class provides the functionality that enumerates every file which is + * matched by given glob patterns and that configuration. + */ +class CascadingConfigArrayFactory { + + /** + * Initialize this enumerator. + * @param {CascadingConfigArrayFactoryOptions} options The options. + */ + constructor({ + additionalPluginPool = new Map(), + baseConfig: baseConfigData = null, + cliConfig: cliConfigData = null, + cwd = process.cwd(), + ignorePath, + resolvePluginsRelativeTo, + rulePaths = [], + specificConfigPath = null, + useEslintrc = true, + builtInRules = new Map(), + loadRules, + resolver, + eslintRecommendedPath, + getEslintRecommendedConfig, + eslintAllPath, + getEslintAllConfig + } = {}) { + const configArrayFactory = new ConfigArrayFactory({ + additionalPluginPool, + cwd, + resolvePluginsRelativeTo, + builtInRules, + resolver, + eslintRecommendedPath, + getEslintRecommendedConfig, + eslintAllPath, + getEslintAllConfig + }); + + internalSlotsMap.set(this, { + baseConfigArray: createBaseConfigArray({ + baseConfigData, + configArrayFactory, + cwd, + rulePaths, + loadRules + }), + baseConfigData, + cliConfigArray: createCLIConfigArray({ + cliConfigData, + configArrayFactory, + cwd, + ignorePath, + specificConfigPath + }), + cliConfigData, + configArrayFactory, + configCache: new Map(), + cwd, + finalizeCache: new WeakMap(), + ignorePath, + rulePaths, + specificConfigPath, + useEslintrc, + builtInRules, + loadRules + }); + } + + /** + * The path to the current working directory. + * This is used by tests. + * @type {string} + */ + get cwd() { + const { cwd } = internalSlotsMap.get(this); + + return cwd; + } + + /** + * Get the config array of a given file. + * If `filePath` was not given, it returns the config which contains only + * `baseConfigData` and `cliConfigData`. + * @param {string} [filePath] The file path to a file. + * @param {Object} [options] The options. + * @param {boolean} [options.ignoreNotFoundError] If `true` then it doesn't throw `ConfigurationNotFoundError`. + * @returns {ConfigArray} The config array of the file. + */ + getConfigArrayForFile(filePath, { ignoreNotFoundError = false } = {}) { + const { + baseConfigArray, + cliConfigArray, + cwd + } = internalSlotsMap.get(this); + + if (!filePath) { + return new ConfigArray(...baseConfigArray, ...cliConfigArray); + } + + const directoryPath = path.dirname(path.resolve(cwd, filePath)); + + debug(`Load config files for ${directoryPath}.`); + + return this._finalizeConfigArray( + this._loadConfigInAncestors(directoryPath), + directoryPath, + ignoreNotFoundError + ); + } + + /** + * Set the config data to override all configs. + * Require to call `clearCache()` method after this method is called. + * @param {ConfigData} configData The config data to override all configs. + * @returns {void} + */ + setOverrideConfig(configData) { + const slots = internalSlotsMap.get(this); + + slots.cliConfigData = configData; + } + + /** + * Clear config cache. + * @returns {void} + */ + clearCache() { + const slots = internalSlotsMap.get(this); + + slots.baseConfigArray = createBaseConfigArray(slots); + slots.cliConfigArray = createCLIConfigArray(slots); + slots.configCache.clear(); + } + + /** + * Load and normalize config files from the ancestor directories. + * @param {string} directoryPath The path to a leaf directory. + * @param {boolean} configsExistInSubdirs `true` if configurations exist in subdirectories. + * @returns {ConfigArray} The loaded config. + * @private + */ + _loadConfigInAncestors(directoryPath, configsExistInSubdirs = false) { + const { + baseConfigArray, + configArrayFactory, + configCache, + cwd, + useEslintrc + } = internalSlotsMap.get(this); + + if (!useEslintrc) { + return baseConfigArray; + } + + let configArray = configCache.get(directoryPath); + + // Hit cache. + if (configArray) { + debug(`Cache hit: ${directoryPath}.`); + return configArray; + } + debug(`No cache found: ${directoryPath}.`); + + const homePath = os.homedir(); + + // Consider this is root. + if (directoryPath === homePath && cwd !== homePath) { + debug("Stop traversing because of considered root."); + if (configsExistInSubdirs) { + const filePath = ConfigArrayFactory.getPathToConfigFileInDirectory(directoryPath); + + if (filePath) { + emitDeprecationWarning( + filePath, + "ESLINT_PERSONAL_CONFIG_SUPPRESS" + ); + } + } + return this._cacheConfig(directoryPath, baseConfigArray); + } + + // Load the config on this directory. + try { + configArray = configArrayFactory.loadInDirectory(directoryPath); + } catch (error) { + /* istanbul ignore next */ + if (error.code === "EACCES") { + debug("Stop traversing because of 'EACCES' error."); + return this._cacheConfig(directoryPath, baseConfigArray); + } + throw error; + } + + if (configArray.length > 0 && configArray.isRoot()) { + debug("Stop traversing because of 'root:true'."); + configArray.unshift(...baseConfigArray); + return this._cacheConfig(directoryPath, configArray); + } + + // Load from the ancestors and merge it. + const parentPath = path.dirname(directoryPath); + const parentConfigArray = parentPath && parentPath !== directoryPath + ? this._loadConfigInAncestors( + parentPath, + configsExistInSubdirs || configArray.length > 0 + ) + : baseConfigArray; + + if (configArray.length > 0) { + configArray.unshift(...parentConfigArray); + } else { + configArray = parentConfigArray; + } + + // Cache and return. + return this._cacheConfig(directoryPath, configArray); + } + + /** + * Freeze and cache a given config. + * @param {string} directoryPath The path to a directory as a cache key. + * @param {ConfigArray} configArray The config array as a cache value. + * @returns {ConfigArray} The `configArray` (frozen). + */ + _cacheConfig(directoryPath, configArray) { + const { configCache } = internalSlotsMap.get(this); + + Object.freeze(configArray); + configCache.set(directoryPath, configArray); + + return configArray; + } + + /** + * Finalize a given config array. + * Concatenate `--config` and other CLI options. + * @param {ConfigArray} configArray The parent config array. + * @param {string} directoryPath The path to the leaf directory to find config files. + * @param {boolean} ignoreNotFoundError If `true` then it doesn't throw `ConfigurationNotFoundError`. + * @returns {ConfigArray} The loaded config. + * @private + */ + _finalizeConfigArray(configArray, directoryPath, ignoreNotFoundError) { + const { + cliConfigArray, + configArrayFactory, + finalizeCache, + useEslintrc, + builtInRules + } = internalSlotsMap.get(this); + + let finalConfigArray = finalizeCache.get(configArray); + + if (!finalConfigArray) { + finalConfigArray = configArray; + + // Load the personal config if there are no regular config files. + if ( + useEslintrc && + configArray.every(c => !c.filePath) && + cliConfigArray.every(c => !c.filePath) // `--config` option can be a file. + ) { + const homePath = os.homedir(); + + debug("Loading the config file of the home directory:", homePath); + + const personalConfigArray = configArrayFactory.loadInDirectory( + homePath, + { name: "PersonalConfig" } + ); + + if ( + personalConfigArray.length > 0 && + !directoryPath.startsWith(homePath) + ) { + const lastElement = + personalConfigArray[personalConfigArray.length - 1]; + + emitDeprecationWarning( + lastElement.filePath, + "ESLINT_PERSONAL_CONFIG_LOAD" + ); + } + + finalConfigArray = finalConfigArray.concat(personalConfigArray); + } + + // Apply CLI options. + if (cliConfigArray.length > 0) { + finalConfigArray = finalConfigArray.concat(cliConfigArray); + } + + // Validate rule settings and environments. + const validator = new ConfigValidator({ + builtInRules + }); + + validator.validateConfigArray(finalConfigArray); + + // Cache it. + Object.freeze(finalConfigArray); + finalizeCache.set(configArray, finalConfigArray); + + debug( + "Configuration was determined: %o on %s", + finalConfigArray, + directoryPath + ); + } + + // At least one element (the default ignore patterns) exists. + if (!ignoreNotFoundError && useEslintrc && finalConfigArray.length <= 1) { + throw new ConfigurationNotFoundError(directoryPath); + } + + return finalConfigArray; + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +export { CascadingConfigArrayFactory }; diff --git a/node_modules/@eslint/eslintrc/lib/config-array-factory.js b/node_modules/@eslint/eslintrc/lib/config-array-factory.js new file mode 100644 index 000000000..99851e15f --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array-factory.js @@ -0,0 +1,1149 @@ +/** + * @fileoverview The factory of `ConfigArray` objects. + * + * This class provides methods to create `ConfigArray` instance. + * + * - `create(configData, options)` + * Create a `ConfigArray` instance from a config data. This is to handle CLI + * options except `--config`. + * - `loadFile(filePath, options)` + * Create a `ConfigArray` instance from a config file. This is to handle + * `--config` option. If the file was not found, throws the following error: + * - If the filename was `*.js`, a `MODULE_NOT_FOUND` error. + * - If the filename was `package.json`, an IO error or an + * `ESLINT_CONFIG_FIELD_NOT_FOUND` error. + * - Otherwise, an IO error such as `ENOENT`. + * - `loadInDirectory(directoryPath, options)` + * Create a `ConfigArray` instance from a config file which is on a given + * directory. This tries to load `.eslintrc.*` or `package.json`. If not + * found, returns an empty `ConfigArray`. + * - `loadESLintIgnore(filePath)` + * Create a `ConfigArray` instance from a config file that is `.eslintignore` + * format. This is to handle `--ignore-path` option. + * - `loadDefaultESLintIgnore()` + * Create a `ConfigArray` instance from `.eslintignore` or `package.json` in + * the current working directory. + * + * `ConfigArrayFactory` class has the responsibility that loads configuration + * files, including loading `extends`, `parser`, and `plugins`. The created + * `ConfigArray` instance has the loaded `extends`, `parser`, and `plugins`. + * + * But this class doesn't handle cascading. `CascadingConfigArrayFactory` class + * handles cascading and hierarchy. + * + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import debugOrig from "debug"; +import fs from "fs"; +import importFresh from "import-fresh"; +import { createRequire } from "module"; +import path from "path"; +import stripComments from "strip-json-comments"; + +import { + ConfigArray, + ConfigDependency, + IgnorePattern, + OverrideTester +} from "./config-array/index.js"; +import ConfigValidator from "./shared/config-validator.js"; +import * as naming from "./shared/naming.js"; +import * as ModuleResolver from "./shared/relative-module-resolver.js"; + +const require = createRequire(import.meta.url); + +const debug = debugOrig("eslintrc:config-array-factory"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const configFilenames = [ + ".eslintrc.js", + ".eslintrc.cjs", + ".eslintrc.yaml", + ".eslintrc.yml", + ".eslintrc.json", + ".eslintrc", + "package.json" +]; + +// Define types for VSCode IntelliSense. +/** @typedef {import("./shared/types").ConfigData} ConfigData */ +/** @typedef {import("./shared/types").OverrideConfigData} OverrideConfigData */ +/** @typedef {import("./shared/types").Parser} Parser */ +/** @typedef {import("./shared/types").Plugin} Plugin */ +/** @typedef {import("./shared/types").Rule} Rule */ +/** @typedef {import("./config-array/config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-array/config-dependency").DependentPlugin} DependentPlugin */ +/** @typedef {ConfigArray[0]} ConfigArrayElement */ + +/** + * @typedef {Object} ConfigArrayFactoryOptions + * @property {Map} [additionalPluginPool] The map for additional plugins. + * @property {string} [cwd] The path to the current working directory. + * @property {string} [resolvePluginsRelativeTo] A path to the directory that plugins should be resolved from. Defaults to `cwd`. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** + * @typedef {Object} ConfigArrayFactoryInternalSlots + * @property {Map} additionalPluginPool The map for additional plugins. + * @property {string} cwd The path to the current working directory. + * @property {string | undefined} resolvePluginsRelativeTo An absolute path the the directory that plugins should be resolved from. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** + * @typedef {Object} ConfigArrayFactoryLoadingContext + * @property {string} filePath The path to the current configuration. + * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @property {string} name The name of the current configuration. + * @property {string} pluginBasePath The base path to resolve plugins. + * @property {"config" | "ignore" | "implicit-processor"} type The type of the current configuration. This is `"config"` in normal. This is `"ignore"` if it came from `.eslintignore`. This is `"implicit-processor"` if it came from legacy file-extension processors. + */ + +/** + * @typedef {Object} ConfigArrayFactoryLoadingContext + * @property {string} filePath The path to the current configuration. + * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @property {string} name The name of the current configuration. + * @property {"config" | "ignore" | "implicit-processor"} type The type of the current configuration. This is `"config"` in normal. This is `"ignore"` if it came from `.eslintignore`. This is `"implicit-processor"` if it came from legacy file-extension processors. + */ + +/** @type {WeakMap} */ +const internalSlotsMap = new WeakMap(); + +/** @type {WeakMap} */ +const normalizedPlugins = new WeakMap(); + +/** + * Check if a given string is a file path. + * @param {string} nameOrPath A module name or file path. + * @returns {boolean} `true` if the `nameOrPath` is a file path. + */ +function isFilePath(nameOrPath) { + return ( + /^\.{1,2}[/\\]/u.test(nameOrPath) || + path.isAbsolute(nameOrPath) + ); +} + +/** + * Convenience wrapper for synchronously reading file contents. + * @param {string} filePath The filename to read. + * @returns {string} The file contents, with the BOM removed. + * @private + */ +function readFile(filePath) { + return fs.readFileSync(filePath, "utf8").replace(/^\ufeff/u, ""); +} + +/** + * Loads a YAML configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadYAMLConfigFile(filePath) { + debug(`Loading YAML config file: ${filePath}`); + + // lazy load YAML to improve performance when not used + const yaml = require("js-yaml"); + + try { + + // empty YAML file can be null, so always use + return yaml.load(readFile(filePath)) || {}; + } catch (e) { + debug(`Error reading YAML file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a JSON configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadJSONConfigFile(filePath) { + debug(`Loading JSON config file: ${filePath}`); + + try { + return JSON.parse(stripComments(readFile(filePath))); + } catch (e) { + debug(`Error reading JSON file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + e.messageTemplate = "failed-to-read-json"; + e.messageData = { + path: filePath, + message: e.message + }; + throw e; + } +} + +/** + * Loads a legacy (.eslintrc) configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadLegacyConfigFile(filePath) { + debug(`Loading legacy config file: ${filePath}`); + + // lazy load YAML to improve performance when not used + const yaml = require("js-yaml"); + + try { + return yaml.load(stripComments(readFile(filePath))) || /* istanbul ignore next */ {}; + } catch (e) { + debug("Error reading YAML file: %s\n%o", filePath, e); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a JavaScript configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadJSConfigFile(filePath) { + debug(`Loading JS config file: ${filePath}`); + try { + return importFresh(filePath); + } catch (e) { + debug(`Error reading JavaScript file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a configuration from a package.json file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadPackageJSONConfigFile(filePath) { + debug(`Loading package.json config file: ${filePath}`); + try { + const packageData = loadJSONConfigFile(filePath); + + if (!Object.hasOwnProperty.call(packageData, "eslintConfig")) { + throw Object.assign( + new Error("package.json file doesn't have 'eslintConfig' field."), + { code: "ESLINT_CONFIG_FIELD_NOT_FOUND" } + ); + } + + return packageData.eslintConfig; + } catch (e) { + debug(`Error reading package.json file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a `.eslintignore` from a file. + * @param {string} filePath The filename to load. + * @returns {string[]} The ignore patterns from the file. + * @private + */ +function loadESLintIgnoreFile(filePath) { + debug(`Loading .eslintignore file: ${filePath}`); + + try { + return readFile(filePath) + .split(/\r?\n/gu) + .filter(line => line.trim() !== "" && !line.startsWith("#")); + } catch (e) { + debug(`Error reading .eslintignore file: ${filePath}`); + e.message = `Cannot read .eslintignore file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Creates an error to notify about a missing config to extend from. + * @param {string} configName The name of the missing config. + * @param {string} importerName The name of the config that imported the missing config + * @param {string} messageTemplate The text template to source error strings from. + * @returns {Error} The error object to throw + * @private + */ +function configInvalidError(configName, importerName, messageTemplate) { + return Object.assign( + new Error(`Failed to load config "${configName}" to extend from.`), + { + messageTemplate, + messageData: { configName, importerName } + } + ); +} + +/** + * Loads a configuration file regardless of the source. Inspects the file path + * to determine the correctly way to load the config file. + * @param {string} filePath The path to the configuration. + * @returns {ConfigData|null} The configuration information. + * @private + */ +function loadConfigFile(filePath) { + switch (path.extname(filePath)) { + case ".js": + case ".cjs": + return loadJSConfigFile(filePath); + + case ".json": + if (path.basename(filePath) === "package.json") { + return loadPackageJSONConfigFile(filePath); + } + return loadJSONConfigFile(filePath); + + case ".yaml": + case ".yml": + return loadYAMLConfigFile(filePath); + + default: + return loadLegacyConfigFile(filePath); + } +} + +/** + * Write debug log. + * @param {string} request The requested module name. + * @param {string} relativeTo The file path to resolve the request relative to. + * @param {string} filePath The resolved file path. + * @returns {void} + */ +function writeDebugLogForLoading(request, relativeTo, filePath) { + /* istanbul ignore next */ + if (debug.enabled) { + let nameAndVersion = null; + + try { + const packageJsonPath = ModuleResolver.resolve( + `${request}/package.json`, + relativeTo + ); + const { version = "unknown" } = require(packageJsonPath); + + nameAndVersion = `${request}@${version}`; + } catch (error) { + debug("package.json was not found:", error.message); + nameAndVersion = request; + } + + debug("Loaded: %s (%s)", nameAndVersion, filePath); + } +} + +/** + * Create a new context with default values. + * @param {ConfigArrayFactoryInternalSlots} slots The internal slots. + * @param {"config" | "ignore" | "implicit-processor" | undefined} providedType The type of the current configuration. Default is `"config"`. + * @param {string | undefined} providedName The name of the current configuration. Default is the relative path from `cwd` to `filePath`. + * @param {string | undefined} providedFilePath The path to the current configuration. Default is empty string. + * @param {string | undefined} providedMatchBasePath The type of the current configuration. Default is the directory of `filePath` or `cwd`. + * @returns {ConfigArrayFactoryLoadingContext} The created context. + */ +function createContext( + { cwd, resolvePluginsRelativeTo }, + providedType, + providedName, + providedFilePath, + providedMatchBasePath +) { + const filePath = providedFilePath + ? path.resolve(cwd, providedFilePath) + : ""; + const matchBasePath = + (providedMatchBasePath && path.resolve(cwd, providedMatchBasePath)) || + (filePath && path.dirname(filePath)) || + cwd; + const name = + providedName || + (filePath && path.relative(cwd, filePath)) || + ""; + const pluginBasePath = + resolvePluginsRelativeTo || + (filePath && path.dirname(filePath)) || + cwd; + const type = providedType || "config"; + + return { filePath, matchBasePath, name, pluginBasePath, type }; +} + +/** + * Normalize a given plugin. + * - Ensure the object to have four properties: configs, environments, processors, and rules. + * - Ensure the object to not have other properties. + * @param {Plugin} plugin The plugin to normalize. + * @returns {Plugin} The normalized plugin. + */ +function normalizePlugin(plugin) { + + // first check the cache + let normalizedPlugin = normalizedPlugins.get(plugin); + + if (normalizedPlugin) { + return normalizedPlugin; + } + + normalizedPlugin = { + configs: plugin.configs || {}, + environments: plugin.environments || {}, + processors: plugin.processors || {}, + rules: plugin.rules || {} + }; + + // save the reference for later + normalizedPlugins.set(plugin, normalizedPlugin); + + return normalizedPlugin; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The factory of `ConfigArray` objects. + */ +class ConfigArrayFactory { + + /** + * Initialize this instance. + * @param {ConfigArrayFactoryOptions} [options] The map for additional plugins. + */ + constructor({ + additionalPluginPool = new Map(), + cwd = process.cwd(), + resolvePluginsRelativeTo, + builtInRules, + resolver = ModuleResolver, + eslintAllPath, + getEslintAllConfig, + eslintRecommendedPath, + getEslintRecommendedConfig + } = {}) { + internalSlotsMap.set(this, { + additionalPluginPool, + cwd, + resolvePluginsRelativeTo: + resolvePluginsRelativeTo && + path.resolve(cwd, resolvePluginsRelativeTo), + builtInRules, + resolver, + eslintAllPath, + getEslintAllConfig, + eslintRecommendedPath, + getEslintRecommendedConfig + }); + } + + /** + * Create `ConfigArray` instance from a config data. + * @param {ConfigData|null} configData The config data to create. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.filePath] The path to this config data. + * @param {string} [options.name] The config name. + * @returns {ConfigArray} Loaded config. + */ + create(configData, { basePath, filePath, name } = {}) { + if (!configData) { + return new ConfigArray(); + } + + const slots = internalSlotsMap.get(this); + const ctx = createContext(slots, "config", name, filePath, basePath); + const elements = this._normalizeConfigData(configData, ctx); + + return new ConfigArray(...elements); + } + + /** + * Load a config file. + * @param {string} filePath The path to a config file. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.name] The config name. + * @returns {ConfigArray} Loaded config. + */ + loadFile(filePath, { basePath, name } = {}) { + const slots = internalSlotsMap.get(this); + const ctx = createContext(slots, "config", name, filePath, basePath); + + return new ConfigArray(...this._loadConfigData(ctx)); + } + + /** + * Load the config file on a given directory if exists. + * @param {string} directoryPath The path to a directory. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.name] The config name. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + */ + loadInDirectory(directoryPath, { basePath, name } = {}) { + const slots = internalSlotsMap.get(this); + + for (const filename of configFilenames) { + const ctx = createContext( + slots, + "config", + name, + path.join(directoryPath, filename), + basePath + ); + + if (fs.existsSync(ctx.filePath) && fs.statSync(ctx.filePath).isFile()) { + let configData; + + try { + configData = loadConfigFile(ctx.filePath); + } catch (error) { + if (!error || error.code !== "ESLINT_CONFIG_FIELD_NOT_FOUND") { + throw error; + } + } + + if (configData) { + debug(`Config file found: ${ctx.filePath}`); + return new ConfigArray( + ...this._normalizeConfigData(configData, ctx) + ); + } + } + } + + debug(`Config file not found on ${directoryPath}`); + return new ConfigArray(); + } + + /** + * Check if a config file on a given directory exists or not. + * @param {string} directoryPath The path to a directory. + * @returns {string | null} The path to the found config file. If not found then null. + */ + static getPathToConfigFileInDirectory(directoryPath) { + for (const filename of configFilenames) { + const filePath = path.join(directoryPath, filename); + + if (fs.existsSync(filePath)) { + if (filename === "package.json") { + try { + loadPackageJSONConfigFile(filePath); + return filePath; + } catch { /* ignore */ } + } else { + return filePath; + } + } + } + return null; + } + + /** + * Load `.eslintignore` file. + * @param {string} filePath The path to a `.eslintignore` file to load. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + */ + loadESLintIgnore(filePath) { + const slots = internalSlotsMap.get(this); + const ctx = createContext( + slots, + "ignore", + void 0, + filePath, + slots.cwd + ); + const ignorePatterns = loadESLintIgnoreFile(ctx.filePath); + + return new ConfigArray( + ...this._normalizeESLintIgnoreData(ignorePatterns, ctx) + ); + } + + /** + * Load `.eslintignore` file in the current working directory. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + */ + loadDefaultESLintIgnore() { + const slots = internalSlotsMap.get(this); + const eslintIgnorePath = path.resolve(slots.cwd, ".eslintignore"); + const packageJsonPath = path.resolve(slots.cwd, "package.json"); + + if (fs.existsSync(eslintIgnorePath)) { + return this.loadESLintIgnore(eslintIgnorePath); + } + if (fs.existsSync(packageJsonPath)) { + const data = loadJSONConfigFile(packageJsonPath); + + if (Object.hasOwnProperty.call(data, "eslintIgnore")) { + if (!Array.isArray(data.eslintIgnore)) { + throw new Error("Package.json eslintIgnore property requires an array of paths"); + } + const ctx = createContext( + slots, + "ignore", + "eslintIgnore in package.json", + packageJsonPath, + slots.cwd + ); + + return new ConfigArray( + ...this._normalizeESLintIgnoreData(data.eslintIgnore, ctx) + ); + } + } + + return new ConfigArray(); + } + + /** + * Load a given config file. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} Loaded config. + * @private + */ + _loadConfigData(ctx) { + return this._normalizeConfigData(loadConfigFile(ctx.filePath), ctx); + } + + /** + * Normalize a given `.eslintignore` data to config array elements. + * @param {string[]} ignorePatterns The patterns to ignore files. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeESLintIgnoreData(ignorePatterns, ctx) { + const elements = this._normalizeObjectConfigData( + { ignorePatterns }, + ctx + ); + + // Set `ignorePattern.loose` flag for backward compatibility. + for (const element of elements) { + if (element.ignorePattern) { + element.ignorePattern.loose = true; + } + yield element; + } + } + + /** + * Normalize a given config to an array. + * @param {ConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _normalizeConfigData(configData, ctx) { + const validator = new ConfigValidator(); + + validator.validateConfigSchema(configData, ctx.name || ctx.filePath); + return this._normalizeObjectConfigData(configData, ctx); + } + + /** + * Normalize a given config to an array. + * @param {ConfigData|OverrideConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeObjectConfigData(configData, ctx) { + const { files, excludedFiles, ...configBody } = configData; + const criteria = OverrideTester.create( + files, + excludedFiles, + ctx.matchBasePath + ); + const elements = this._normalizeObjectConfigDataBody(configBody, ctx); + + // Apply the criteria to every element. + for (const element of elements) { + + /* + * Merge the criteria. + * This is for the `overrides` entries that came from the + * configurations of `overrides[].extends`. + */ + element.criteria = OverrideTester.and(criteria, element.criteria); + + /* + * Remove `root` property to ignore `root` settings which came from + * `extends` in `overrides`. + */ + if (element.criteria) { + element.root = void 0; + } + + yield element; + } + } + + /** + * Normalize a given config to an array. + * @param {ConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeObjectConfigDataBody( + { + env, + extends: extend, + globals, + ignorePatterns, + noInlineConfig, + parser: parserName, + parserOptions, + plugins: pluginList, + processor, + reportUnusedDisableDirectives, + root, + rules, + settings, + overrides: overrideList = [] + }, + ctx + ) { + const extendList = Array.isArray(extend) ? extend : [extend]; + const ignorePattern = ignorePatterns && new IgnorePattern( + Array.isArray(ignorePatterns) ? ignorePatterns : [ignorePatterns], + ctx.matchBasePath + ); + + // Flatten `extends`. + for (const extendName of extendList.filter(Boolean)) { + yield* this._loadExtends(extendName, ctx); + } + + // Load parser & plugins. + const parser = parserName && this._loadParser(parserName, ctx); + const plugins = pluginList && this._loadPlugins(pluginList, ctx); + + // Yield pseudo config data for file extension processors. + if (plugins) { + yield* this._takeFileExtensionProcessors(plugins, ctx); + } + + // Yield the config data except `extends` and `overrides`. + yield { + + // Debug information. + type: ctx.type, + name: ctx.name, + filePath: ctx.filePath, + + // Config data. + criteria: null, + env, + globals, + ignorePattern, + noInlineConfig, + parser, + parserOptions, + plugins, + processor, + reportUnusedDisableDirectives, + root, + rules, + settings + }; + + // Flatten `overries`. + for (let i = 0; i < overrideList.length; ++i) { + yield* this._normalizeObjectConfigData( + overrideList[i], + { ...ctx, name: `${ctx.name}#overrides[${i}]` } + ); + } + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtends(extendName, ctx) { + debug("Loading {extends:%j} relative to %s", extendName, ctx.filePath); + try { + if (extendName.startsWith("eslint:")) { + return this._loadExtendedBuiltInConfig(extendName, ctx); + } + if (extendName.startsWith("plugin:")) { + return this._loadExtendedPluginConfig(extendName, ctx); + } + return this._loadExtendedShareableConfig(extendName, ctx); + } catch (error) { + error.message += `\nReferenced from: ${ctx.filePath || ctx.name}`; + throw error; + } + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtendedBuiltInConfig(extendName, ctx) { + const { + eslintAllPath, + getEslintAllConfig, + eslintRecommendedPath, + getEslintRecommendedConfig + } = internalSlotsMap.get(this); + + if (extendName === "eslint:recommended") { + const name = `${ctx.name} » ${extendName}`; + + if (getEslintRecommendedConfig) { + if (typeof getEslintRecommendedConfig !== "function") { + throw new Error(`getEslintRecommendedConfig must be a function instead of '${getEslintRecommendedConfig}'`); + } + return this._normalizeConfigData(getEslintRecommendedConfig(), { ...ctx, name, filePath: "" }); + } + return this._loadConfigData({ + ...ctx, + name, + filePath: eslintRecommendedPath + }); + } + if (extendName === "eslint:all") { + const name = `${ctx.name} » ${extendName}`; + + if (getEslintAllConfig) { + if (typeof getEslintAllConfig !== "function") { + throw new Error(`getEslintAllConfig must be a function instead of '${getEslintAllConfig}'`); + } + return this._normalizeConfigData(getEslintAllConfig(), { ...ctx, name, filePath: "" }); + } + return this._loadConfigData({ + ...ctx, + name, + filePath: eslintAllPath + }); + } + + throw configInvalidError(extendName, ctx.name, "extend-config-missing"); + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtendedPluginConfig(extendName, ctx) { + const slashIndex = extendName.lastIndexOf("/"); + + if (slashIndex === -1) { + throw configInvalidError(extendName, ctx.filePath, "plugin-invalid"); + } + + const pluginName = extendName.slice("plugin:".length, slashIndex); + const configName = extendName.slice(slashIndex + 1); + + if (isFilePath(pluginName)) { + throw new Error("'extends' cannot use a file path for plugins."); + } + + const plugin = this._loadPlugin(pluginName, ctx); + const configData = + plugin.definition && + plugin.definition.configs[configName]; + + if (configData) { + return this._normalizeConfigData(configData, { + ...ctx, + filePath: plugin.filePath || ctx.filePath, + name: `${ctx.name} » plugin:${plugin.id}/${configName}` + }); + } + + throw plugin.error || configInvalidError(extendName, ctx.filePath, "extend-config-missing"); + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtendedShareableConfig(extendName, ctx) { + const { cwd, resolver } = internalSlotsMap.get(this); + const relativeTo = ctx.filePath || path.join(cwd, "__placeholder__.js"); + let request; + + if (isFilePath(extendName)) { + request = extendName; + } else if (extendName.startsWith(".")) { + request = `./${extendName}`; // For backward compatibility. A ton of tests depended on this behavior. + } else { + request = naming.normalizePackageName( + extendName, + "eslint-config" + ); + } + + let filePath; + + try { + filePath = resolver.resolve(request, relativeTo); + } catch (error) { + /* istanbul ignore else */ + if (error && error.code === "MODULE_NOT_FOUND") { + throw configInvalidError(extendName, ctx.filePath, "extend-config-missing"); + } + throw error; + } + + writeDebugLogForLoading(request, relativeTo, filePath); + return this._loadConfigData({ + ...ctx, + filePath, + name: `${ctx.name} » ${request}` + }); + } + + /** + * Load given plugins. + * @param {string[]} names The plugin names to load. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {Record} The loaded parser. + * @private + */ + _loadPlugins(names, ctx) { + return names.reduce((map, name) => { + if (isFilePath(name)) { + throw new Error("Plugins array cannot includes file paths."); + } + const plugin = this._loadPlugin(name, ctx); + + map[plugin.id] = plugin; + + return map; + }, {}); + } + + /** + * Load a given parser. + * @param {string} nameOrPath The package name or the path to a parser file. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {DependentParser} The loaded parser. + */ + _loadParser(nameOrPath, ctx) { + debug("Loading parser %j from %s", nameOrPath, ctx.filePath); + + const { cwd, resolver } = internalSlotsMap.get(this); + const relativeTo = ctx.filePath || path.join(cwd, "__placeholder__.js"); + + try { + const filePath = resolver.resolve(nameOrPath, relativeTo); + + writeDebugLogForLoading(nameOrPath, relativeTo, filePath); + + return new ConfigDependency({ + definition: require(filePath), + filePath, + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } catch (error) { + + // If the parser name is "espree", load the espree of ESLint. + if (nameOrPath === "espree") { + debug("Fallback espree."); + return new ConfigDependency({ + definition: require("espree"), + filePath: require.resolve("espree"), + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + debug("Failed to load parser '%s' declared in '%s'.", nameOrPath, ctx.name); + error.message = `Failed to load parser '${nameOrPath}' declared in '${ctx.name}': ${error.message}`; + + return new ConfigDependency({ + error, + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + } + + /** + * Load a given plugin. + * @param {string} name The plugin name to load. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {DependentPlugin} The loaded plugin. + * @private + */ + _loadPlugin(name, ctx) { + debug("Loading plugin %j from %s", name, ctx.filePath); + + const { additionalPluginPool, resolver } = internalSlotsMap.get(this); + const request = naming.normalizePackageName(name, "eslint-plugin"); + const id = naming.getShorthandName(request, "eslint-plugin"); + const relativeTo = path.join(ctx.pluginBasePath, "__placeholder__.js"); + + if (name.match(/\s+/u)) { + const error = Object.assign( + new Error(`Whitespace found in plugin name '${name}'`), + { + messageTemplate: "whitespace-found", + messageData: { pluginName: request } + } + ); + + return new ConfigDependency({ + error, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + // Check for additional pool. + const plugin = + additionalPluginPool.get(request) || + additionalPluginPool.get(id); + + if (plugin) { + return new ConfigDependency({ + definition: normalizePlugin(plugin), + filePath: "", // It's unknown where the plugin came from. + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + let filePath; + let error; + + try { + filePath = resolver.resolve(request, relativeTo); + } catch (resolveError) { + error = resolveError; + /* istanbul ignore else */ + if (error && error.code === "MODULE_NOT_FOUND") { + error.messageTemplate = "plugin-missing"; + error.messageData = { + pluginName: request, + resolvePluginsRelativeTo: ctx.pluginBasePath, + importerName: ctx.name + }; + } + } + + if (filePath) { + try { + writeDebugLogForLoading(request, relativeTo, filePath); + + const startTime = Date.now(); + const pluginDefinition = require(filePath); + + debug(`Plugin ${filePath} loaded in: ${Date.now() - startTime}ms`); + + return new ConfigDependency({ + definition: normalizePlugin(pluginDefinition), + filePath, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } catch (loadError) { + error = loadError; + } + } + + debug("Failed to load plugin '%s' declared in '%s'.", name, ctx.name); + error.message = `Failed to load plugin '${name}' declared in '${ctx.name}': ${error.message}`; + return new ConfigDependency({ + error, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + /** + * Take file expression processors as config array elements. + * @param {Record} plugins The plugin definitions. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The config array elements of file expression processors. + * @private + */ + *_takeFileExtensionProcessors(plugins, ctx) { + for (const pluginId of Object.keys(plugins)) { + const processors = + plugins[pluginId] && + plugins[pluginId].definition && + plugins[pluginId].definition.processors; + + if (!processors) { + continue; + } + + for (const processorId of Object.keys(processors)) { + if (processorId.startsWith(".")) { + yield* this._normalizeObjectConfigData( + { + files: [`*${processorId}`], + processor: `${pluginId}/${processorId}` + }, + { + ...ctx, + type: "implicit-processor", + name: `${ctx.name}#processors["${pluginId}/${processorId}"]` + } + ); + } + } + } + } +} + +export { ConfigArrayFactory, createContext }; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/config-array.js b/node_modules/@eslint/eslintrc/lib/config-array/config-array.js new file mode 100644 index 000000000..133f5a242 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array/config-array.js @@ -0,0 +1,523 @@ +/** + * @fileoverview `ConfigArray` class. + * + * `ConfigArray` class expresses the full of a configuration. It has the entry + * config file, base config files that were extended, loaded parsers, and loaded + * plugins. + * + * `ConfigArray` class provides three properties and two methods. + * + * - `pluginEnvironments` + * - `pluginProcessors` + * - `pluginRules` + * The `Map` objects that contain the members of all plugins that this + * config array contains. Those map objects don't have mutation methods. + * Those keys are the member ID such as `pluginId/memberName`. + * - `isRoot()` + * If `true` then this configuration has `root:true` property. + * - `extractConfig(filePath)` + * Extract the final configuration for a given file. This means merging + * every config array element which that `criteria` property matched. The + * `filePath` argument must be an absolute path. + * + * `ConfigArrayFactory` provides the loading logic of config files. + * + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import { ExtractedConfig } from "./extracted-config.js"; +import { IgnorePattern } from "./ignore-pattern.js"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// Define types for VSCode IntelliSense. +/** @typedef {import("../../shared/types").Environment} Environment */ +/** @typedef {import("../../shared/types").GlobalConf} GlobalConf */ +/** @typedef {import("../../shared/types").RuleConf} RuleConf */ +/** @typedef {import("../../shared/types").Rule} Rule */ +/** @typedef {import("../../shared/types").Plugin} Plugin */ +/** @typedef {import("../../shared/types").Processor} Processor */ +/** @typedef {import("./config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-dependency").DependentPlugin} DependentPlugin */ +/** @typedef {import("./override-tester")["OverrideTester"]} OverrideTester */ + +/** + * @typedef {Object} ConfigArrayElement + * @property {string} name The name of this config element. + * @property {string} filePath The path to the source file of this config element. + * @property {InstanceType|null} criteria The tester for the `files` and `excludedFiles` of this config element. + * @property {Record|undefined} env The environment settings. + * @property {Record|undefined} globals The global variable settings. + * @property {IgnorePattern|undefined} ignorePattern The ignore patterns. + * @property {boolean|undefined} noInlineConfig The flag that disables directive comments. + * @property {DependentParser|undefined} parser The parser loader. + * @property {Object|undefined} parserOptions The parser options. + * @property {Record|undefined} plugins The plugin loaders. + * @property {string|undefined} processor The processor name to refer plugin's processor. + * @property {boolean|undefined} reportUnusedDisableDirectives The flag to report unused `eslint-disable` comments. + * @property {boolean|undefined} root The flag to express root. + * @property {Record|undefined} rules The rule settings + * @property {Object|undefined} settings The shared settings. + * @property {"config" | "ignore" | "implicit-processor"} type The element type. + */ + +/** + * @typedef {Object} ConfigArrayInternalSlots + * @property {Map} cache The cache to extract configs. + * @property {ReadonlyMap|null} envMap The map from environment ID to environment definition. + * @property {ReadonlyMap|null} processorMap The map from processor ID to environment definition. + * @property {ReadonlyMap|null} ruleMap The map from rule ID to rule definition. + */ + +/** @type {WeakMap} */ +const internalSlotsMap = new class extends WeakMap { + get(key) { + let value = super.get(key); + + if (!value) { + value = { + cache: new Map(), + envMap: null, + processorMap: null, + ruleMap: null + }; + super.set(key, value); + } + + return value; + } +}(); + +/** + * Get the indices which are matched to a given file. + * @param {ConfigArrayElement[]} elements The elements. + * @param {string} filePath The path to a target file. + * @returns {number[]} The indices. + */ +function getMatchedIndices(elements, filePath) { + const indices = []; + + for (let i = elements.length - 1; i >= 0; --i) { + const element = elements[i]; + + if (!element.criteria || (filePath && element.criteria.test(filePath))) { + indices.push(i); + } + } + + return indices; +} + +/** + * Check if a value is a non-null object. + * @param {any} x The value to check. + * @returns {boolean} `true` if the value is a non-null object. + */ +function isNonNullObject(x) { + return typeof x === "object" && x !== null; +} + +/** + * Merge two objects. + * + * Assign every property values of `y` to `x` if `x` doesn't have the property. + * If `x`'s property value is an object, it does recursive. + * @param {Object} target The destination to merge + * @param {Object|undefined} source The source to merge. + * @returns {void} + */ +function mergeWithoutOverwrite(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + + if (isNonNullObject(target[key])) { + mergeWithoutOverwrite(target[key], source[key]); + } else if (target[key] === void 0) { + if (isNonNullObject(source[key])) { + target[key] = Array.isArray(source[key]) ? [] : {}; + mergeWithoutOverwrite(target[key], source[key]); + } else if (source[key] !== void 0) { + target[key] = source[key]; + } + } + } +} + +/** + * The error for plugin conflicts. + */ +class PluginConflictError extends Error { + + /** + * Initialize this error object. + * @param {string} pluginId The plugin ID. + * @param {{filePath:string, importerName:string}[]} plugins The resolved plugins. + */ + constructor(pluginId, plugins) { + super(`Plugin "${pluginId}" was conflicted between ${plugins.map(p => `"${p.importerName}"`).join(" and ")}.`); + this.messageTemplate = "plugin-conflict"; + this.messageData = { pluginId, plugins }; + } +} + +/** + * Merge plugins. + * `target`'s definition is prior to `source`'s. + * @param {Record} target The destination to merge + * @param {Record|undefined} source The source to merge. + * @returns {void} + */ +function mergePlugins(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + const targetValue = target[key]; + const sourceValue = source[key]; + + // Adopt the plugin which was found at first. + if (targetValue === void 0) { + if (sourceValue.error) { + throw sourceValue.error; + } + target[key] = sourceValue; + } else if (sourceValue.filePath !== targetValue.filePath) { + throw new PluginConflictError(key, [ + { + filePath: targetValue.filePath, + importerName: targetValue.importerName + }, + { + filePath: sourceValue.filePath, + importerName: sourceValue.importerName + } + ]); + } + } +} + +/** + * Merge rule configs. + * `target`'s definition is prior to `source`'s. + * @param {Record} target The destination to merge + * @param {Record|undefined} source The source to merge. + * @returns {void} + */ +function mergeRuleConfigs(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + const targetDef = target[key]; + const sourceDef = source[key]; + + // Adopt the rule config which was found at first. + if (targetDef === void 0) { + if (Array.isArray(sourceDef)) { + target[key] = [...sourceDef]; + } else { + target[key] = [sourceDef]; + } + + /* + * If the first found rule config is severity only and the current rule + * config has options, merge the severity and the options. + */ + } else if ( + targetDef.length === 1 && + Array.isArray(sourceDef) && + sourceDef.length >= 2 + ) { + targetDef.push(...sourceDef.slice(1)); + } + } +} + +/** + * Create the extracted config. + * @param {ConfigArray} instance The config elements. + * @param {number[]} indices The indices to use. + * @returns {ExtractedConfig} The extracted config. + */ +function createConfig(instance, indices) { + const config = new ExtractedConfig(); + const ignorePatterns = []; + + // Merge elements. + for (const index of indices) { + const element = instance[index]; + + // Adopt the parser which was found at first. + if (!config.parser && element.parser) { + if (element.parser.error) { + throw element.parser.error; + } + config.parser = element.parser; + } + + // Adopt the processor which was found at first. + if (!config.processor && element.processor) { + config.processor = element.processor; + } + + // Adopt the noInlineConfig which was found at first. + if (config.noInlineConfig === void 0 && element.noInlineConfig !== void 0) { + config.noInlineConfig = element.noInlineConfig; + config.configNameOfNoInlineConfig = element.name; + } + + // Adopt the reportUnusedDisableDirectives which was found at first. + if (config.reportUnusedDisableDirectives === void 0 && element.reportUnusedDisableDirectives !== void 0) { + config.reportUnusedDisableDirectives = element.reportUnusedDisableDirectives; + } + + // Collect ignorePatterns + if (element.ignorePattern) { + ignorePatterns.push(element.ignorePattern); + } + + // Merge others. + mergeWithoutOverwrite(config.env, element.env); + mergeWithoutOverwrite(config.globals, element.globals); + mergeWithoutOverwrite(config.parserOptions, element.parserOptions); + mergeWithoutOverwrite(config.settings, element.settings); + mergePlugins(config.plugins, element.plugins); + mergeRuleConfigs(config.rules, element.rules); + } + + // Create the predicate function for ignore patterns. + if (ignorePatterns.length > 0) { + config.ignores = IgnorePattern.createIgnore(ignorePatterns.reverse()); + } + + return config; +} + +/** + * Collect definitions. + * @template T, U + * @param {string} pluginId The plugin ID for prefix. + * @param {Record} defs The definitions to collect. + * @param {Map} map The map to output. + * @param {function(T): U} [normalize] The normalize function for each value. + * @returns {void} + */ +function collect(pluginId, defs, map, normalize) { + if (defs) { + const prefix = pluginId && `${pluginId}/`; + + for (const [key, value] of Object.entries(defs)) { + map.set( + `${prefix}${key}`, + normalize ? normalize(value) : value + ); + } + } +} + +/** + * Normalize a rule definition. + * @param {Function|Rule} rule The rule definition to normalize. + * @returns {Rule} The normalized rule definition. + */ +function normalizePluginRule(rule) { + return typeof rule === "function" ? { create: rule } : rule; +} + +/** + * Delete the mutation methods from a given map. + * @param {Map} map The map object to delete. + * @returns {void} + */ +function deleteMutationMethods(map) { + Object.defineProperties(map, { + clear: { configurable: true, value: void 0 }, + delete: { configurable: true, value: void 0 }, + set: { configurable: true, value: void 0 } + }); +} + +/** + * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array. + * @param {ConfigArrayElement[]} elements The config elements. + * @param {ConfigArrayInternalSlots} slots The internal slots. + * @returns {void} + */ +function initPluginMemberMaps(elements, slots) { + const processed = new Set(); + + slots.envMap = new Map(); + slots.processorMap = new Map(); + slots.ruleMap = new Map(); + + for (const element of elements) { + if (!element.plugins) { + continue; + } + + for (const [pluginId, value] of Object.entries(element.plugins)) { + const plugin = value.definition; + + if (!plugin || processed.has(pluginId)) { + continue; + } + processed.add(pluginId); + + collect(pluginId, plugin.environments, slots.envMap); + collect(pluginId, plugin.processors, slots.processorMap); + collect(pluginId, plugin.rules, slots.ruleMap, normalizePluginRule); + } + } + + deleteMutationMethods(slots.envMap); + deleteMutationMethods(slots.processorMap); + deleteMutationMethods(slots.ruleMap); +} + +/** + * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array. + * @param {ConfigArray} instance The config elements. + * @returns {ConfigArrayInternalSlots} The extracted config. + */ +function ensurePluginMemberMaps(instance) { + const slots = internalSlotsMap.get(instance); + + if (!slots.ruleMap) { + initPluginMemberMaps(instance, slots); + } + + return slots; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The Config Array. + * + * `ConfigArray` instance contains all settings, parsers, and plugins. + * You need to call `ConfigArray#extractConfig(filePath)` method in order to + * extract, merge and get only the config data which is related to an arbitrary + * file. + * @extends {Array} + */ +class ConfigArray extends Array { + + /** + * Get the plugin environments. + * The returned map cannot be mutated. + * @type {ReadonlyMap} The plugin environments. + */ + get pluginEnvironments() { + return ensurePluginMemberMaps(this).envMap; + } + + /** + * Get the plugin processors. + * The returned map cannot be mutated. + * @type {ReadonlyMap} The plugin processors. + */ + get pluginProcessors() { + return ensurePluginMemberMaps(this).processorMap; + } + + /** + * Get the plugin rules. + * The returned map cannot be mutated. + * @returns {ReadonlyMap} The plugin rules. + */ + get pluginRules() { + return ensurePluginMemberMaps(this).ruleMap; + } + + /** + * Check if this config has `root` flag. + * @returns {boolean} `true` if this config array is root. + */ + isRoot() { + for (let i = this.length - 1; i >= 0; --i) { + const root = this[i].root; + + if (typeof root === "boolean") { + return root; + } + } + return false; + } + + /** + * Extract the config data which is related to a given file. + * @param {string} filePath The absolute path to the target file. + * @returns {ExtractedConfig} The extracted config data. + */ + extractConfig(filePath) { + const { cache } = internalSlotsMap.get(this); + const indices = getMatchedIndices(this, filePath); + const cacheKey = indices.join(","); + + if (!cache.has(cacheKey)) { + cache.set(cacheKey, createConfig(this, indices)); + } + + return cache.get(cacheKey); + } + + /** + * Check if a given path is an additional lint target. + * @param {string} filePath The absolute path to the target file. + * @returns {boolean} `true` if the file is an additional lint target. + */ + isAdditionalTargetPath(filePath) { + for (const { criteria, type } of this) { + if ( + type === "config" && + criteria && + !criteria.endsWithWildcard && + criteria.test(filePath) + ) { + return true; + } + } + return false; + } +} + +/** + * Get the used extracted configs. + * CLIEngine will use this method to collect used deprecated rules. + * @param {ConfigArray} instance The config array object to get. + * @returns {ExtractedConfig[]} The used extracted configs. + * @private + */ +function getUsedExtractedConfigs(instance) { + const { cache } = internalSlotsMap.get(instance); + + return Array.from(cache.values()); +} + + +export { + ConfigArray, + getUsedExtractedConfigs +}; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js b/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js new file mode 100644 index 000000000..2883c3a2a --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js @@ -0,0 +1,115 @@ +/** + * @fileoverview `ConfigDependency` class. + * + * `ConfigDependency` class expresses a loaded parser or plugin. + * + * If the parser or plugin was loaded successfully, it has `definition` property + * and `filePath` property. Otherwise, it has `error` property. + * + * When `JSON.stringify()` converted a `ConfigDependency` object to a JSON, it + * omits `definition` property. + * + * `ConfigArrayFactory` creates `ConfigDependency` objects when it loads parsers + * or plugins. + * + * @author Toru Nagashima + */ + +import util from "util"; + +/** + * The class is to store parsers or plugins. + * This class hides the loaded object from `JSON.stringify()` and `console.log`. + * @template T + */ +class ConfigDependency { + + /** + * Initialize this instance. + * @param {Object} data The dependency data. + * @param {T} [data.definition] The dependency if the loading succeeded. + * @param {Error} [data.error] The error object if the loading failed. + * @param {string} [data.filePath] The actual path to the dependency if the loading succeeded. + * @param {string} data.id The ID of this dependency. + * @param {string} data.importerName The name of the config file which loads this dependency. + * @param {string} data.importerPath The path to the config file which loads this dependency. + */ + constructor({ + definition = null, + error = null, + filePath = null, + id, + importerName, + importerPath + }) { + + /** + * The loaded dependency if the loading succeeded. + * @type {T|null} + */ + this.definition = definition; + + /** + * The error object if the loading failed. + * @type {Error|null} + */ + this.error = error; + + /** + * The loaded dependency if the loading succeeded. + * @type {string|null} + */ + this.filePath = filePath; + + /** + * The ID of this dependency. + * @type {string} + */ + this.id = id; + + /** + * The name of the config file which loads this dependency. + * @type {string} + */ + this.importerName = importerName; + + /** + * The path to the config file which loads this dependency. + * @type {string} + */ + this.importerPath = importerPath; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} a JSON compatible object. + */ + toJSON() { + const obj = this[util.inspect.custom](); + + // Display `error.message` (`Error#message` is unenumerable). + if (obj.error instanceof Error) { + obj.error = { ...obj.error, message: obj.error.message }; + } + + return obj; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} an object to display by `console.log()`. + */ + [util.inspect.custom]() { + const { + definition: _ignore, // eslint-disable-line no-unused-vars + ...obj + } = this; + + return obj; + } +} + +/** @typedef {ConfigDependency} DependentParser */ +/** @typedef {ConfigDependency} DependentPlugin */ + +export { ConfigDependency }; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js b/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js new file mode 100644 index 000000000..e93b0b67b --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js @@ -0,0 +1,145 @@ +/** + * @fileoverview `ExtractedConfig` class. + * + * `ExtractedConfig` class expresses a final configuration for a specific file. + * + * It provides one method. + * + * - `toCompatibleObjectAsConfigFileContent()` + * Convert this configuration to the compatible object as the content of + * config files. It converts the loaded parser and plugins to strings. + * `CLIEngine#getConfigForFile(filePath)` method uses this method. + * + * `ConfigArray#extractConfig(filePath)` creates a `ExtractedConfig` instance. + * + * @author Toru Nagashima + */ + +import { IgnorePattern } from "./ignore-pattern.js"; + +// For VSCode intellisense +/** @typedef {import("../../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../../shared/types").GlobalConf} GlobalConf */ +/** @typedef {import("../../shared/types").SeverityConf} SeverityConf */ +/** @typedef {import("./config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-dependency").DependentPlugin} DependentPlugin */ + +/** + * Check if `xs` starts with `ys`. + * @template T + * @param {T[]} xs The array to check. + * @param {T[]} ys The array that may be the first part of `xs`. + * @returns {boolean} `true` if `xs` starts with `ys`. + */ +function startsWith(xs, ys) { + return xs.length >= ys.length && ys.every((y, i) => y === xs[i]); +} + +/** + * The class for extracted config data. + */ +class ExtractedConfig { + constructor() { + + /** + * The config name what `noInlineConfig` setting came from. + * @type {string} + */ + this.configNameOfNoInlineConfig = ""; + + /** + * Environments. + * @type {Record} + */ + this.env = {}; + + /** + * Global variables. + * @type {Record} + */ + this.globals = {}; + + /** + * The glob patterns that ignore to lint. + * @type {(((filePath:string, dot?:boolean) => boolean) & { basePath:string; patterns:string[] }) | undefined} + */ + this.ignores = void 0; + + /** + * The flag that disables directive comments. + * @type {boolean|undefined} + */ + this.noInlineConfig = void 0; + + /** + * Parser definition. + * @type {DependentParser|null} + */ + this.parser = null; + + /** + * Options for the parser. + * @type {Object} + */ + this.parserOptions = {}; + + /** + * Plugin definitions. + * @type {Record} + */ + this.plugins = {}; + + /** + * Processor ID. + * @type {string|null} + */ + this.processor = null; + + /** + * The flag that reports unused `eslint-disable` directive comments. + * @type {boolean|undefined} + */ + this.reportUnusedDisableDirectives = void 0; + + /** + * Rule settings. + * @type {Record} + */ + this.rules = {}; + + /** + * Shared settings. + * @type {Object} + */ + this.settings = {}; + } + + /** + * Convert this config to the compatible object as a config file content. + * @returns {ConfigData} The converted object. + */ + toCompatibleObjectAsConfigFileContent() { + const { + /* eslint-disable no-unused-vars */ + configNameOfNoInlineConfig: _ignore1, + processor: _ignore2, + /* eslint-enable no-unused-vars */ + ignores, + ...config + } = this; + + config.parser = config.parser && config.parser.filePath; + config.plugins = Object.keys(config.plugins).filter(Boolean).reverse(); + config.ignorePatterns = ignores ? ignores.patterns : []; + + // Strip the default patterns from `ignorePatterns`. + if (startsWith(config.ignorePatterns, IgnorePattern.DefaultPatterns)) { + config.ignorePatterns = + config.ignorePatterns.slice(IgnorePattern.DefaultPatterns.length); + } + + return config; + } +} + +export { ExtractedConfig }; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js b/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js new file mode 100644 index 000000000..3022ba9f4 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js @@ -0,0 +1,238 @@ +/** + * @fileoverview `IgnorePattern` class. + * + * `IgnorePattern` class has the set of glob patterns and the base path. + * + * It provides two static methods. + * + * - `IgnorePattern.createDefaultIgnore(cwd)` + * Create the default predicate function. + * - `IgnorePattern.createIgnore(ignorePatterns)` + * Create the predicate function from multiple `IgnorePattern` objects. + * + * It provides two properties and a method. + * + * - `patterns` + * The glob patterns that ignore to lint. + * - `basePath` + * The base path of the glob patterns. If absolute paths existed in the + * glob patterns, those are handled as relative paths to the base path. + * - `getPatternsRelativeTo(basePath)` + * Get `patterns` as modified for a given base path. It modifies the + * absolute paths in the patterns as prepending the difference of two base + * paths. + * + * `ConfigArrayFactory` creates `IgnorePattern` objects when it processes + * `ignorePatterns` properties. + * + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import assert from "assert"; +import path from "path"; +import ignore from "ignore"; +import debugOrig from "debug"; + +const debug = debugOrig("eslintrc:ignore-pattern"); + +/** @typedef {ReturnType} Ignore */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the path to the common ancestor directory of given paths. + * @param {string[]} sourcePaths The paths to calculate the common ancestor. + * @returns {string} The path to the common ancestor directory. + */ +function getCommonAncestorPath(sourcePaths) { + let result = sourcePaths[0]; + + for (let i = 1; i < sourcePaths.length; ++i) { + const a = result; + const b = sourcePaths[i]; + + // Set the shorter one (it's the common ancestor if one includes the other). + result = a.length < b.length ? a : b; + + // Set the common ancestor. + for (let j = 0, lastSepPos = 0; j < a.length && j < b.length; ++j) { + if (a[j] !== b[j]) { + result = a.slice(0, lastSepPos); + break; + } + if (a[j] === path.sep) { + lastSepPos = j; + } + } + } + + let resolvedResult = result || path.sep; + + // if Windows common ancestor is root of drive must have trailing slash to be absolute. + if (resolvedResult && resolvedResult.endsWith(":") && process.platform === "win32") { + resolvedResult += path.sep; + } + return resolvedResult; +} + +/** + * Make relative path. + * @param {string} from The source path to get relative path. + * @param {string} to The destination path to get relative path. + * @returns {string} The relative path. + */ +function relative(from, to) { + const relPath = path.relative(from, to); + + if (path.sep === "/") { + return relPath; + } + return relPath.split(path.sep).join("/"); +} + +/** + * Get the trailing slash if existed. + * @param {string} filePath The path to check. + * @returns {string} The trailing slash if existed. + */ +function dirSuffix(filePath) { + const isDir = ( + filePath.endsWith(path.sep) || + (process.platform === "win32" && filePath.endsWith("/")) + ); + + return isDir ? "/" : ""; +} + +const DefaultPatterns = Object.freeze(["/**/node_modules/*"]); +const DotPatterns = Object.freeze([".*", "!.eslintrc.*", "!../"]); + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +class IgnorePattern { + + /** + * The default patterns. + * @type {string[]} + */ + static get DefaultPatterns() { + return DefaultPatterns; + } + + /** + * Create the default predicate function. + * @param {string} cwd The current working directory. + * @returns {((filePath:string, dot:boolean) => boolean) & {basePath:string; patterns:string[]}} + * The preficate function. + * The first argument is an absolute path that is checked. + * The second argument is the flag to not ignore dotfiles. + * If the predicate function returned `true`, it means the path should be ignored. + */ + static createDefaultIgnore(cwd) { + return this.createIgnore([new IgnorePattern(DefaultPatterns, cwd)]); + } + + /** + * Create the predicate function from multiple `IgnorePattern` objects. + * @param {IgnorePattern[]} ignorePatterns The list of ignore patterns. + * @returns {((filePath:string, dot?:boolean) => boolean) & {basePath:string; patterns:string[]}} + * The preficate function. + * The first argument is an absolute path that is checked. + * The second argument is the flag to not ignore dotfiles. + * If the predicate function returned `true`, it means the path should be ignored. + */ + static createIgnore(ignorePatterns) { + debug("Create with: %o", ignorePatterns); + + const basePath = getCommonAncestorPath(ignorePatterns.map(p => p.basePath)); + const patterns = [].concat( + ...ignorePatterns.map(p => p.getPatternsRelativeTo(basePath)) + ); + const ig = ignore({ allowRelativePaths: true }).add([...DotPatterns, ...patterns]); + const dotIg = ignore({ allowRelativePaths: true }).add(patterns); + + debug(" processed: %o", { basePath, patterns }); + + return Object.assign( + (filePath, dot = false) => { + assert(path.isAbsolute(filePath), "'filePath' should be an absolute path."); + const relPathRaw = relative(basePath, filePath); + const relPath = relPathRaw && (relPathRaw + dirSuffix(filePath)); + const adoptedIg = dot ? dotIg : ig; + const result = relPath !== "" && adoptedIg.ignores(relPath); + + debug("Check", { filePath, dot, relativePath: relPath, result }); + return result; + }, + { basePath, patterns } + ); + } + + /** + * Initialize a new `IgnorePattern` instance. + * @param {string[]} patterns The glob patterns that ignore to lint. + * @param {string} basePath The base path of `patterns`. + */ + constructor(patterns, basePath) { + assert(path.isAbsolute(basePath), "'basePath' should be an absolute path."); + + /** + * The glob patterns that ignore to lint. + * @type {string[]} + */ + this.patterns = patterns; + + /** + * The base path of `patterns`. + * @type {string} + */ + this.basePath = basePath; + + /** + * If `true` then patterns which don't start with `/` will match the paths to the outside of `basePath`. Defaults to `false`. + * + * It's set `true` for `.eslintignore`, `package.json`, and `--ignore-path` for backward compatibility. + * It's `false` as-is for `ignorePatterns` property in config files. + * @type {boolean} + */ + this.loose = false; + } + + /** + * Get `patterns` as modified for a given base path. It modifies the + * absolute paths in the patterns as prepending the difference of two base + * paths. + * @param {string} newBasePath The base path. + * @returns {string[]} Modifired patterns. + */ + getPatternsRelativeTo(newBasePath) { + assert(path.isAbsolute(newBasePath), "'newBasePath' should be an absolute path."); + const { basePath, loose, patterns } = this; + + if (newBasePath === basePath) { + return patterns; + } + const prefix = `/${relative(newBasePath, basePath)}`; + + return patterns.map(pattern => { + const negative = pattern.startsWith("!"); + const head = negative ? "!" : ""; + const body = negative ? pattern.slice(1) : pattern; + + if (body.startsWith("/") || body.startsWith("../")) { + return `${head}${prefix}${body}`; + } + return loose ? pattern : `${head}${prefix}/**/${body}`; + }); + } +} + +export { IgnorePattern }; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/index.js b/node_modules/@eslint/eslintrc/lib/config-array/index.js new file mode 100644 index 000000000..647f02b74 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array/index.js @@ -0,0 +1,19 @@ +/** + * @fileoverview `ConfigArray` class. + * @author Toru Nagashima + */ + +import { ConfigArray, getUsedExtractedConfigs } from "./config-array.js"; +import { ConfigDependency } from "./config-dependency.js"; +import { ExtractedConfig } from "./extracted-config.js"; +import { IgnorePattern } from "./ignore-pattern.js"; +import { OverrideTester } from "./override-tester.js"; + +export { + ConfigArray, + ConfigDependency, + ExtractedConfig, + IgnorePattern, + OverrideTester, + getUsedExtractedConfigs +}; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js b/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js new file mode 100644 index 000000000..460aafcf8 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js @@ -0,0 +1,225 @@ +/** + * @fileoverview `OverrideTester` class. + * + * `OverrideTester` class handles `files` property and `excludedFiles` property + * of `overrides` config. + * + * It provides one method. + * + * - `test(filePath)` + * Test if a file path matches the pair of `files` property and + * `excludedFiles` property. The `filePath` argument must be an absolute + * path. + * + * `ConfigArrayFactory` creates `OverrideTester` objects when it processes + * `overrides` properties. + * + * @author Toru Nagashima + */ + +import assert from "assert"; +import path from "path"; +import util from "util"; +import minimatch from "minimatch"; + +const { Minimatch } = minimatch; + +const minimatchOpts = { dot: true, matchBase: true }; + +/** + * @typedef {Object} Pattern + * @property {InstanceType[] | null} includes The positive matchers. + * @property {InstanceType[] | null} excludes The negative matchers. + */ + +/** + * Normalize a given pattern to an array. + * @param {string|string[]|undefined} patterns A glob pattern or an array of glob patterns. + * @returns {string[]|null} Normalized patterns. + * @private + */ +function normalizePatterns(patterns) { + if (Array.isArray(patterns)) { + return patterns.filter(Boolean); + } + if (typeof patterns === "string" && patterns) { + return [patterns]; + } + return []; +} + +/** + * Create the matchers of given patterns. + * @param {string[]} patterns The patterns. + * @returns {InstanceType[] | null} The matchers. + */ +function toMatcher(patterns) { + if (patterns.length === 0) { + return null; + } + return patterns.map(pattern => { + if (/^\.[/\\]/u.test(pattern)) { + return new Minimatch( + pattern.slice(2), + + // `./*.js` should not match with `subdir/foo.js` + { ...minimatchOpts, matchBase: false } + ); + } + return new Minimatch(pattern, minimatchOpts); + }); +} + +/** + * Convert a given matcher to string. + * @param {Pattern} matchers The matchers. + * @returns {string} The string expression of the matcher. + */ +function patternToJson({ includes, excludes }) { + return { + includes: includes && includes.map(m => m.pattern), + excludes: excludes && excludes.map(m => m.pattern) + }; +} + +/** + * The class to test given paths are matched by the patterns. + */ +class OverrideTester { + + /** + * Create a tester with given criteria. + * If there are no criteria, returns `null`. + * @param {string|string[]} files The glob patterns for included files. + * @param {string|string[]} excludedFiles The glob patterns for excluded files. + * @param {string} basePath The path to the base directory to test paths. + * @returns {OverrideTester|null} The created instance or `null`. + */ + static create(files, excludedFiles, basePath) { + const includePatterns = normalizePatterns(files); + const excludePatterns = normalizePatterns(excludedFiles); + let endsWithWildcard = false; + + if (includePatterns.length === 0) { + return null; + } + + // Rejects absolute paths or relative paths to parents. + for (const pattern of includePatterns) { + if (path.isAbsolute(pattern) || pattern.includes("..")) { + throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`); + } + if (pattern.endsWith("*")) { + endsWithWildcard = true; + } + } + for (const pattern of excludePatterns) { + if (path.isAbsolute(pattern) || pattern.includes("..")) { + throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`); + } + } + + const includes = toMatcher(includePatterns); + const excludes = toMatcher(excludePatterns); + + return new OverrideTester( + [{ includes, excludes }], + basePath, + endsWithWildcard + ); + } + + /** + * Combine two testers by logical and. + * If either of the testers was `null`, returns the other tester. + * The `basePath` property of the two must be the same value. + * @param {OverrideTester|null} a A tester. + * @param {OverrideTester|null} b Another tester. + * @returns {OverrideTester|null} Combined tester. + */ + static and(a, b) { + if (!b) { + return a && new OverrideTester( + a.patterns, + a.basePath, + a.endsWithWildcard + ); + } + if (!a) { + return new OverrideTester( + b.patterns, + b.basePath, + b.endsWithWildcard + ); + } + + assert.strictEqual(a.basePath, b.basePath); + return new OverrideTester( + a.patterns.concat(b.patterns), + a.basePath, + a.endsWithWildcard || b.endsWithWildcard + ); + } + + /** + * Initialize this instance. + * @param {Pattern[]} patterns The matchers. + * @param {string} basePath The base path. + * @param {boolean} endsWithWildcard If `true` then a pattern ends with `*`. + */ + constructor(patterns, basePath, endsWithWildcard = false) { + + /** @type {Pattern[]} */ + this.patterns = patterns; + + /** @type {string} */ + this.basePath = basePath; + + /** @type {boolean} */ + this.endsWithWildcard = endsWithWildcard; + } + + /** + * Test if a given path is matched or not. + * @param {string} filePath The absolute path to the target file. + * @returns {boolean} `true` if the path was matched. + */ + test(filePath) { + if (typeof filePath !== "string" || !path.isAbsolute(filePath)) { + throw new Error(`'filePath' should be an absolute path, but got ${filePath}.`); + } + const relativePath = path.relative(this.basePath, filePath); + + return this.patterns.every(({ includes, excludes }) => ( + (!includes || includes.some(m => m.match(relativePath))) && + (!excludes || !excludes.some(m => m.match(relativePath))) + )); + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} a JSON compatible object. + */ + toJSON() { + if (this.patterns.length === 1) { + return { + ...patternToJson(this.patterns[0]), + basePath: this.basePath + }; + } + return { + AND: this.patterns.map(patternToJson), + basePath: this.basePath + }; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} an object to display by `console.log()`. + */ + [util.inspect.custom]() { + return this.toJSON(); + } +} + +export { OverrideTester }; diff --git a/node_modules/@eslint/eslintrc/lib/flat-compat.js b/node_modules/@eslint/eslintrc/lib/flat-compat.js new file mode 100644 index 000000000..8df15a532 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/flat-compat.js @@ -0,0 +1,307 @@ +/** + * @fileoverview Compatibility class for flat config. + * @author Nicholas C. Zakas + */ + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +import createDebug from "debug"; +import path from "path"; + +import environments from "../conf/environments.js"; +import { ConfigArrayFactory } from "./config-array-factory.js"; + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/** @typedef {import("../../shared/types").Environment} Environment */ +/** @typedef {import("../../shared/types").Processor} Processor */ + +const debug = createDebug("eslintrc:flat-compat"); +const cafactory = Symbol("cafactory"); + +/** + * Translates an ESLintRC-style config object into a flag-config-style config + * object. + * @param {Object} eslintrcConfig An ESLintRC-style config object. + * @param {Object} options Options to help translate the config. + * @param {string} options.resolveConfigRelativeTo To the directory to resolve + * configs from. + * @param {string} options.resolvePluginsRelativeTo The directory to resolve + * plugins from. + * @param {ReadOnlyMap} options.pluginEnvironments A map of plugin environment + * names to objects. + * @param {ReadOnlyMap} options.pluginProcessors A map of plugin processor + * names to objects. + * @returns {Object} A flag-config-style config object. + */ +function translateESLintRC(eslintrcConfig, { + resolveConfigRelativeTo, + resolvePluginsRelativeTo, + pluginEnvironments, + pluginProcessors +}) { + + const flatConfig = {}; + const configs = []; + const languageOptions = {}; + const linterOptions = {}; + const keysToCopy = ["settings", "rules", "processor"]; + const languageOptionsKeysToCopy = ["globals", "parser", "parserOptions"]; + const linterOptionsKeysToCopy = ["noInlineConfig", "reportUnusedDisableDirectives"]; + + // check for special settings for eslint:all and eslint:recommended: + if (eslintrcConfig.settings) { + if (eslintrcConfig.settings["eslint:all"] === true) { + return ["eslint:all"]; + } + + if (eslintrcConfig.settings["eslint:recommended"] === true) { + return ["eslint:recommended"]; + } + } + + // copy over simple translations + for (const key of keysToCopy) { + if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") { + flatConfig[key] = eslintrcConfig[key]; + } + } + + // copy over languageOptions + for (const key of languageOptionsKeysToCopy) { + if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") { + + // create the languageOptions key in the flat config + flatConfig.languageOptions = languageOptions; + + if (key === "parser") { + debug(`Resolving parser '${languageOptions[key]}' relative to ${resolveConfigRelativeTo}`); + + if (eslintrcConfig[key].error) { + throw eslintrcConfig[key].error; + } + + languageOptions[key] = eslintrcConfig[key].definition; + continue; + } + + // clone any object values that are in the eslintrc config + if (eslintrcConfig[key] && typeof eslintrcConfig[key] === "object") { + languageOptions[key] = { + ...eslintrcConfig[key] + }; + } else { + languageOptions[key] = eslintrcConfig[key]; + } + } + } + + // copy over linterOptions + for (const key of linterOptionsKeysToCopy) { + if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") { + flatConfig.linterOptions = linterOptions; + linterOptions[key] = eslintrcConfig[key]; + } + } + + // move ecmaVersion a level up + if (languageOptions.parserOptions) { + + if ("ecmaVersion" in languageOptions.parserOptions) { + languageOptions.ecmaVersion = languageOptions.parserOptions.ecmaVersion; + delete languageOptions.parserOptions.ecmaVersion; + } + + if ("sourceType" in languageOptions.parserOptions) { + languageOptions.sourceType = languageOptions.parserOptions.sourceType; + delete languageOptions.parserOptions.sourceType; + } + + // check to see if we even need parserOptions anymore and remove it if not + if (Object.keys(languageOptions.parserOptions).length === 0) { + delete languageOptions.parserOptions; + } + } + + // overrides + if (eslintrcConfig.criteria) { + flatConfig.files = [absoluteFilePath => eslintrcConfig.criteria.test(absoluteFilePath)]; + } + + // translate plugins + if (eslintrcConfig.plugins && typeof eslintrcConfig.plugins === "object") { + debug(`Translating plugins: ${eslintrcConfig.plugins}`); + + flatConfig.plugins = {}; + + for (const pluginName of Object.keys(eslintrcConfig.plugins)) { + + debug(`Translating plugin: ${pluginName}`); + debug(`Resolving plugin '${pluginName} relative to ${resolvePluginsRelativeTo}`); + + const { definition: plugin, error } = eslintrcConfig.plugins[pluginName]; + + if (error) { + throw error; + } + + flatConfig.plugins[pluginName] = plugin; + + // create a config for any processors + if (plugin.processors) { + for (const processorName of Object.keys(plugin.processors)) { + if (processorName.startsWith(".")) { + debug(`Assigning processor: ${pluginName}/${processorName}`); + + configs.unshift({ + files: [`**/*${processorName}`], + processor: pluginProcessors.get(`${pluginName}/${processorName}`) + }); + } + + } + } + } + } + + // translate env - must come after plugins + if (eslintrcConfig.env && typeof eslintrcConfig.env === "object") { + for (const envName of Object.keys(eslintrcConfig.env)) { + + // only add environments that are true + if (eslintrcConfig.env[envName]) { + debug(`Translating environment: ${envName}`); + + if (environments.has(envName)) { + + // built-in environments should be defined first + configs.unshift(...translateESLintRC(environments.get(envName), { + resolveConfigRelativeTo, + resolvePluginsRelativeTo + })); + } else if (pluginEnvironments.has(envName)) { + + // if the environment comes from a plugin, it should come after the plugin config + configs.push(...translateESLintRC(pluginEnvironments.get(envName), { + resolveConfigRelativeTo, + resolvePluginsRelativeTo + })); + } + } + } + } + + // only add if there are actually keys in the config + if (Object.keys(flatConfig).length > 0) { + configs.push(flatConfig); + } + + return configs; +} + + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * A compatibility class for working with configs. + */ +class FlatCompat { + + constructor({ + baseDirectory = process.cwd(), + resolvePluginsRelativeTo = baseDirectory + } = {}) { + this.baseDirectory = baseDirectory; + this.resolvePluginsRelativeTo = resolvePluginsRelativeTo; + this[cafactory] = new ConfigArrayFactory({ + cwd: baseDirectory, + resolvePluginsRelativeTo, + getEslintAllConfig: () => ({ settings: { "eslint:all": true } }), + getEslintRecommendedConfig: () => ({ settings: { "eslint:recommended": true } }) + }); + } + + /** + * Translates an ESLintRC-style config into a flag-config-style config. + * @param {Object} eslintrcConfig The ESLintRC-style config object. + * @returns {Object} A flag-config-style config object. + */ + config(eslintrcConfig) { + const eslintrcArray = this[cafactory].create(eslintrcConfig, { + basePath: this.baseDirectory + }); + + const flatArray = []; + let hasIgnorePatterns = false; + + eslintrcArray.forEach(configData => { + if (configData.type === "config") { + hasIgnorePatterns = hasIgnorePatterns || configData.ignorePattern; + flatArray.push(...translateESLintRC(configData, { + resolveConfigRelativeTo: path.join(this.baseDirectory, "__placeholder.js"), + resolvePluginsRelativeTo: path.join(this.resolvePluginsRelativeTo, "__placeholder.js"), + pluginEnvironments: eslintrcArray.pluginEnvironments, + pluginProcessors: eslintrcArray.pluginProcessors + })); + } + }); + + // combine ignorePatterns to emulate ESLintRC behavior better + if (hasIgnorePatterns) { + flatArray.unshift({ + ignores: [filePath => { + + // Compute the final config for this file. + // This filters config array elements by `files`/`excludedFiles` then merges the elements. + const finalConfig = eslintrcArray.extractConfig(filePath); + + // Test the `ignorePattern` properties of the final config. + return Boolean(finalConfig.ignores) && finalConfig.ignores(filePath); + }] + }); + } + + return flatArray; + } + + /** + * Translates the `env` section of an ESLintRC-style config. + * @param {Object} envConfig The `env` section of an ESLintRC config. + * @returns {Object} A flag-config object representing the environments. + */ + env(envConfig) { + return this.config({ + env: envConfig + }); + } + + /** + * Translates the `extends` section of an ESLintRC-style config. + * @param {...string} configsToExtend The names of the configs to load. + * @returns {Object} A flag-config object representing the config. + */ + extends(...configsToExtend) { + return this.config({ + extends: configsToExtend + }); + } + + /** + * Translates the `plugins` section of an ESLintRC-style config. + * @param {...string} plugins The names of the plugins to load. + * @returns {Object} A flag-config object representing the plugins. + */ + plugins(...plugins) { + return this.config({ + plugins + }); + } +} + +export { FlatCompat }; diff --git a/node_modules/@eslint/eslintrc/lib/index-universal.js b/node_modules/@eslint/eslintrc/lib/index-universal.js new file mode 100644 index 000000000..6f6b30265 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/index-universal.js @@ -0,0 +1,29 @@ +/** + * @fileoverview Package exports for @eslint/eslintrc + * @author Nicholas C. Zakas + */ +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import * as ConfigOps from "./shared/config-ops.js"; +import ConfigValidator from "./shared/config-validator.js"; +import * as naming from "./shared/naming.js"; +import environments from "../conf/environments.js"; + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +const Legacy = { + environments, + + // shared + ConfigOps, + ConfigValidator, + naming +}; + +export { + Legacy +}; diff --git a/node_modules/@eslint/eslintrc/lib/index.js b/node_modules/@eslint/eslintrc/lib/index.js new file mode 100644 index 000000000..9e3d13f5f --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/index.js @@ -0,0 +1,56 @@ +/** + * @fileoverview Package exports for @eslint/eslintrc + * @author Nicholas C. Zakas + */ +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import { + ConfigArrayFactory, + createContext as createConfigArrayFactoryContext +} from "./config-array-factory.js"; + +import { CascadingConfigArrayFactory } from "./cascading-config-array-factory.js"; +import * as ModuleResolver from "./shared/relative-module-resolver.js"; +import { ConfigArray, getUsedExtractedConfigs } from "./config-array/index.js"; +import { ConfigDependency } from "./config-array/config-dependency.js"; +import { ExtractedConfig } from "./config-array/extracted-config.js"; +import { IgnorePattern } from "./config-array/ignore-pattern.js"; +import { OverrideTester } from "./config-array/override-tester.js"; +import * as ConfigOps from "./shared/config-ops.js"; +import ConfigValidator from "./shared/config-validator.js"; +import * as naming from "./shared/naming.js"; +import { FlatCompat } from "./flat-compat.js"; +import environments from "../conf/environments.js"; + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +const Legacy = { + ConfigArray, + createConfigArrayFactoryContext, + CascadingConfigArrayFactory, + ConfigArrayFactory, + ConfigDependency, + ExtractedConfig, + IgnorePattern, + OverrideTester, + getUsedExtractedConfigs, + environments, + + // shared + ConfigOps, + ConfigValidator, + ModuleResolver, + naming +}; + +export { + + Legacy, + + FlatCompat + +}; diff --git a/node_modules/@eslint/eslintrc/lib/shared/ajv.js b/node_modules/@eslint/eslintrc/lib/shared/ajv.js new file mode 100644 index 000000000..b79ad36c3 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/ajv.js @@ -0,0 +1,191 @@ +/** + * @fileoverview The instance of Ajv validator. + * @author Evgeny Poberezkin + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import Ajv from "ajv"; + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/* + * Copied from ajv/lib/refs/json-schema-draft-04.json + * The MIT License (MIT) + * Copyright (c) 2015-2017 Evgeny Poberezkin + */ +const metaSchema = { + id: "http://json-schema.org/draft-04/schema#", + $schema: "http://json-schema.org/draft-04/schema#", + description: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { $ref: "#" } + }, + positiveInteger: { + type: "integer", + minimum: 0 + }, + positiveIntegerDefault0: { + allOf: [{ $ref: "#/definitions/positiveInteger" }, { default: 0 }] + }, + simpleTypes: { + enum: ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + stringArray: { + type: "array", + items: { type: "string" }, + minItems: 1, + uniqueItems: true + } + }, + type: "object", + properties: { + id: { + type: "string" + }, + $schema: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: { }, + multipleOf: { + type: "number", + minimum: 0, + exclusiveMinimum: true + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { $ref: "#/definitions/positiveInteger" }, + minLength: { $ref: "#/definitions/positiveIntegerDefault0" }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + anyOf: [ + { type: "boolean" }, + { $ref: "#" } + ], + default: { } + }, + items: { + anyOf: [ + { $ref: "#" }, + { $ref: "#/definitions/schemaArray" } + ], + default: { } + }, + maxItems: { $ref: "#/definitions/positiveInteger" }, + minItems: { $ref: "#/definitions/positiveIntegerDefault0" }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { $ref: "#/definitions/positiveInteger" }, + minProperties: { $ref: "#/definitions/positiveIntegerDefault0" }, + required: { $ref: "#/definitions/stringArray" }, + additionalProperties: { + anyOf: [ + { type: "boolean" }, + { $ref: "#" } + ], + default: { } + }, + definitions: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + properties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + patternProperties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { $ref: "#" }, + { $ref: "#/definitions/stringArray" } + ] + } + }, + enum: { + type: "array", + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { $ref: "#/definitions/simpleTypes" }, + { + type: "array", + items: { $ref: "#/definitions/simpleTypes" }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { type: "string" }, + allOf: { $ref: "#/definitions/schemaArray" }, + anyOf: { $ref: "#/definitions/schemaArray" }, + oneOf: { $ref: "#/definitions/schemaArray" }, + not: { $ref: "#" } + }, + dependencies: { + exclusiveMaximum: ["maximum"], + exclusiveMinimum: ["minimum"] + }, + default: { } +}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +export default (additionalOptions = {}) => { + const ajv = new Ajv({ + meta: false, + useDefaults: true, + validateSchema: false, + missingRefs: "ignore", + verbose: true, + schemaId: "auto", + ...additionalOptions + }); + + ajv.addMetaSchema(metaSchema); + // eslint-disable-next-line no-underscore-dangle + ajv._opts.defaultMeta = metaSchema.id; + + return ajv; +}; diff --git a/node_modules/@eslint/eslintrc/lib/shared/config-ops.js b/node_modules/@eslint/eslintrc/lib/shared/config-ops.js new file mode 100644 index 000000000..d203be0e0 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/config-ops.js @@ -0,0 +1,135 @@ +/** + * @fileoverview Config file operations. This file must be usable in the browser, + * so no Node-specific code can be here. + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +const RULE_SEVERITY_STRINGS = ["off", "warn", "error"], + RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => { + map[value] = index; + return map; + }, {}), + VALID_SEVERITIES = [0, 1, 2, "off", "warn", "error"]; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Normalizes the severity value of a rule's configuration to a number + * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally + * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0), + * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array + * whose first element is one of the above values. Strings are matched case-insensitively. + * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0. + */ +function getRuleSeverity(ruleConfig) { + const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (severityValue === 0 || severityValue === 1 || severityValue === 2) { + return severityValue; + } + + if (typeof severityValue === "string") { + return RULE_SEVERITY[severityValue.toLowerCase()] || 0; + } + + return 0; +} + +/** + * Converts old-style severity settings (0, 1, 2) into new-style + * severity settings (off, warn, error) for all rules. Assumption is that severity + * values have already been validated as correct. + * @param {Object} config The config object to normalize. + * @returns {void} + */ +function normalizeToStrings(config) { + + if (config.rules) { + Object.keys(config.rules).forEach(ruleId => { + const ruleConfig = config.rules[ruleId]; + + if (typeof ruleConfig === "number") { + config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0]; + } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") { + ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0]; + } + }); + } +} + +/** + * Determines if the severity for the given rule configuration represents an error. + * @param {int|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} True if the rule represents an error, false if not. + */ +function isErrorSeverity(ruleConfig) { + return getRuleSeverity(ruleConfig) === 2; +} + +/** + * Checks whether a given config has valid severity or not. + * @param {number|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} `true` if the configuration has valid severity. + */ +function isValidSeverity(ruleConfig) { + let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (typeof severity === "string") { + severity = severity.toLowerCase(); + } + return VALID_SEVERITIES.indexOf(severity) !== -1; +} + +/** + * Checks whether every rule of a given config has valid severity or not. + * @param {Object} config The configuration for rules. + * @returns {boolean} `true` if the configuration has valid severity. + */ +function isEverySeverityValid(config) { + return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId])); +} + +/** + * Normalizes a value for a global in a config + * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in + * a global directive comment + * @returns {("readable"|"writeable"|"off")} The value normalized as a string + * @throws Error if global value is invalid + */ +function normalizeConfigGlobal(configuredValue) { + switch (configuredValue) { + case "off": + return "off"; + + case true: + case "true": + case "writeable": + case "writable": + return "writable"; + + case null: + case false: + case "false": + case "readable": + case "readonly": + return "readonly"; + + default: + throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`); + } +} + +export { + getRuleSeverity, + normalizeToStrings, + isErrorSeverity, + isValidSeverity, + isEverySeverityValid, + normalizeConfigGlobal +}; diff --git a/node_modules/@eslint/eslintrc/lib/shared/config-validator.js b/node_modules/@eslint/eslintrc/lib/shared/config-validator.js new file mode 100644 index 000000000..32174a56b --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/config-validator.js @@ -0,0 +1,325 @@ +/** + * @fileoverview Validates configs. + * @author Brandon Mills + */ + +/* eslint class-methods-use-this: "off" */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import util from "util"; +import * as ConfigOps from "./config-ops.js"; +import { emitDeprecationWarning } from "./deprecation-warnings.js"; +import ajvOrig from "./ajv.js"; +import configSchema from "../../conf/config-schema.js"; +import BuiltInEnvironments from "../../conf/environments.js"; + +const ajv = ajvOrig(); + +const ruleValidators = new WeakMap(); +const noop = Function.prototype; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ +let validateSchema; +const severityMap = { + error: 2, + warn: 1, + off: 0 +}; + +const validated = new WeakSet(); + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +export default class ConfigValidator { + constructor({ builtInRules = new Map() } = {}) { + this.builtInRules = builtInRules; + } + + /** + * Gets a complete options schema for a rule. + * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object + * @returns {Object} JSON Schema for the rule's options. + */ + getRuleOptionsSchema(rule) { + if (!rule) { + return null; + } + + const schema = rule.schema || rule.meta && rule.meta.schema; + + // Given a tuple of schemas, insert warning level at the beginning + if (Array.isArray(schema)) { + if (schema.length) { + return { + type: "array", + items: schema, + minItems: 0, + maxItems: schema.length + }; + } + return { + type: "array", + minItems: 0, + maxItems: 0 + }; + + } + + // Given a full schema, leave it alone + return schema || null; + } + + /** + * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid. + * @param {options} options The given options for the rule. + * @returns {number|string} The rule's severity value + */ + validateRuleSeverity(options) { + const severity = Array.isArray(options) ? options[0] : options; + const normSeverity = typeof severity === "string" ? severityMap[severity.toLowerCase()] : severity; + + if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) { + return normSeverity; + } + + throw new Error(`\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, "\"").replace(/\n/gu, "")}').\n`); + + } + + /** + * Validates the non-severity options passed to a rule, based on its schema. + * @param {{create: Function}} rule The rule to validate + * @param {Array} localOptions The options for the rule, excluding severity + * @returns {void} + */ + validateRuleSchema(rule, localOptions) { + if (!ruleValidators.has(rule)) { + const schema = this.getRuleOptionsSchema(rule); + + if (schema) { + ruleValidators.set(rule, ajv.compile(schema)); + } + } + + const validateRule = ruleValidators.get(rule); + + if (validateRule) { + validateRule(localOptions); + if (validateRule.errors) { + throw new Error(validateRule.errors.map( + error => `\tValue ${JSON.stringify(error.data)} ${error.message}.\n` + ).join("")); + } + } + } + + /** + * Validates a rule's options against its schema. + * @param {{create: Function}|null} rule The rule that the config is being validated for + * @param {string} ruleId The rule's unique name. + * @param {Array|number} options The given options for the rule. + * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined, + * no source is prepended to the message. + * @returns {void} + */ + validateRuleOptions(rule, ruleId, options, source = null) { + try { + const severity = this.validateRuleSeverity(options); + + if (severity !== 0) { + this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []); + } + } catch (err) { + const enhancedMessage = `Configuration for rule "${ruleId}" is invalid:\n${err.message}`; + + if (typeof source === "string") { + throw new Error(`${source}:\n\t${enhancedMessage}`); + } else { + throw new Error(enhancedMessage); + } + } + } + + /** + * Validates an environment object + * @param {Object} environment The environment config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded environments. + * @returns {void} + */ + validateEnvironment( + environment, + source, + getAdditionalEnv = noop + ) { + + // not having an environment is ok + if (!environment) { + return; + } + + Object.keys(environment).forEach(id => { + const env = getAdditionalEnv(id) || BuiltInEnvironments.get(id) || null; + + if (!env) { + const message = `${source}:\n\tEnvironment key "${id}" is unknown\n`; + + throw new Error(message); + } + }); + } + + /** + * Validates a rules config object + * @param {Object} rulesConfig The rules config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(ruleId:string): Object} getAdditionalRule A map from strings to loaded rules + * @returns {void} + */ + validateRules( + rulesConfig, + source, + getAdditionalRule = noop + ) { + if (!rulesConfig) { + return; + } + + Object.keys(rulesConfig).forEach(id => { + const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null; + + this.validateRuleOptions(rule, id, rulesConfig[id], source); + }); + } + + /** + * Validates a `globals` section of a config file + * @param {Object} globalsConfig The `globals` section + * @param {string|null} source The name of the configuration source to report in the event of an error. + * @returns {void} + */ + validateGlobals(globalsConfig, source = null) { + if (!globalsConfig) { + return; + } + + Object.entries(globalsConfig) + .forEach(([configuredGlobal, configuredValue]) => { + try { + ConfigOps.normalizeConfigGlobal(configuredValue); + } catch (err) { + throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\n${err.message}`); + } + }); + } + + /** + * Validate `processor` configuration. + * @param {string|undefined} processorName The processor name. + * @param {string} source The name of config file. + * @param {function(id:string): Processor} getProcessor The getter of defined processors. + * @returns {void} + */ + validateProcessor(processorName, source, getProcessor) { + if (processorName && !getProcessor(processorName)) { + throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`); + } + } + + /** + * Formats an array of schema validation errors. + * @param {Array} errors An array of error messages to format. + * @returns {string} Formatted error message + */ + formatErrors(errors) { + return errors.map(error => { + if (error.keyword === "additionalProperties") { + const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty; + + return `Unexpected top-level property "${formattedPropertyPath}"`; + } + if (error.keyword === "type") { + const formattedField = error.dataPath.slice(1); + const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join("/") : error.schema; + const formattedValue = JSON.stringify(error.data); + + return `Property "${formattedField}" is the wrong type (expected ${formattedExpectedType} but got \`${formattedValue}\`)`; + } + + const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath; + + return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`; + }).map(message => `\t- ${message}.\n`).join(""); + } + + /** + * Validates the top level properties of the config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @returns {void} + */ + validateConfigSchema(config, source = null) { + validateSchema = validateSchema || ajv.compile(configSchema); + + if (!validateSchema(config)) { + throw new Error(`ESLint configuration in ${source} is invalid:\n${this.formatErrors(validateSchema.errors)}`); + } + + if (Object.hasOwnProperty.call(config, "ecmaFeatures")) { + emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES"); + } + } + + /** + * Validates an entire config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(ruleId:string): Object} [getAdditionalRule] A map from strings to loaded rules. + * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded envs. + * @returns {void} + */ + validate(config, source, getAdditionalRule, getAdditionalEnv) { + this.validateConfigSchema(config, source); + this.validateRules(config.rules, source, getAdditionalRule); + this.validateEnvironment(config.env, source, getAdditionalEnv); + this.validateGlobals(config.globals, source); + + for (const override of config.overrides || []) { + this.validateRules(override.rules, source, getAdditionalRule); + this.validateEnvironment(override.env, source, getAdditionalEnv); + this.validateGlobals(config.globals, source); + } + } + + /** + * Validate config array object. + * @param {ConfigArray} configArray The config array to validate. + * @returns {void} + */ + validateConfigArray(configArray) { + const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments); + const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors); + const getPluginRule = Map.prototype.get.bind(configArray.pluginRules); + + // Validate. + for (const element of configArray) { + if (validated.has(element)) { + continue; + } + validated.add(element); + + this.validateEnvironment(element.env, element.name, getPluginEnv); + this.validateGlobals(element.globals, element.name); + this.validateProcessor(element.processor, element.name, getPluginProcessor); + this.validateRules(element.rules, element.name, getPluginRule); + } + } + +} diff --git a/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js b/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js new file mode 100644 index 000000000..91907b137 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js @@ -0,0 +1,63 @@ +/** + * @fileoverview Provide the function that emits deprecation warnings. + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import path from "path"; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +// Defitions for deprecation warnings. +const deprecationWarningMessages = { + ESLINT_LEGACY_ECMAFEATURES: + "The 'ecmaFeatures' config file property is deprecated and has no effect.", + ESLINT_PERSONAL_CONFIG_LOAD: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please use a config file per project or the '--config' option.", + ESLINT_PERSONAL_CONFIG_SUPPRESS: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please remove it or add 'root:true' to the config files in your " + + "projects in order to avoid loading '~/.eslintrc.*' accidentally." +}; + +const sourceFileErrorCache = new Set(); + +/** + * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted + * for each unique file path, but repeated invocations with the same file path have no effect. + * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active. + * @param {string} source The name of the configuration source to report the warning for. + * @param {string} errorCode The warning message to show. + * @returns {void} + */ +function emitDeprecationWarning(source, errorCode) { + const cacheKey = JSON.stringify({ source, errorCode }); + + if (sourceFileErrorCache.has(cacheKey)) { + return; + } + sourceFileErrorCache.add(cacheKey); + + const rel = path.relative(process.cwd(), source); + const message = deprecationWarningMessages[errorCode]; + + process.emitWarning( + `${message} (found in "${rel}")`, + "DeprecationWarning", + errorCode + ); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +export { + emitDeprecationWarning +}; diff --git a/node_modules/@eslint/eslintrc/lib/shared/naming.js b/node_modules/@eslint/eslintrc/lib/shared/naming.js new file mode 100644 index 000000000..93df5fc43 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/naming.js @@ -0,0 +1,96 @@ +/** + * @fileoverview Common helpers for naming of plugins, formatters and configs + */ + +const NAMESPACE_REGEX = /^@.*\//iu; + +/** + * Brings package name to correct format based on prefix + * @param {string} name The name of the package. + * @param {string} prefix Can be either "eslint-plugin", "eslint-config" or "eslint-formatter" + * @returns {string} Normalized name of the package + * @private + */ +function normalizePackageName(name, prefix) { + let normalizedName = name; + + /** + * On Windows, name can come in with Windows slashes instead of Unix slashes. + * Normalize to Unix first to avoid errors later on. + * https://github.com/eslint/eslint/issues/5644 + */ + if (normalizedName.includes("\\")) { + normalizedName = normalizedName.replace(/\\/gu, "/"); + } + + if (normalizedName.charAt(0) === "@") { + + /** + * it's a scoped package + * package name is the prefix, or just a username + */ + const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, "u"), + scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, "u"); + + if (scopedPackageShortcutRegex.test(normalizedName)) { + normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`); + } else if (!scopedPackageNameRegex.test(normalizedName.split("/")[1])) { + + /** + * for scoped packages, insert the prefix after the first / unless + * the path is already @scope/eslint or @scope/eslint-xxx-yyy + */ + normalizedName = normalizedName.replace(/^@([^/]+)\/(.*)$/u, `@$1/${prefix}-$2`); + } + } else if (!normalizedName.startsWith(`${prefix}-`)) { + normalizedName = `${prefix}-${normalizedName}`; + } + + return normalizedName; +} + +/** + * Removes the prefix from a fullname. + * @param {string} fullname The term which may have the prefix. + * @param {string} prefix The prefix to remove. + * @returns {string} The term without prefix. + */ +function getShorthandName(fullname, prefix) { + if (fullname[0] === "@") { + let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, "u").exec(fullname); + + if (matchResult) { + return matchResult[1]; + } + + matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, "u").exec(fullname); + if (matchResult) { + return `${matchResult[1]}/${matchResult[2]}`; + } + } else if (fullname.startsWith(`${prefix}-`)) { + return fullname.slice(prefix.length + 1); + } + + return fullname; +} + +/** + * Gets the scope (namespace) of a term. + * @param {string} term The term which may have the namespace. + * @returns {string} The namespace of the term if it has one. + */ +function getNamespaceFromTerm(term) { + const match = term.match(NAMESPACE_REGEX); + + return match ? match[0] : ""; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +export { + normalizePackageName, + getShorthandName, + getNamespaceFromTerm +}; diff --git a/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js b/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js new file mode 100644 index 000000000..1df0ca807 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js @@ -0,0 +1,42 @@ +/** + * Utility for resolving a module relative to another module + * @author Teddy Katz + */ + +import Module from "module"; + +/* + * `Module.createRequire` is added in v12.2.0. It supports URL as well. + * We only support the case where the argument is a filepath, not a URL. + */ +const createRequire = Module.createRequire; + +/** + * Resolves a Node module relative to another module + * @param {string} moduleName The name of a Node module, or a path to a Node module. + * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be + * a file rather than a directory, but the file need not actually exist. + * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath` + */ +function resolve(moduleName, relativeToPath) { + try { + return createRequire(relativeToPath).resolve(moduleName); + } catch (error) { + + // This `if` block is for older Node.js than 12.0.0. We can remove this block in the future. + if ( + typeof error === "object" && + error !== null && + error.code === "MODULE_NOT_FOUND" && + !error.requireStack && + error.message.includes(moduleName) + ) { + error.message += `\nRequire stack:\n- ${relativeToPath}`; + } + throw error; + } +} + +export { + resolve +}; diff --git a/node_modules/@eslint/eslintrc/lib/shared/types.js b/node_modules/@eslint/eslintrc/lib/shared/types.js new file mode 100644 index 000000000..a32c35e39 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/types.js @@ -0,0 +1,149 @@ +/** + * @fileoverview Define common types for input completion. + * @author Toru Nagashima + */ + +/** @type {any} */ +export default {}; + +/** @typedef {boolean | "off" | "readable" | "readonly" | "writable" | "writeable"} GlobalConf */ +/** @typedef {0 | 1 | 2 | "off" | "warn" | "error"} SeverityConf */ +/** @typedef {SeverityConf | [SeverityConf, ...any[]]} RuleConf */ + +/** + * @typedef {Object} EcmaFeatures + * @property {boolean} [globalReturn] Enabling `return` statements at the top-level. + * @property {boolean} [jsx] Enabling JSX syntax. + * @property {boolean} [impliedStrict] Enabling strict mode always. + */ + +/** + * @typedef {Object} ParserOptions + * @property {EcmaFeatures} [ecmaFeatures] The optional features. + * @property {3|5|6|7|8|9|10|11|12|2015|2016|2017|2018|2019|2020|2021} [ecmaVersion] The ECMAScript version (or revision number). + * @property {"script"|"module"} [sourceType] The source code type. + */ + +/** + * @typedef {Object} ConfigData + * @property {Record} [env] The environment settings. + * @property {string | string[]} [extends] The path to other config files or the package name of shareable configs. + * @property {Record} [globals] The global variable settings. + * @property {string | string[]} [ignorePatterns] The glob patterns that ignore to lint. + * @property {boolean} [noInlineConfig] The flag that disables directive comments. + * @property {OverrideConfigData[]} [overrides] The override settings per kind of files. + * @property {string} [parser] The path to a parser or the package name of a parser. + * @property {ParserOptions} [parserOptions] The parser options. + * @property {string[]} [plugins] The plugin specifiers. + * @property {string} [processor] The processor specifier. + * @property {boolean} [reportUnusedDisableDirectives] The flag to report unused `eslint-disable` comments. + * @property {boolean} [root] The root flag. + * @property {Record} [rules] The rule settings. + * @property {Object} [settings] The shared settings. + */ + +/** + * @typedef {Object} OverrideConfigData + * @property {Record} [env] The environment settings. + * @property {string | string[]} [excludedFiles] The glob pattarns for excluded files. + * @property {string | string[]} [extends] The path to other config files or the package name of shareable configs. + * @property {string | string[]} files The glob patterns for target files. + * @property {Record} [globals] The global variable settings. + * @property {boolean} [noInlineConfig] The flag that disables directive comments. + * @property {OverrideConfigData[]} [overrides] The override settings per kind of files. + * @property {string} [parser] The path to a parser or the package name of a parser. + * @property {ParserOptions} [parserOptions] The parser options. + * @property {string[]} [plugins] The plugin specifiers. + * @property {string} [processor] The processor specifier. + * @property {boolean} [reportUnusedDisableDirectives] The flag to report unused `eslint-disable` comments. + * @property {Record} [rules] The rule settings. + * @property {Object} [settings] The shared settings. + */ + +/** + * @typedef {Object} ParseResult + * @property {Object} ast The AST. + * @property {ScopeManager} [scopeManager] The scope manager of the AST. + * @property {Record} [services] The services that the parser provides. + * @property {Record} [visitorKeys] The visitor keys of the AST. + */ + +/** + * @typedef {Object} Parser + * @property {(text:string, options:ParserOptions) => Object} parse The definition of global variables. + * @property {(text:string, options:ParserOptions) => ParseResult} [parseForESLint] The parser options that will be enabled under this environment. + */ + +/** + * @typedef {Object} Environment + * @property {Record} [globals] The definition of global variables. + * @property {ParserOptions} [parserOptions] The parser options that will be enabled under this environment. + */ + +/** + * @typedef {Object} LintMessage + * @property {number} column The 1-based column number. + * @property {number} [endColumn] The 1-based column number of the end location. + * @property {number} [endLine] The 1-based line number of the end location. + * @property {boolean} fatal If `true` then this is a fatal error. + * @property {{range:[number,number], text:string}} [fix] Information for autofix. + * @property {number} line The 1-based line number. + * @property {string} message The error message. + * @property {string|null} ruleId The ID of the rule which makes this message. + * @property {0|1|2} severity The severity of this message. + * @property {Array<{desc?: string, messageId?: string, fix: {range: [number, number], text: string}}>} [suggestions] Information for suggestions. + */ + +/** + * @typedef {Object} SuggestionResult + * @property {string} desc A short description. + * @property {string} [messageId] Id referencing a message for the description. + * @property {{ text: string, range: number[] }} fix fix result info + */ + +/** + * @typedef {Object} Processor + * @property {(text:string, filename:string) => Array} [preprocess] The function to extract code blocks. + * @property {(messagesList:LintMessage[][], filename:string) => LintMessage[]} [postprocess] The function to merge messages. + * @property {boolean} [supportsAutofix] If `true` then it means the processor supports autofix. + */ + +/** + * @typedef {Object} RuleMetaDocs + * @property {string} category The category of the rule. + * @property {string} description The description of the rule. + * @property {boolean} recommended If `true` then the rule is included in `eslint:recommended` preset. + * @property {string} url The URL of the rule documentation. + */ + +/** + * @typedef {Object} RuleMeta + * @property {boolean} [deprecated] If `true` then the rule has been deprecated. + * @property {RuleMetaDocs} docs The document information of the rule. + * @property {"code"|"whitespace"} [fixable] The autofix type. + * @property {Record} [messages] The messages the rule reports. + * @property {string[]} [replacedBy] The IDs of the alternative rules. + * @property {Array|Object} schema The option schema of the rule. + * @property {"problem"|"suggestion"|"layout"} type The rule type. + */ + +/** + * @typedef {Object} Rule + * @property {Function} create The factory of the rule. + * @property {RuleMeta} meta The meta data of the rule. + */ + +/** + * @typedef {Object} Plugin + * @property {Record} [configs] The definition of plugin configs. + * @property {Record} [environments] The definition of plugin environments. + * @property {Record} [processors] The definition of plugin processors. + * @property {Record} [rules] The definition of plugin rules. + */ + +/** + * Information of deprecated rules. + * @typedef {Object} DeprecatedRuleInfo + * @property {string} ruleId The rule ID. + * @property {string[]} replacedBy The rule IDs that replace this deprecated rule. + */ diff --git a/node_modules/@eslint/eslintrc/package.json b/node_modules/@eslint/eslintrc/package.json new file mode 100644 index 000000000..ea8a18dcb --- /dev/null +++ b/node_modules/@eslint/eslintrc/package.json @@ -0,0 +1,82 @@ +{ + "name": "@eslint/eslintrc", + "version": "1.3.3", + "description": "The legacy ESLintRC config file format for ESLint", + "type": "module", + "main": "./dist/eslintrc.cjs", + "exports": { + ".": { + "import": "./lib/index.js", + "require": "./dist/eslintrc.cjs" + }, + "./package.json": "./package.json", + "./universal": { + "import": "./lib/index-universal.js", + "require": "./dist/eslintrc-universal.cjs" + } + }, + "files": [ + "lib", + "conf", + "LICENSE", + "dist", + "universal.js" + ], + "publishConfig": { + "access": "public" + }, + "scripts": { + "prepare": "npm run build", + "build": "rollup -c", + "lint": "eslint . --report-unused-disable-directives", + "fix": "npm run lint -- --fix", + "test": "mocha -R progress -c 'tests/lib/*.cjs' && c8 mocha -R progress -c 'tests/lib/**/*.js'", + "generate-release": "eslint-generate-release", + "generate-alpharelease": "eslint-generate-prerelease alpha", + "generate-betarelease": "eslint-generate-prerelease beta", + "generate-rcrelease": "eslint-generate-prerelease rc", + "publish-release": "eslint-publish-release" + }, + "repository": "eslint/eslintrc", + "funding": "https://opencollective.com/eslint", + "keywords": [ + "ESLint", + "ESLintRC", + "Configuration" + ], + "author": "Nicholas C. Zakas", + "license": "MIT", + "bugs": { + "url": "https://github.com/eslint/eslintrc/issues" + }, + "homepage": "https://github.com/eslint/eslintrc#readme", + "devDependencies": { + "c8": "^7.7.3", + "chai": "^4.3.4", + "eslint": "^7.31.0", + "eslint-config-eslint": "^7.0.0", + "eslint-plugin-jsdoc": "^35.4.1", + "eslint-plugin-node": "^11.1.0", + "eslint-release": "^3.2.0", + "fs-teardown": "^0.1.3", + "mocha": "^9.0.3", + "rollup": "^2.70.1", + "shelljs": "^0.8.4", + "sinon": "^11.1.2", + "temp-dir": "^2.0.0" + }, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.4.0", + "globals": "^13.15.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } +} diff --git a/node_modules/@eslint/eslintrc/universal.js b/node_modules/@eslint/eslintrc/universal.js new file mode 100644 index 000000000..4e1846ee6 --- /dev/null +++ b/node_modules/@eslint/eslintrc/universal.js @@ -0,0 +1,9 @@ +// Jest (and probably some other runtimes with custom implementations of +// `require`) doesn't support `exports` in `package.json`, so this file is here +// to help them load this module. Note that it is also `.js` and not `.cjs` for +// the same reason - `cjs` files requires to be loaded with an extension, but +// since Jest doesn't respect `module` outside of ESM mode it still works in +// this case (and the `require` in _this_ file does specify the extension). + +// eslint-disable-next-line no-undef +module.exports = require("./dist/eslintrc-universal.cjs"); diff --git a/node_modules/@humanwhocodes/config-array/CHANGELOG.md b/node_modules/@humanwhocodes/config-array/CHANGELOG.md new file mode 100644 index 000000000..f88dfc1b4 --- /dev/null +++ b/node_modules/@humanwhocodes/config-array/CHANGELOG.md @@ -0,0 +1,128 @@ +# Changelog + +## [0.10.7](https://github.com/humanwhocodes/config-array/compare/v0.10.6...v0.10.7) (2022-09-29) + + +### Bug Fixes + +* Cache negated patterns separately ([fef617b](https://github.com/humanwhocodes/config-array/commit/fef617b6999f9a4b5871d4525c82c4181bc96fb7)) + +## [0.10.6](https://github.com/humanwhocodes/config-array/compare/v0.10.5...v0.10.6) (2022-09-28) + + +### Performance Improvements + +* Cache Minimatch instances ([5cf9af7](https://github.com/humanwhocodes/config-array/commit/5cf9af7ecaf227d2106be0cebd92d7f5148867e6)) + +## [0.10.5](https://github.com/humanwhocodes/config-array/compare/v0.10.4...v0.10.5) (2022-09-21) + + +### Bug Fixes + +* Improve caching to improve performance ([#50](https://github.com/humanwhocodes/config-array/issues/50)) ([8a7e8ab](https://github.com/humanwhocodes/config-array/commit/8a7e8ab499bcbb10d7cbdd676197fc686966a64e)) + +### [0.10.4](https://www.github.com/humanwhocodes/config-array/compare/v0.10.3...v0.10.4) (2022-07-29) + + +### Bug Fixes + +* Global ignores only when no other keys ([1f6b6ae](https://www.github.com/humanwhocodes/config-array/commit/1f6b6ae89152c1ebe118f55e7ea05c37e7c960dc)) +* Re-introduce ignores fixes ([b3ec560](https://www.github.com/humanwhocodes/config-array/commit/b3ec560c485bec2f7420fd63a939448b49a073e3)) + +### [0.10.3](https://www.github.com/humanwhocodes/config-array/compare/v0.10.2...v0.10.3) (2022-07-20) + + +### Bug Fixes + +* Ensure preprocess method has correct 'this' value. ([f86933a](https://www.github.com/humanwhocodes/config-array/commit/f86933a072e5a4069bab2c1ce284dedf0efa715d)) + +### [0.10.2](https://www.github.com/humanwhocodes/config-array/compare/v0.10.1...v0.10.2) (2022-03-18) + + +### Bug Fixes + +* Files outside of basePath should be ignored ([fc4d7b2](https://www.github.com/humanwhocodes/config-array/commit/fc4d7b2e851959ab9ab84305f6c78c52e9cc2c3c)) + +### [0.10.1](https://www.github.com/humanwhocodes/config-array/compare/v0.10.0...v0.10.1) (2022-03-03) + + +### Bug Fixes + +* Explicit matching is required against files field ([ab4e428](https://www.github.com/humanwhocodes/config-array/commit/ab4e4282ecea994ef88d273dc47aa24bf3c6972e)) + +## [0.10.0](https://www.github.com/humanwhocodes/config-array/compare/v0.9.5...v0.10.0) (2022-03-01) + + +### Features + +* Add isExplicitMatch() method ([9ecd90e](https://www.github.com/humanwhocodes/config-array/commit/9ecd90e2a3e984633f535daa4da3cbfb96964fdd)) + +### [0.9.5](https://www.github.com/humanwhocodes/config-array/compare/v0.9.4...v0.9.5) (2022-02-23) + + +### Bug Fixes + +* Ensure dot directories are matched correctly ([6e8d180](https://www.github.com/humanwhocodes/config-array/commit/6e8d180f43cedf3c2072d8a1229470e9fafabf5b)) +* preprocessConfig should have correct 'this' value ([9641540](https://www.github.com/humanwhocodes/config-array/commit/96415402cf0012ccf8e4af6c7b934dfc1a058986)) + +### [0.9.4](https://www.github.com/humanwhocodes/config-array/compare/v0.9.3...v0.9.4) (2022-01-27) + + +### Bug Fixes + +* Negated patterns to work when files match ([398c811](https://www.github.com/humanwhocodes/config-array/commit/398c8119d359493dc7b82b40df4d92ea6528375f)) + +### [0.9.3](https://www.github.com/humanwhocodes/config-array/compare/v0.9.2...v0.9.3) (2022-01-26) + + +### Bug Fixes + +* Make negated ignore patterns work like gitignore ([4ee8e99](https://www.github.com/humanwhocodes/config-array/commit/4ee8e998436e2c4538b06476e0bead8a44fe5a1b)) + +### [0.9.2](https://www.github.com/humanwhocodes/config-array/compare/v0.9.1...v0.9.2) (2021-11-02) + + +### Bug Fixes + +* Object merging error by upgrading object-schema ([377d06d](https://www.github.com/humanwhocodes/config-array/commit/377d06d2a44d781b0bec70b3389c48b3d5a63f94)) + +### [0.9.1](https://www.github.com/humanwhocodes/config-array/compare/v0.9.0...v0.9.1) (2021-10-05) + + +### Bug Fixes + +* Properly build package for release ([168155f](https://www.github.com/humanwhocodes/config-array/commit/168155f3fed91ab35566c452efd28debf8ec2b85)) + +## [0.9.0](https://www.github.com/humanwhocodes/config-array/compare/v0.8.0...v0.9.0) (2021-10-04) + + +### Features + +* getConfig() now returns undefined when no configs match. ([a563b82](https://www.github.com/humanwhocodes/config-array/commit/a563b8255d4eb2bb7745314e3f00ef53792b343f)) + +## [0.8.0](https://www.github.com/humanwhocodes/config-array/compare/v0.7.0...v0.8.0) (2021-10-01) + + +### Features + +* Add isIgnored() method ([343e5a0](https://www.github.com/humanwhocodes/config-array/commit/343e5a0a9e32028bfc6c0bf1ec0c6badf74f47f9)) + + +### Bug Fixes + +* Ensure global ignores are honored ([343e5a0](https://www.github.com/humanwhocodes/config-array/commit/343e5a0a9e32028bfc6c0bf1ec0c6badf74f47f9)) + +## [0.7.0](https://www.github.com/humanwhocodes/config-array/compare/v0.6.0...v0.7.0) (2021-09-24) + + +### Features + +* Only object configs by default ([5645f24](https://www.github.com/humanwhocodes/config-array/commit/5645f241b2412a3263a02ef9e3a9bd19cc86035d)) + +## [0.6.0](https://www.github.com/humanwhocodes/config-array/compare/v0.5.0...v0.6.0) (2021-04-20) + + +### Features + +* Add the normalizeSync() method ([3e347f9](https://www.github.com/humanwhocodes/config-array/commit/3e347f9d77c5ca2b15995e75ff7bc4fb96b7d66e)) +* Allow async config functions ([a9def0f](https://www.github.com/humanwhocodes/config-array/commit/a9def0faf579c223349dfe08d2486756840538c3)) diff --git a/node_modules/@humanwhocodes/config-array/LICENSE b/node_modules/@humanwhocodes/config-array/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/node_modules/@humanwhocodes/config-array/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@humanwhocodes/config-array/README.md b/node_modules/@humanwhocodes/config-array/README.md new file mode 100644 index 000000000..3e24dfe6e --- /dev/null +++ b/node_modules/@humanwhocodes/config-array/README.md @@ -0,0 +1,310 @@ +# Config Array + +by [Nicholas C. Zakas](https://humanwhocodes.com) + +If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate). + +## Description + +A config array is a way of managing configurations that are based on glob pattern matching of filenames. Each config array contains the information needed to determine the correct configuration for any file based on the filename. + +## Background + +In 2019, I submitted an [ESLint RFC](https://github.com/eslint/rfcs/pull/9) proposing a new way of configuring ESLint. The goal was to streamline what had become an increasingly complicated configuration process. Over several iterations, this proposal was eventually born. + +The basic idea is that all configuration, including overrides, can be represented by a single array where each item in the array is a config object. Config objects appearing later in the array override config objects appearing earlier in the array. You can calculate a config for a given file by traversing all config objects in the array to find the ones that match the filename. Matching is done by specifying glob patterns in `files` and `ignores` properties on each config object. Here's an example: + +```js +export default [ + + // match all JSON files + { + name: "JSON Handler", + files: ["**/*.json"], + handler: jsonHandler + }, + + // match only package.json + { + name: "package.json Handler", + files: ["package.json"], + handler: packageJsonHandler + } +]; +``` + +In this example, there are two config objects: the first matches all JSON files in all directories and the second matches just `package.json` in the base path directory (all the globs are evaluated as relative to a base path that can be specified). When you retrieve a configuration for `foo.json`, only the first config object matches so `handler` is equal to `jsonHandler`; when you retrieve a configuration for `package.json`, `handler` is equal to `packageJsonHandler` (because both config objects match, the second one wins). + +## Installation + +You can install the package using npm or Yarn: + +```bash +npm install @humanwhocodes/config-array --save + +# or + +yarn add @humanwhocodes/config-array +``` + +## Usage + +First, import the `ConfigArray` constructor: + +```js +import { ConfigArray } from "@humanwhocodes/config-array"; + +// or using CommonJS + +const { ConfigArray } = require("@humanwhocodes/config-array"); +``` + +When you create a new instance of `ConfigArray`, you must pass in two arguments: an array of configs and an options object. The array of configs is most likely read in from a configuration file, so here's a typical example: + +```js +const configFilename = path.resolve(process.cwd(), "my.config.js"); +const { default: rawConfigs } = await import(configFilename); +const configs = new ConfigArray(rawConfigs, { + + // the path to match filenames from + basePath: process.cwd(), + + // additional items in each config + schema: mySchema +}); +``` + +This example reads in an object or array from `my.config.js` and passes it into the `ConfigArray` constructor as the first argument. The second argument is an object specifying the `basePath` (the directory in which `my.config.js` is found) and a `schema` to define the additional properties of a config object beyond `files`, `ignores`, and `name`. + +### Specifying a Schema + +The `schema` option is required for you to use additional properties in config objects. The schema is an object that follows the format of an [`ObjectSchema`](https://npmjs.com/package/@humanwhocodes/object-schema). The schema specifies both validation and merge rules that the `ConfigArray` instance needs to combine configs when there are multiple matches. Here's an example: + +```js +const configFilename = path.resolve(process.cwd(), "my.config.js"); +const { default: rawConfigs } = await import(configFilename); + +const mySchema = { + + // define the handler key in configs + handler: { + required: true, + merge(a, b) { + if (!b) return a; + if (!a) return b; + }, + validate(value) { + if (typeof value !== "function") { + throw new TypeError("Function expected."); + } + } + } +}; + +const configs = new ConfigArray(rawConfigs, { + + // the path to match filenames from + basePath: process.cwd(), + + // additional item schemas in each config + schema: mySchema, + + // additional config types supported (default: []) + extraConfigTypes: ["array", "function"]; +}); +``` + +### Config Arrays + +Config arrays can be multidimensional, so it's possible for a config array to contain another config array when `extraConfigTypes` contains `"array"`, such as: + +```js +export default [ + + // JS config + { + files: ["**/*.js"], + handler: jsHandler + }, + + // JSON configs + [ + + // match all JSON files + { + name: "JSON Handler", + files: ["**/*.json"], + handler: jsonHandler + }, + + // match only package.json + { + name: "package.json Handler", + files: ["package.json"], + handler: packageJsonHandler + } + ], + + // filename must match function + { + files: [ filePath => filePath.endsWith(".md") ], + handler: markdownHandler + }, + + // filename must match all patterns in subarray + { + files: [ ["*.test.*", "*.js"] ], + handler: jsTestHandler + }, + + // filename must not match patterns beginning with ! + { + name: "Non-JS files", + files: ["!*.js"], + settings: { + js: false + } + } +]; +``` + +In this example, the array contains both config objects and a config array. When a config array is normalized (see details below), it is flattened so only config objects remain. However, the order of evaluation remains the same. + +If the `files` array contains a function, then that function is called with the absolute path of the file and is expected to return `true` if there is a match and `false` if not. (The `ignores` array can also contain functions.) + +If the `files` array contains an item that is an array of strings and functions, then all patterns must match in order for the config to match. In the preceding examples, both `*.test.*` and `*.js` must match in order for the config object to be used. + +If a pattern in the files array begins with `!` then it excludes that pattern. In the preceding example, any filename that doesn't end with `.js` will automatically get a `settings.js` property set to `false`. + +You can also specify an `ignores` key that will force files matching those patterns to not be included. If the `ignores` key is in a config object without any other keys, then those ignores will always be applied; otherwise those ignores act as exclusions. Here's an example: + +```js +export default [ + + // Always ignored + { + ignores: ["**/.git/**", "**/node_modules/**"] + }, + + // .eslintrc.js file is ignored only when .js file matches + { + files: ["**/*.js"], + ignores: [".eslintrc.js"] + handler: jsHandler + } +]; +``` + +You can use negated patterns in `ignores` to exclude a file that was already ignored, such as: + +```js +export default [ + + // Ignore all JSON files except tsconfig.json + { + files: ["**/*"], + ignores: ["**/*.json", "!tsconfig.json"] + }, + +]; +``` + +### Config Functions + +Config arrays can also include config functions when `extraConfigTypes` contains `"function"`. A config function accepts a single parameter, `context` (defined by you), and must return either a config object or a config array (it cannot return another function). Config functions allow end users to execute code in the creation of appropriate config objects. Here's an example: + +```js +export default [ + + // JS config + { + files: ["**/*.js"], + handler: jsHandler + }, + + // JSON configs + function (context) { + return [ + + // match all JSON files + { + name: context.name + " JSON Handler", + files: ["**/*.json"], + handler: jsonHandler + }, + + // match only package.json + { + name: context.name + " package.json Handler", + files: ["package.json"], + handler: packageJsonHandler + } + ]; + } +]; +``` + +When a config array is normalized, each function is executed and replaced in the config array with the return value. + +**Note:** Config functions can also be async. + +### Normalizing Config Arrays + +Once a config array has been created and loaded with all of the raw config data, it must be normalized before it can be used. The normalization process goes through and flattens the config array as well as executing all config functions to get their final values. + +To normalize a config array, call the `normalize()` method and pass in a context object: + +```js +await configs.normalize({ + name: "MyApp" +}); +``` + +The `normalize()` method returns a promise, so be sure to use the `await` operator. The config array instance is normalized in-place, so you don't need to create a new variable. + +If you want to disallow async config functions, you can call `normalizeSync()` instead. This method is completely synchronous and does not require using the `await` operator as it does not return a promise: + +```js +await configs.normalizeSync({ + name: "MyApp" +}); +``` + +**Important:** Once a `ConfigArray` is normalized, it cannot be changed further. You can, however, create a new `ConfigArray` and pass in the normalized instance to create an unnormalized copy. + +### Getting Config for a File + +To get the config for a file, use the `getConfig()` method on a normalized config array and pass in the filename to get a config for: + +```js +// pass in absolute filename +const fileConfig = configs.getConfig(path.resolve(process.cwd(), "package.json")); +``` + +The config array always returns an object, even if there are no configs matching the given filename. You can then inspect the returned config object to determine how to proceed. + +A few things to keep in mind: + +* You must pass in the absolute filename to get a config for. +* The returned config object never has `files`, `ignores`, or `name` properties; the only properties on the object will be the other configuration options specified. +* The config array caches configs, so subsequent calls to `getConfig()` with the same filename will return in a fast lookup rather than another calculation. +* A config will only be generated if the filename matches an entry in a `files` key. A config will not be generated without matching a `files` key (configs without a `files` key are only applied when another config with a `files` key is applied; configs without `files` are never applied on their own). + +## Caching Mechanisms + +Each `ConfigArray` aggressively caches configuration objects to avoid unnecessary work. This caching occurs in two ways: + +1. **File-based Caching.** For each filename that is passed into a method, the resulting config is cached against that filename so you're always guaranteed to get the same object returned from `getConfig()` whenever you pass the same filename in. +2. **Index-based Caching.** Whenever a config is calculated, the config elements that were used to create the config are also cached. So if a given filename matches elements 1, 5, and 7, the resulting config is cached with a key of `1,5,7`. That way, if another file is passed that matches the same config elements, the result is already known and doesn't have to be recalculated. That means two files that match all the same elements will return the same config from `getConfig()`. + +## Acknowledgements + +The design of this project was influenced by feedback on the ESLint RFC, and incorporates ideas from: + +* Teddy Katz (@not-an-aardvark) +* Toru Nagashima (@mysticatea) +* Kai Cataldo (@kaicataldo) + +## License + +Apache 2.0 diff --git a/node_modules/@humanwhocodes/config-array/api.js b/node_modules/@humanwhocodes/config-array/api.js new file mode 100644 index 000000000..b0f4b707a --- /dev/null +++ b/node_modules/@humanwhocodes/config-array/api.js @@ -0,0 +1,808 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var path = _interopDefault(require('path')); +var minimatch = _interopDefault(require('minimatch')); +var createDebug = _interopDefault(require('debug')); +var objectSchema = require('@humanwhocodes/object-schema'); + +/** + * @fileoverview ConfigSchema + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Assets that a given value is an array. + * @param {*} value The value to check. + * @returns {void} + * @throws {TypeError} When the value is not an array. + */ +function assertIsArray(value) { + if (!Array.isArray(value)) { + throw new TypeError('Expected value to be an array.'); + } +} + +/** + * Assets that a given value is an array containing only strings and functions. + * @param {*} value The value to check. + * @returns {void} + * @throws {TypeError} When the value is not an array of strings and functions. + */ +function assertIsArrayOfStringsAndFunctions(value, name) { + assertIsArray(value); + + if (value.some(item => typeof item !== 'string' && typeof item !== 'function')) { + throw new TypeError('Expected array to only contain strings.'); + } +} + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The base schema that every ConfigArray uses. + * @type Object + */ +const baseSchema = Object.freeze({ + name: { + required: false, + merge() { + return undefined; + }, + validate(value) { + if (typeof value !== 'string') { + throw new TypeError('Property must be a string.'); + } + } + }, + files: { + required: false, + merge() { + return undefined; + }, + validate(value) { + + // first check if it's an array + assertIsArray(value); + + // then check each member + value.forEach(item => { + if (Array.isArray(item)) { + assertIsArrayOfStringsAndFunctions(item); + } else if (typeof item !== 'string' && typeof item !== 'function') { + throw new TypeError('Items must be a string, a function, or an array of strings and functions.'); + } + }); + + } + }, + ignores: { + required: false, + merge() { + return undefined; + }, + validate: assertIsArrayOfStringsAndFunctions + } +}); + +/** + * @fileoverview ConfigArray + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const Minimatch = minimatch.Minimatch; +const minimatchCache = new Map(); +const negatedMinimatchCache = new Map(); +const debug = createDebug('@hwc/config-array'); + +const MINIMATCH_OPTIONS = { + // matchBase: true, + dot: true +}; + +const CONFIG_TYPES = new Set(['array', 'function']); + +/** + * Shorthand for checking if a value is a string. + * @param {any} value The value to check. + * @returns {boolean} True if a string, false if not. + */ +function isString(value) { + return typeof value === 'string'; +} + +/** + * Wrapper around minimatch that caches minimatch patterns for + * faster matching speed over multiple file path evaluations. + * @param {string} filepath The file path to match. + * @param {string} pattern The glob pattern to match against. + * @param {object} options The minimatch options to use. + * @returns + */ +function doMatch(filepath, pattern, options) { + + let cache = minimatchCache; + + if (options.flipNegate) { + cache = negatedMinimatchCache; + } + + let matcher = cache.get(pattern); + + if (!matcher) { + matcher = new Minimatch(pattern, options); + cache.set(pattern, matcher); + } + + return matcher.match(filepath); +} + +/** + * Normalizes a `ConfigArray` by flattening it and executing any functions + * that are found inside. + * @param {Array} items The items in a `ConfigArray`. + * @param {Object} context The context object to pass into any function + * found. + * @param {Array} extraConfigTypes The config types to check. + * @returns {Promise} A flattened array containing only config objects. + * @throws {TypeError} When a config function returns a function. + */ +async function normalize(items, context, extraConfigTypes) { + + const allowFunctions = extraConfigTypes.includes('function'); + const allowArrays = extraConfigTypes.includes('array'); + + async function* flatTraverse(array) { + for (let item of array) { + if (typeof item === 'function') { + if (!allowFunctions) { + throw new TypeError('Unexpected function.'); + } + + item = item(context); + if (item.then) { + item = await item; + } + } + + if (Array.isArray(item)) { + if (!allowArrays) { + throw new TypeError('Unexpected array.'); + } + yield* flatTraverse(item); + } else if (typeof item === 'function') { + throw new TypeError('A config function can only return an object or array.'); + } else { + yield item; + } + } + } + + /* + * Async iterables cannot be used with the spread operator, so we need to manually + * create the array to return. + */ + const asyncIterable = await flatTraverse(items); + const configs = []; + + for await (const config of asyncIterable) { + configs.push(config); + } + + return configs; +} + +/** + * Normalizes a `ConfigArray` by flattening it and executing any functions + * that are found inside. + * @param {Array} items The items in a `ConfigArray`. + * @param {Object} context The context object to pass into any function + * found. + * @param {Array} extraConfigTypes The config types to check. + * @returns {Array} A flattened array containing only config objects. + * @throws {TypeError} When a config function returns a function. + */ +function normalizeSync(items, context, extraConfigTypes) { + + const allowFunctions = extraConfigTypes.includes('function'); + const allowArrays = extraConfigTypes.includes('array'); + + function* flatTraverse(array) { + for (let item of array) { + if (typeof item === 'function') { + + if (!allowFunctions) { + throw new TypeError('Unexpected function.'); + } + + item = item(context); + if (item.then) { + throw new TypeError('Async config functions are not supported.'); + } + } + + if (Array.isArray(item)) { + + if (!allowArrays) { + throw new TypeError('Unexpected array.'); + } + + yield* flatTraverse(item); + } else if (typeof item === 'function') { + throw new TypeError('A config function can only return an object or array.'); + } else { + yield item; + } + } + } + + return [...flatTraverse(items)]; +} + +/** + * Determines if a given file path should be ignored based on the given + * matcher. + * @param {Array boolean>} ignores The ignore patterns to check. + * @param {string} filePath The absolute path of the file to check. + * @param {string} relativeFilePath The relative path of the file to check. + * @returns {boolean} True if the path should be ignored and false if not. + */ +function shouldIgnoreFilePath(ignores, filePath, relativeFilePath) { + + // all files outside of the basePath are ignored + if (relativeFilePath.startsWith('..')) { + return true; + } + + let shouldIgnore = false; + + for (const matcher of ignores) { + + if (typeof matcher === 'function') { + shouldIgnore = shouldIgnore || matcher(filePath); + continue; + } + + /* + * If there's a negated pattern, that means anything matching + * must NOT be ignored. To do that, we need to use the `flipNegate` + * option for minimatch to check if the filepath matches the + * pattern specified after the !, and if that result is true, + * then we return false immediately because this file should + * never be ignored. + */ + if (matcher.startsWith('!')) { + + /* + * The file must already be ignored in order to apply a negated + * pattern, because negated patterns simply remove files that + * would already be ignored. + */ + if (shouldIgnore && + doMatch(relativeFilePath, matcher, { + ...MINIMATCH_OPTIONS, + flipNegate: true + })) { + return false; + } + } else { + shouldIgnore = shouldIgnore || doMatch(relativeFilePath, matcher, MINIMATCH_OPTIONS); + } + + } + + return shouldIgnore; +} + +/** + * Determines if a given file path is matched by a config. If the config + * has no `files` field, then it matches; otherwise, if a `files` field + * is present then we match the globs in `files` and exclude any globs in + * `ignores`. + * @param {string} filePath The absolute file path to check. + * @param {Object} config The config object to check. + * @returns {boolean} True if the file path is matched by the config, + * false if not. + */ +function pathMatches(filePath, basePath, config) { + + /* + * For both files and ignores, functions are passed the absolute + * file path while strings are compared against the relative + * file path. + */ + const relativeFilePath = path.relative(basePath, filePath); + + // if files isn't an array, throw an error + if (!Array.isArray(config.files) || config.files.length === 0) { + throw new TypeError('The files key must be a non-empty array.'); + } + + // match both strings and functions + const match = pattern => { + + if (isString(pattern)) { + return doMatch(relativeFilePath, pattern, MINIMATCH_OPTIONS); + } + + if (typeof pattern === 'function') { + return pattern(filePath); + } + + throw new TypeError(`Unexpected matcher type ${pattern}.`); + }; + + // check for all matches to config.files + let filePathMatchesPattern = config.files.some(pattern => { + if (Array.isArray(pattern)) { + return pattern.every(match); + } + + return match(pattern); + }); + + /* + * If the file path matches the config.files patterns, then check to see + * if there are any files to ignore. + */ + if (filePathMatchesPattern && config.ignores) { + filePathMatchesPattern = !shouldIgnoreFilePath(config.ignores, filePath, relativeFilePath); + } + + return filePathMatchesPattern; +} + +/** + * Ensures that a ConfigArray has been normalized. + * @param {ConfigArray} configArray The ConfigArray to check. + * @returns {void} + * @throws {Error} When the `ConfigArray` is not normalized. + */ +function assertNormalized(configArray) { + // TODO: Throw more verbose error + if (!configArray.isNormalized()) { + throw new Error('ConfigArray must be normalized to perform this operation.'); + } +} + +/** + * Ensures that config types are valid. + * @param {Array} extraConfigTypes The config types to check. + * @returns {void} + * @throws {Error} When the config types array is invalid. + */ +function assertExtraConfigTypes(extraConfigTypes) { + if (extraConfigTypes.length > 2) { + throw new TypeError('configTypes must be an array with at most two items.'); + } + + for (const configType of extraConfigTypes) { + if (!CONFIG_TYPES.has(configType)) { + throw new TypeError(`Unexpected config type "${configType}" found. Expected one of: "object", "array", "function".`); + } + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +const ConfigArraySymbol = { + isNormalized: Symbol('isNormalized'), + configCache: Symbol('configCache'), + schema: Symbol('schema'), + finalizeConfig: Symbol('finalizeConfig'), + preprocessConfig: Symbol('preprocessConfig') +}; + +// used to store calculate data for faster lookup +const dataCache = new WeakMap(); + +/** + * Represents an array of config objects and provides method for working with + * those config objects. + */ +class ConfigArray extends Array { + + /** + * Creates a new instance of ConfigArray. + * @param {Iterable|Function|Object} configs An iterable yielding config + * objects, or a config function, or a config object. + * @param {string} [options.basePath=""] The path of the config file + * @param {boolean} [options.normalized=false] Flag indicating if the + * configs have already been normalized. + * @param {Object} [options.schema] The additional schema + * definitions to use for the ConfigArray schema. + * @param {Array} [options.configTypes] List of config types supported. + */ + constructor(configs, { + basePath = '', + normalized = false, + schema: customSchema, + extraConfigTypes = [] + } = {} + ) { + super(); + + /** + * Tracks if the array has been normalized. + * @property isNormalized + * @type boolean + * @private + */ + this[ConfigArraySymbol.isNormalized] = normalized; + + /** + * The schema used for validating and merging configs. + * @property schema + * @type ObjectSchema + * @private + */ + this[ConfigArraySymbol.schema] = new objectSchema.ObjectSchema( + Object.assign({}, customSchema, baseSchema) + ); + + /** + * The path of the config file that this array was loaded from. + * This is used to calculate filename matches. + * @property basePath + * @type string + */ + this.basePath = basePath; + + assertExtraConfigTypes(extraConfigTypes); + + /** + * The supported config types. + * @property configTypes + * @type Array + */ + this.extraConfigTypes = Object.freeze([...extraConfigTypes]); + + /** + * A cache to store calculated configs for faster repeat lookup. + * @property configCache + * @type Map + * @private + */ + this[ConfigArraySymbol.configCache] = new Map(); + + // init cache + dataCache.set(this, { + explicitMatches: new Map() + }); + + // load the configs into this array + if (Array.isArray(configs)) { + this.push(...configs); + } else { + this.push(configs); + } + + } + + /** + * Prevent normal array methods from creating a new `ConfigArray` instance. + * This is to ensure that methods such as `slice()` won't try to create a + * new instance of `ConfigArray` behind the scenes as doing so may throw + * an error due to the different constructor signature. + * @returns {Function} The `Array` constructor. + */ + static get [Symbol.species]() { + return Array; + } + + /** + * Returns the `files` globs from every config object in the array. + * This can be used to determine which files will be matched by a + * config array or to use as a glob pattern when no patterns are provided + * for a command line interface. + * @returns {Array} An array of matchers. + */ + get files() { + + assertNormalized(this); + + // if this data has been cached, retrieve it + const cache = dataCache.get(this); + + if (cache.files) { + return cache.files; + } + + // otherwise calculate it + + const result = []; + + for (const config of this) { + if (config.files) { + config.files.forEach(filePattern => { + result.push(filePattern); + }); + } + } + + // store result + cache.files = result; + dataCache.set(this, cache); + + return result; + } + + /** + * Returns ignore matchers that should always be ignored regardless of + * the matching `files` fields in any configs. This is necessary to mimic + * the behavior of things like .gitignore and .eslintignore, allowing a + * globbing operation to be faster. + * @returns {string[]} An array of string patterns and functions to be ignored. + */ + get ignores() { + + assertNormalized(this); + + // if this data has been cached, retrieve it + const cache = dataCache.get(this); + + if (cache.ignores) { + return cache.ignores; + } + + // otherwise calculate it + + const result = []; + + for (const config of this) { + + /* + * We only count ignores if there are no other keys in the object. + * In this case, it acts list a globally ignored pattern. If there + * are additional keys, then ignores act like exclusions. + */ + if (config.ignores && Object.keys(config).length === 1) { + result.push(...config.ignores); + } + } + + // store result + cache.ignores = result; + dataCache.set(this, cache); + + return result; + } + + /** + * Indicates if the config array has been normalized. + * @returns {boolean} True if the config array is normalized, false if not. + */ + isNormalized() { + return this[ConfigArraySymbol.isNormalized]; + } + + /** + * Normalizes a config array by flattening embedded arrays and executing + * config functions. + * @param {ConfigContext} context The context object for config functions. + * @returns {Promise} The current ConfigArray instance. + */ + async normalize(context = {}) { + + if (!this.isNormalized()) { + const normalizedConfigs = await normalize(this, context, this.extraConfigTypes); + this.length = 0; + this.push(...normalizedConfigs.map(this[ConfigArraySymbol.preprocessConfig].bind(this))); + this[ConfigArraySymbol.isNormalized] = true; + + // prevent further changes + Object.freeze(this); + } + + return this; + } + + /** + * Normalizes a config array by flattening embedded arrays and executing + * config functions. + * @param {ConfigContext} context The context object for config functions. + * @returns {ConfigArray} The current ConfigArray instance. + */ + normalizeSync(context = {}) { + + if (!this.isNormalized()) { + const normalizedConfigs = normalizeSync(this, context, this.extraConfigTypes); + this.length = 0; + this.push(...normalizedConfigs.map(this[ConfigArraySymbol.preprocessConfig].bind(this))); + this[ConfigArraySymbol.isNormalized] = true; + + // prevent further changes + Object.freeze(this); + } + + return this; + } + + /** + * Finalizes the state of a config before being cached and returned by + * `getConfig()`. Does nothing by default but is provided to be + * overridden by subclasses as necessary. + * @param {Object} config The config to finalize. + * @returns {Object} The finalized config. + */ + [ConfigArraySymbol.finalizeConfig](config) { + return config; + } + + /** + * Preprocesses a config during the normalization process. This is the + * method to override if you want to convert an array item before it is + * validated for the first time. For example, if you want to replace a + * string with an object, this is the method to override. + * @param {Object} config The config to preprocess. + * @returns {Object} The config to use in place of the argument. + */ + [ConfigArraySymbol.preprocessConfig](config) { + return config; + } + + /** + * Determines if a given file path explicitly matches a `files` entry + * and also doesn't match an `ignores` entry. Configs that don't have + * a `files` property are not considered an explicit match. + * @param {string} filePath The complete path of a file to check. + * @returns {boolean} True if the file path matches a `files` entry + * or false if not. + */ + isExplicitMatch(filePath) { + + assertNormalized(this); + + const cache = dataCache.get(this); + + // first check the cache to avoid duplicate work + let result = cache.explicitMatches.get(filePath); + + if (typeof result == 'boolean') { + return result; + } + + // TODO: Maybe move elsewhere? Maybe combine with getConfig() logic? + const relativeFilePath = path.relative(this.basePath, filePath); + + if (shouldIgnoreFilePath(this.ignores, filePath, relativeFilePath)) { + debug(`Ignoring ${filePath}`); + + // cache and return result + cache.explicitMatches.set(filePath, false); + return false; + } + + // filePath isn't automatically ignored, so try to find a match + + for (const config of this) { + + if (!config.files) { + continue; + } + + if (pathMatches(filePath, this.basePath, config)) { + debug(`Matching config found for ${filePath}`); + cache.explicitMatches.set(filePath, true); + return true; + } + } + + return false; + } + + /** + * Returns the config object for a given file path. + * @param {string} filePath The complete path of a file to get a config for. + * @returns {Object} The config object for this file. + */ + getConfig(filePath) { + + assertNormalized(this); + + const cache = this[ConfigArraySymbol.configCache]; + + // first check the cache for a filename match to avoid duplicate work + let finalConfig = cache.get(filePath); + + if (finalConfig) { + return finalConfig; + } + + // next check to see if the file should be ignored + + // TODO: Maybe move elsewhere? + const relativeFilePath = path.relative(this.basePath, filePath); + + if (shouldIgnoreFilePath(this.ignores, filePath, relativeFilePath)) { + debug(`Ignoring ${filePath}`); + + // cache and return result - finalConfig is undefined at this point + cache.set(filePath, finalConfig); + return finalConfig; + } + + // filePath isn't automatically ignored, so try to construct config + + const matchingConfigIndices = []; + let matchFound = false; + + this.forEach((config, index) => { + + if (!config.files) { + debug(`Universal config found for ${filePath}`); + matchingConfigIndices.push(index); + return; + } + + if (pathMatches(filePath, this.basePath, config)) { + debug(`Matching config found for ${filePath}`); + matchingConfigIndices.push(index); + matchFound = true; + return; + } + + }); + + // if matching both files and ignores, there will be no config to create + if (!matchFound) { + debug(`No matching configs found for ${filePath}`); + + // cache and return result - finalConfig is undefined at this point + cache.set(filePath, finalConfig); + return finalConfig; + } + + // check to see if there is a config cached by indices + finalConfig = cache.get(matchingConfigIndices.toString()); + + if (finalConfig) { + + // also store for filename for faster lookup next time + cache.set(filePath, finalConfig); + + return finalConfig; + } + + // otherwise construct the config + + finalConfig = matchingConfigIndices.reduce((result, index) => { + return this[ConfigArraySymbol.schema].merge(result, this[index]); + }, {}, this); + + finalConfig = this[ConfigArraySymbol.finalizeConfig](finalConfig); + + cache.set(filePath, finalConfig); + cache.set(matchingConfigIndices.toString(), finalConfig); + + return finalConfig; + } + + /** + * Determines if the given filepath is ignored based on the configs. + * @param {string} filePath The complete path of a file to check. + * @returns {boolean} True if the path is ignored, false if not. + */ + isIgnored(filePath) { + return this.getConfig(filePath) === undefined; + } + +} + +exports.ConfigArray = ConfigArray; +exports.ConfigArraySymbol = ConfigArraySymbol; diff --git a/node_modules/@humanwhocodes/config-array/package.json b/node_modules/@humanwhocodes/config-array/package.json new file mode 100644 index 000000000..cedda5c69 --- /dev/null +++ b/node_modules/@humanwhocodes/config-array/package.json @@ -0,0 +1,60 @@ +{ + "name": "@humanwhocodes/config-array", + "version": "0.10.7", + "description": "Glob-based configuration matching.", + "author": "Nicholas C. Zakas", + "main": "api.js", + "files": [ + "api.js" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/humanwhocodes/config-array.git" + }, + "bugs": { + "url": "https://github.com/humanwhocodes/config-array/issues" + }, + "homepage": "https://github.com/humanwhocodes/config-array#readme", + "scripts": { + "build": "rollup -c", + "format": "nitpik", + "lint": "eslint *.config.js src/*.js tests/*.js", + "prepublish": "npm run build", + "test:coverage": "nyc --include src/*.js npm run test", + "test": "mocha -r esm tests/ --recursive" + }, + "gitHooks": { + "pre-commit": "lint-staged" + }, + "lint-staged": { + "*.js": [ + "eslint --fix --ignore-pattern '!.eslintrc.js'" + ] + }, + "keywords": [ + "configuration", + "configarray", + "config file" + ], + "license": "Apache-2.0", + "engines": { + "node": ">=10.10.0" + }, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "devDependencies": { + "@nitpik/javascript": "0.4.0", + "@nitpik/node": "0.0.5", + "chai": "4.2.0", + "eslint": "8.24.0", + "esm": "3.2.25", + "lint-staged": "13.0.3", + "mocha": "6.2.3", + "nyc": "14.1.1", + "rollup": "1.16.6", + "yorkie": "2.0.0" + } +} diff --git a/node_modules/@humanwhocodes/module-importer/CHANGELOG.md b/node_modules/@humanwhocodes/module-importer/CHANGELOG.md new file mode 100644 index 000000000..1b442a195 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/CHANGELOG.md @@ -0,0 +1,15 @@ +# Changelog + +## [1.0.1](https://github.com/humanwhocodes/module-importer/compare/v1.0.0...v1.0.1) (2022-08-18) + + +### Bug Fixes + +* Ensure CommonJS mode works correctly. ([cf54a0b](https://github.com/humanwhocodes/module-importer/commit/cf54a0b998085066fbe1776dd0b4cacd808cc192)), closes [#6](https://github.com/humanwhocodes/module-importer/issues/6) + +## 1.0.0 (2022-08-17) + + +### Features + +* Implement ModuleImporter ([3ce4e82](https://www.github.com/humanwhocodes/module-importer/commit/3ce4e820c30c114e787bfed00a0966ac4772f563)) diff --git a/node_modules/@humanwhocodes/module-importer/LICENSE b/node_modules/@humanwhocodes/module-importer/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@humanwhocodes/module-importer/README.md b/node_modules/@humanwhocodes/module-importer/README.md new file mode 100644 index 000000000..3de07a7fb --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/README.md @@ -0,0 +1,80 @@ +# ModuleImporter + +by [Nicholas C. Zakas](https://humanwhocodes.com) + +If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate). + +## Description + +A utility for seamlessly importing modules in Node.js regardless if they are CommonJS or ESM format. Under the hood, this uses `import()` and relies on Node.js's CommonJS compatibility to work correctly. This ensures that the correct locations and formats are used for CommonJS so you can call one method and not worry about any compatibility issues. + +The problem with the default `import()` is that it always resolves relative to the file location in which it is called. If you want to resolve from a different location, you need to jump through a few hoops to achieve that. This package makes it easy to both resolve and import modules from any directory. + +## Usage + +### Node.js + +Install using [npm][npm] or [yarn][yarn]: + +``` +npm install @humanwhocodes/module-importer + +# or + +yarn add @humanwhocodes/module-importer +``` + +Import into your Node.js project: + +```js +// CommonJS +const { ModuleImporter } = require("@humanwhocodes/module-importer"); + +// ESM +import { ModuleImporter } from "@humanwhocodes/module-importer"; +``` + +### Bun + +Install using this command: + +``` +bun add @humanwhocodes/module-importer +``` + +Import into your Bun project: + +```js +import { ModuleImporter } from "@humanwhocodes/module-importer"; +``` + +## API + +After importing, create a new instance of `ModuleImporter` to start emitting events: + +```js +// cwd can be omitted to use process.cwd() +const importer = new ModuleImporter(cwd); + +// you can resolve the location of any package +const location = importer.resolve("./some-file.cjs"); + +// you can also import directly +const module = importer.import("./some-file.cjs"); +``` + +For both `resolve()` and `import()`, you can pass in package names and filenames. + +## Developer Setup + +1. Fork the repository +2. Clone your fork +3. Run `npm install` to setup dependencies +4. Run `npm test` to run tests + +## License + +Apache 2.0 + +[npm]: https://npmjs.com/ +[yarn]: https://yarnpkg.com/ diff --git a/node_modules/@humanwhocodes/module-importer/dist/module-importer.cjs b/node_modules/@humanwhocodes/module-importer/dist/module-importer.cjs new file mode 100644 index 000000000..779e0cf6f --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/dist/module-importer.cjs @@ -0,0 +1,22 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var module$1 = require('module'); +var url = require('url'); +var path = require('path'); + +/** + * @fileoverview Universal module importer + */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('module-importer.cjs', document.baseURI).href))); +const __dirname$1 = path.dirname(__filename$1); +const require$1 = module$1.createRequire(__dirname$1 + "/"); +const { ModuleImporter } = require$1("./module-importer.cjs"); + +exports.ModuleImporter = ModuleImporter; diff --git a/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.cts b/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.cts new file mode 100644 index 000000000..a1acbb6d3 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.cts @@ -0,0 +1,27 @@ +export class ModuleImporter { + /** + * Creates a new instance. + * @param {string} [cwd] The current working directory to resolve from. + */ + constructor(cwd?: string); + /** + * The base directory from which paths should be resolved. + * @type {string} + */ + cwd: string; + /** + * Resolves a module based on its name or location. + * @param {string} specifier Either an npm package name or + * relative file path. + * @returns {string|undefined} The location of the import. + * @throws {Error} If specifier cannot be located. + */ + resolve(specifier: string): string | undefined; + /** + * Imports a module based on its name or location. + * @param {string} specifier Either an npm package name or + * relative file path. + * @returns {Promise} The module's object. + */ + import(specifier: string): Promise; +} diff --git a/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.ts b/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.ts new file mode 100644 index 000000000..498f0a246 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.ts @@ -0,0 +1,2 @@ +export { ModuleImporter }; +import { ModuleImporter } from "./module-importer.cjs"; diff --git a/node_modules/@humanwhocodes/module-importer/dist/module-importer.js b/node_modules/@humanwhocodes/module-importer/dist/module-importer.js new file mode 100644 index 000000000..26e052da1 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/dist/module-importer.js @@ -0,0 +1,18 @@ +import { createRequire } from 'module'; +import { fileURLToPath } from 'url'; +import { dirname } from 'path'; + +/** + * @fileoverview Universal module importer + */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const require = createRequire(__dirname + "/"); +const { ModuleImporter } = require("./module-importer.cjs"); + +export { ModuleImporter }; diff --git a/node_modules/@humanwhocodes/module-importer/package.json b/node_modules/@humanwhocodes/module-importer/package.json new file mode 100644 index 000000000..8ece071e9 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/package.json @@ -0,0 +1,65 @@ +{ + "name": "@humanwhocodes/module-importer", + "version": "1.0.1", + "description": "Universal module importer for Node.js", + "main": "src/module-importer.cjs", + "module": "src/module-importer.js", + "type": "module", + "types": "dist/module-importer.d.ts", + "exports": { + "require": "./src/module-importer.cjs", + "import": "./src/module-importer.js" + }, + "files": [ + "dist", + "src" + ], + "publishConfig": { + "access": "public" + }, + "gitHooks": { + "pre-commit": "lint-staged" + }, + "lint-staged": { + "*.js": [ + "eslint --fix" + ] + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + }, + "scripts": { + "build": "rollup -c && tsc", + "prepare": "npm run build", + "lint": "eslint src/ tests/", + "test:unit": "c8 mocha tests/module-importer.test.js", + "test:build": "node tests/pkg.test.cjs && node tests/pkg.test.mjs", + "test": "npm run test:unit && npm run test:build" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/humanwhocodes/module-importer.git" + }, + "keywords": [ + "modules", + "esm", + "commonjs" + ], + "engines": { + "node": ">=12.22" + }, + "author": "Nicholas C. Zaks", + "license": "Apache-2.0", + "devDependencies": { + "@types/node": "^18.7.6", + "c8": "7.12.0", + "chai": "4.3.6", + "eslint": "8.22.0", + "lint-staged": "13.0.3", + "mocha": "9.2.2", + "rollup": "2.78.0", + "typescript": "4.7.4", + "yorkie": "2.0.0" + } +} diff --git a/node_modules/@humanwhocodes/module-importer/src/module-importer.cjs b/node_modules/@humanwhocodes/module-importer/src/module-importer.cjs new file mode 100644 index 000000000..3efb095e1 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/src/module-importer.cjs @@ -0,0 +1,81 @@ +/** + * @fileoverview Universal module importer + */ + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + +const { createRequire } = require("module"); +const { pathToFileURL } = require("url"); + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const SLASHES = new Set(["/", "\\"]); + +/** + * Normalizes directories to have a trailing slash. + * Resolve is pretty finicky -- if the directory name doesn't have + * a trailing slash then it tries to look in the parent directory. + * i.e., if the directory is "/usr/nzakas/foo" it will start the + * search in /usr/nzakas. However, if the directory is "/user/nzakas/foo/", + * then it will start the search in /user/nzakas/foo. + * @param {string} directory The directory to check. + * @returns {string} The normalized directory. + */ +function normalizeDirectory(directory) { + if (!SLASHES.has(directory[directory.length-1])) { + return directory + "/"; + } + + return directory; +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * Class for importing both CommonJS and ESM modules in Node.js. + */ +exports.ModuleImporter = class ModuleImporter { + + /** + * Creates a new instance. + * @param {string} [cwd] The current working directory to resolve from. + */ + constructor(cwd = process.cwd()) { + + /** + * The base directory from which paths should be resolved. + * @type {string} + */ + this.cwd = normalizeDirectory(cwd); + } + + /** + * Resolves a module based on its name or location. + * @param {string} specifier Either an npm package name or + * relative file path. + * @returns {string|undefined} The location of the import. + * @throws {Error} If specifier cannot be located. + */ + resolve(specifier) { + const require = createRequire(this.cwd); + return require.resolve(specifier); + } + + /** + * Imports a module based on its name or location. + * @param {string} specifier Either an npm package name or + * relative file path. + * @returns {Promise} The module's object. + */ + import(specifier) { + const location = this.resolve(specifier); + return import(pathToFileURL(location).href); + } + +} diff --git a/node_modules/@humanwhocodes/module-importer/src/module-importer.js b/node_modules/@humanwhocodes/module-importer/src/module-importer.js new file mode 100644 index 000000000..f5464e18d --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/src/module-importer.js @@ -0,0 +1,22 @@ +/** + * @fileoverview Universal module importer + */ + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + +import { createRequire } from "module"; +import { fileURLToPath } from "url"; +import { dirname } from "path"; + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const require = createRequire(__dirname + "/"); +const { ModuleImporter } = require("./module-importer.cjs"); + +export { ModuleImporter }; diff --git a/node_modules/@humanwhocodes/object-schema/.eslintrc.js b/node_modules/@humanwhocodes/object-schema/.eslintrc.js new file mode 100644 index 000000000..4934076c4 --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/.eslintrc.js @@ -0,0 +1,29 @@ +module.exports = { + "env": { + "commonjs": true, + "es6": true, + "node": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": 2018 + }, + "rules": { + "indent": [ + "error", + 4 + ], + "linebreak-style": [ + "error", + "unix" + ], + "quotes": [ + "error", + "double" + ], + "semi": [ + "error", + "always" + ] + } +}; \ No newline at end of file diff --git a/node_modules/@humanwhocodes/object-schema/.github/workflows/nodejs-test.yml b/node_modules/@humanwhocodes/object-schema/.github/workflows/nodejs-test.yml new file mode 100644 index 000000000..8ea195146 --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/.github/workflows/nodejs-test.yml @@ -0,0 +1,27 @@ +name: Node CI + +on: [push, pull_request] + +jobs: + build: + + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [windows-latest, macOS-latest, ubuntu-latest] + node: [8.x, 10.x, 12.x, 14.x] + + steps: + - uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: npm install, build, and test + run: | + npm install + npm run build --if-present + npm test + env: + CI: true diff --git a/node_modules/@humanwhocodes/object-schema/.github/workflows/release-please.yml b/node_modules/@humanwhocodes/object-schema/.github/workflows/release-please.yml new file mode 100644 index 000000000..42f75f73c --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/.github/workflows/release-please.yml @@ -0,0 +1,39 @@ +on: + push: + branches: + - main +name: release-please +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: GoogleCloudPlatform/release-please-action@v2 + id: release + with: + release-type: node + package-name: test-release-please + # The logic below handles the npm publication: + - uses: actions/checkout@v2 + # these if statements ensure that a publication only occurs when + # a new release is created: + if: ${{ steps.release.outputs.release_created }} + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: 'https://registry.npmjs.org' + if: ${{ steps.release.outputs.release_created }} + - run: npm ci + if: ${{ steps.release.outputs.release_created }} + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + if: ${{ steps.release.outputs.release_created }} + + # Tweets out release announcement + - run: 'npx @humanwhocodes/tweet "Object Schema v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} has been released!\n\n${{ github.event.release.html_url }}"' + if: ${{ steps.release.outputs.release_created }} + env: + TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }} + TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }} + TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }} + TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} diff --git a/node_modules/@humanwhocodes/object-schema/CHANGELOG.md b/node_modules/@humanwhocodes/object-schema/CHANGELOG.md new file mode 100644 index 000000000..bb63f5fea --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +### [1.2.1](https://www.github.com/humanwhocodes/object-schema/compare/v1.2.0...v1.2.1) (2021-11-02) + + +### Bug Fixes + +* Never return original object from individual config ([5463c5c](https://www.github.com/humanwhocodes/object-schema/commit/5463c5c6d2cb35a7b7948dffc37c899a41d1775f)) diff --git a/node_modules/@humanwhocodes/object-schema/LICENSE b/node_modules/@humanwhocodes/object-schema/LICENSE new file mode 100644 index 000000000..a5e3ae46f --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2019, Human Who Codes +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/@humanwhocodes/object-schema/README.md b/node_modules/@humanwhocodes/object-schema/README.md new file mode 100644 index 000000000..2163797f8 --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/README.md @@ -0,0 +1,234 @@ +# JavaScript ObjectSchema Package + +by [Nicholas C. Zakas](https://humanwhocodes.com) + +If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate). + +## Overview + +A JavaScript object merge/validation utility where you can define a different merge and validation strategy for each key. This is helpful when you need to validate complex data structures and then merge them in a way that is more complex than `Object.assign()`. + +## Installation + +You can install using either npm: + +``` +npm install @humanwhocodes/object-schema +``` + +Or Yarn: + +``` +yarn add @humanwhocodes/object-schema +``` + +## Usage + +Use CommonJS to get access to the `ObjectSchema` constructor: + +```js +const { ObjectSchema } = require("@humanwhocodes/object-schema"); + +const schema = new ObjectSchema({ + + // define a definition for the "downloads" key + downloads: { + required: true, + merge(value1, value2) { + return value1 + value2; + }, + validate(value) { + if (typeof value !== "number") { + throw new Error("Expected downloads to be a number."); + } + } + }, + + // define a strategy for the "versions" key + version: { + required: true, + merge(value1, value2) { + return value1.concat(value2); + }, + validate(value) { + if (!Array.isArray(value)) { + throw new Error("Expected versions to be an array."); + } + } + } +}); + +const record1 = { + downloads: 25, + versions: [ + "v1.0.0", + "v1.1.0", + "v1.2.0" + ] +}; + +const record2 = { + downloads: 125, + versions: [ + "v2.0.0", + "v2.1.0", + "v3.0.0" + ] +}; + +// make sure the records are valid +schema.validate(record1); +schema.validate(record2); + +// merge together (schema.merge() accepts any number of objects) +const result = schema.merge(record1, record2); + +// result looks like this: + +const result = { + downloads: 75, + versions: [ + "v1.0.0", + "v1.1.0", + "v1.2.0", + "v2.0.0", + "v2.1.0", + "v3.0.0" + ] +}; +``` + +## Tips and Tricks + +### Named merge strategies + +Instead of specifying a `merge()` method, you can specify one of the following strings to use a default merge strategy: + +* `"assign"` - use `Object.assign()` to merge the two values into one object. +* `"overwrite"` - the second value always replaces the first. +* `"replace"` - the second value replaces the first if the second is not `undefined`. + +For example: + +```js +const schema = new ObjectSchema({ + name: { + merge: "replace", + validate() {} + } +}); +``` + +### Named validation strategies + +Instead of specifying a `validate()` method, you can specify one of the following strings to use a default validation strategy: + +* `"array"` - value must be an array. +* `"boolean"` - value must be a boolean. +* `"number"` - value must be a number. +* `"object"` - value must be an object. +* `"object?"` - value must be an object or null. +* `"string"` - value must be a string. +* `"string!"` - value must be a non-empty string. + +For example: + +```js +const schema = new ObjectSchema({ + name: { + merge: "replace", + validate: "string" + } +}); +``` + +### Subschemas + +If you are defining a key that is, itself, an object, you can simplify the process by using a subschema. Instead of defining `merge()` and `validate()`, assign a `schema` key that contains a schema definition, like this: + +```js +const schema = new ObjectSchema({ + name: { + schema: { + first: { + merge: "replace", + validate: "string" + }, + last: { + merge: "replace", + validate: "string" + } + } + } +}); + +schema.validate({ + name: { + first: "n", + last: "z" + } +}); +``` + +### Remove Keys During Merge + +If the merge strategy for a key returns `undefined`, then the key will not appear in the final object. For example: + +```js +const schema = new ObjectSchema({ + date: { + merge() { + return undefined; + }, + validate(value) { + Date.parse(value); // throws an error when invalid + } + } +}); + +const object1 = { date: "5/5/2005" }; +const object2 = { date: "6/6/2006" }; + +const result = schema.merge(object1, object2); + +console.log("date" in result); // false +``` + +### Requiring Another Key Be Present + +If you'd like the presence of one key to require the presence of another key, you can use the `requires` property to specify an array of other properties that any key requires. For example: + +```js +const schema = new ObjectSchema(); + +const schema = new ObjectSchema({ + date: { + merge() { + return undefined; + }, + validate(value) { + Date.parse(value); // throws an error when invalid + } + }, + time: { + requires: ["date"], + merge(first, second) { + return second; + }, + validate(value) { + // ... + } + } +}); + +// throws error: Key "time" requires keys "date" +schema.validate({ + time: "13:45" +}); +``` + +In this example, even though `date` is an optional key, it is required to be present whenever `time` is present. + +## License + +BSD 3-Clause diff --git a/node_modules/@humanwhocodes/object-schema/package.json b/node_modules/@humanwhocodes/object-schema/package.json new file mode 100644 index 000000000..9fc90bf3f --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/package.json @@ -0,0 +1,33 @@ +{ + "name": "@humanwhocodes/object-schema", + "version": "1.2.1", + "description": "An object schema merger/validator", + "main": "src/index.js", + "directories": { + "test": "tests" + }, + "scripts": { + "test": "mocha tests/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/humanwhocodes/object-schema.git" + }, + "keywords": [ + "object", + "validation", + "schema", + "merge" + ], + "author": "Nicholas C. Zakas", + "license": "BSD-3-Clause", + "bugs": { + "url": "https://github.com/humanwhocodes/object-schema/issues" + }, + "homepage": "https://github.com/humanwhocodes/object-schema#readme", + "devDependencies": { + "chai": "^4.2.0", + "eslint": "^5.13.0", + "mocha": "^5.2.0" + } +} diff --git a/node_modules/@humanwhocodes/object-schema/src/index.js b/node_modules/@humanwhocodes/object-schema/src/index.js new file mode 100644 index 000000000..b2bc4fb96 --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/src/index.js @@ -0,0 +1,7 @@ +/** + * @filedescription Object Schema Package + */ + +exports.ObjectSchema = require("./object-schema").ObjectSchema; +exports.MergeStrategy = require("./merge-strategy").MergeStrategy; +exports.ValidationStrategy = require("./validation-strategy").ValidationStrategy; diff --git a/node_modules/@humanwhocodes/object-schema/src/merge-strategy.js b/node_modules/@humanwhocodes/object-schema/src/merge-strategy.js new file mode 100644 index 000000000..821744927 --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/src/merge-strategy.js @@ -0,0 +1,53 @@ +/** + * @filedescription Merge Strategy + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Class +//----------------------------------------------------------------------------- + +/** + * Container class for several different merge strategies. + */ +class MergeStrategy { + + /** + * Merges two keys by overwriting the first with the second. + * @param {*} value1 The value from the first object key. + * @param {*} value2 The value from the second object key. + * @returns {*} The second value. + */ + static overwrite(value1, value2) { + return value2; + } + + /** + * Merges two keys by replacing the first with the second only if the + * second is defined. + * @param {*} value1 The value from the first object key. + * @param {*} value2 The value from the second object key. + * @returns {*} The second value if it is defined. + */ + static replace(value1, value2) { + if (typeof value2 !== "undefined") { + return value2; + } + + return value1; + } + + /** + * Merges two properties by assigning properties from the second to the first. + * @param {*} value1 The value from the first object key. + * @param {*} value2 The value from the second object key. + * @returns {*} A new object containing properties from both value1 and + * value2. + */ + static assign(value1, value2) { + return Object.assign({}, value1, value2); + } +} + +exports.MergeStrategy = MergeStrategy; diff --git a/node_modules/@humanwhocodes/object-schema/src/object-schema.js b/node_modules/@humanwhocodes/object-schema/src/object-schema.js new file mode 100644 index 000000000..b66323653 --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/src/object-schema.js @@ -0,0 +1,235 @@ +/** + * @filedescription Object Schema + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const { MergeStrategy } = require("./merge-strategy"); +const { ValidationStrategy } = require("./validation-strategy"); + +//----------------------------------------------------------------------------- +// Private +//----------------------------------------------------------------------------- + +const strategies = Symbol("strategies"); +const requiredKeys = Symbol("requiredKeys"); + +/** + * Validates a schema strategy. + * @param {string} name The name of the key this strategy is for. + * @param {Object} strategy The strategy for the object key. + * @param {boolean} [strategy.required=true] Whether the key is required. + * @param {string[]} [strategy.requires] Other keys that are required when + * this key is present. + * @param {Function} strategy.merge A method to call when merging two objects + * with the same key. + * @param {Function} strategy.validate A method to call when validating an + * object with the key. + * @returns {void} + * @throws {Error} When the strategy is missing a name. + * @throws {Error} When the strategy is missing a merge() method. + * @throws {Error} When the strategy is missing a validate() method. + */ +function validateDefinition(name, strategy) { + + let hasSchema = false; + if (strategy.schema) { + if (typeof strategy.schema === "object") { + hasSchema = true; + } else { + throw new TypeError("Schema must be an object."); + } + } + + if (typeof strategy.merge === "string") { + if (!(strategy.merge in MergeStrategy)) { + throw new TypeError(`Definition for key "${name}" missing valid merge strategy.`); + } + } else if (!hasSchema && typeof strategy.merge !== "function") { + throw new TypeError(`Definition for key "${name}" must have a merge property.`); + } + + if (typeof strategy.validate === "string") { + if (!(strategy.validate in ValidationStrategy)) { + throw new TypeError(`Definition for key "${name}" missing valid validation strategy.`); + } + } else if (!hasSchema && typeof strategy.validate !== "function") { + throw new TypeError(`Definition for key "${name}" must have a validate() method.`); + } +} + + +//----------------------------------------------------------------------------- +// Class +//----------------------------------------------------------------------------- + +/** + * Represents an object validation/merging schema. + */ +class ObjectSchema { + + /** + * Creates a new instance. + */ + constructor(definitions) { + + if (!definitions) { + throw new Error("Schema definitions missing."); + } + + /** + * Track all strategies in the schema by key. + * @type {Map} + * @property strategies + */ + this[strategies] = new Map(); + + /** + * Separately track any keys that are required for faster validation. + * @type {Map} + * @property requiredKeys + */ + this[requiredKeys] = new Map(); + + // add in all strategies + for (const key of Object.keys(definitions)) { + validateDefinition(key, definitions[key]); + + // normalize merge and validate methods if subschema is present + if (typeof definitions[key].schema === "object") { + const schema = new ObjectSchema(definitions[key].schema); + definitions[key] = { + ...definitions[key], + merge(first = {}, second = {}) { + return schema.merge(first, second); + }, + validate(value) { + ValidationStrategy.object(value); + schema.validate(value); + } + }; + } + + // normalize the merge method in case there's a string + if (typeof definitions[key].merge === "string") { + definitions[key] = { + ...definitions[key], + merge: MergeStrategy[definitions[key].merge] + }; + }; + + // normalize the validate method in case there's a string + if (typeof definitions[key].validate === "string") { + definitions[key] = { + ...definitions[key], + validate: ValidationStrategy[definitions[key].validate] + }; + }; + + this[strategies].set(key, definitions[key]); + + if (definitions[key].required) { + this[requiredKeys].set(key, definitions[key]); + } + } + } + + /** + * Determines if a strategy has been registered for the given object key. + * @param {string} key The object key to find a strategy for. + * @returns {boolean} True if the key has a strategy registered, false if not. + */ + hasKey(key) { + return this[strategies].has(key); + } + + /** + * Merges objects together to create a new object comprised of the keys + * of the all objects. Keys are merged based on the each key's merge + * strategy. + * @param {...Object} objects The objects to merge. + * @returns {Object} A new object with a mix of all objects' keys. + * @throws {Error} If any object is invalid. + */ + merge(...objects) { + + // double check arguments + if (objects.length < 2) { + throw new Error("merge() requires at least two arguments."); + } + + if (objects.some(object => (object == null || typeof object !== "object"))) { + throw new Error("All arguments must be objects."); + } + + return objects.reduce((result, object) => { + + this.validate(object); + + for (const [key, strategy] of this[strategies]) { + try { + if (key in result || key in object) { + const value = strategy.merge.call(this, result[key], object[key]); + if (value !== undefined) { + result[key] = value; + } + } + } catch (ex) { + ex.message = `Key "${key}": ` + ex.message; + throw ex; + } + } + return result; + }, {}); + } + + /** + * Validates an object's keys based on the validate strategy for each key. + * @param {Object} object The object to validate. + * @returns {void} + * @throws {Error} When the object is invalid. + */ + validate(object) { + + // check existing keys first + for (const key of Object.keys(object)) { + + // check to see if the key is defined + if (!this.hasKey(key)) { + throw new Error(`Unexpected key "${key}" found.`); + } + + // validate existing keys + const strategy = this[strategies].get(key); + + // first check to see if any other keys are required + if (Array.isArray(strategy.requires)) { + if (!strategy.requires.every(otherKey => otherKey in object)) { + throw new Error(`Key "${key}" requires keys "${strategy.requires.join("\", \"")}".`); + } + } + + // now apply remaining validation strategy + try { + strategy.validate.call(strategy, object[key]); + } catch (ex) { + ex.message = `Key "${key}": ` + ex.message; + throw ex; + } + } + + // ensure required keys aren't missing + for (const [key] of this[requiredKeys]) { + if (!(key in object)) { + throw new Error(`Missing required key "${key}".`); + } + } + + } +} + +exports.ObjectSchema = ObjectSchema; diff --git a/node_modules/@humanwhocodes/object-schema/src/validation-strategy.js b/node_modules/@humanwhocodes/object-schema/src/validation-strategy.js new file mode 100644 index 000000000..ecf918bdd --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/src/validation-strategy.js @@ -0,0 +1,102 @@ +/** + * @filedescription Validation Strategy + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Class +//----------------------------------------------------------------------------- + +/** + * Container class for several different validation strategies. + */ +class ValidationStrategy { + + /** + * Validates that a value is an array. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static array(value) { + if (!Array.isArray(value)) { + throw new TypeError("Expected an array."); + } + } + + /** + * Validates that a value is a boolean. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static boolean(value) { + if (typeof value !== "boolean") { + throw new TypeError("Expected a Boolean."); + } + } + + /** + * Validates that a value is a number. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static number(value) { + if (typeof value !== "number") { + throw new TypeError("Expected a number."); + } + } + + /** + * Validates that a value is a object. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static object(value) { + if (!value || typeof value !== "object") { + throw new TypeError("Expected an object."); + } + } + + /** + * Validates that a value is a object or null. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static "object?"(value) { + if (typeof value !== "object") { + throw new TypeError("Expected an object or null."); + } + } + + /** + * Validates that a value is a string. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static string(value) { + if (typeof value !== "string") { + throw new TypeError("Expected a string."); + } + } + + /** + * Validates that a value is a non-empty string. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static "string!"(value) { + if (typeof value !== "string" || value.length === 0) { + throw new TypeError("Expected a non-empty string."); + } + } + +} + +exports.ValidationStrategy = ValidationStrategy; diff --git a/node_modules/@humanwhocodes/object-schema/tests/merge-strategy.js b/node_modules/@humanwhocodes/object-schema/tests/merge-strategy.js new file mode 100644 index 000000000..84032d7e8 --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/tests/merge-strategy.js @@ -0,0 +1,66 @@ +/** + * @filedescription Merge Strategy Tests + */ +/* global it, describe, beforeEach */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const assert = require("chai").assert; +const { MergeStrategy } = require("../src/"); + +//----------------------------------------------------------------------------- +// Class +//----------------------------------------------------------------------------- + +describe("MergeStrategy", () => { + + + describe("overwrite()", () => { + + it("should overwrite the first value with the second when the second is defined", () => { + const result = MergeStrategy.overwrite(1, 2); + assert.strictEqual(result, 2); + }); + + it("should overwrite the first value with the second when the second is undefined", () => { + const result = MergeStrategy.overwrite(1, undefined); + assert.strictEqual(result, undefined); + }); + + }); + + describe("replace()", () => { + + it("should overwrite the first value with the second when the second is defined", () => { + const result = MergeStrategy.replace(1, 2); + assert.strictEqual(result, 2); + }); + + it("should return the first value when the second is undefined", () => { + const result = MergeStrategy.replace(1, undefined); + assert.strictEqual(result, 1); + }); + + }); + + describe("assign()", () => { + + it("should merge properties from two objects when called", () => { + + const object1 = { foo: 1, bar: 3 }; + const object2 = { foo: 2 }; + + const result = MergeStrategy.assign(object1, object2); + assert.deepStrictEqual(result, { + foo: 2, + bar: 3 + }); + }); + + }); + +}); diff --git a/node_modules/@humanwhocodes/object-schema/tests/object-schema.js b/node_modules/@humanwhocodes/object-schema/tests/object-schema.js new file mode 100644 index 000000000..d86ef6e97 --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/tests/object-schema.js @@ -0,0 +1,611 @@ +/** + * @filedescription Object Schema Tests + */ +/* global it, describe, beforeEach */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const assert = require("chai").assert; +const { ObjectSchema } = require("../src/"); + +//----------------------------------------------------------------------------- +// Class +//----------------------------------------------------------------------------- + +describe("ObjectSchema", () => { + + let schema; + + describe("new ObjectSchema()", () => { + + it("should add a new key when a strategy is passed", () => { + schema = new ObjectSchema({ + foo: { + merge() {}, + validate() {} + } + }); + + assert.isTrue(schema.hasKey("foo")); + }); + + it("should throw an error when a strategy is missing a merge() method", () => { + assert.throws(() => { + schema = new ObjectSchema({ + foo: { + validate() { } + } + }); + }, /Definition for key "foo" must have a merge property/); + }); + + it("should throw an error when a strategy is missing a merge() method", () => { + assert.throws(() => { + schema = new ObjectSchema(); + }, /Schema definitions missing/); + }); + + it("should throw an error when a strategy is missing a validate() method", () => { + assert.throws(() => { + schema = new ObjectSchema({ + foo: { + merge() { }, + } + }); + }, /Definition for key "foo" must have a validate\(\) method/); + }); + + it("should throw an error when merge is an invalid string", () => { + assert.throws(() => { + new ObjectSchema({ + foo: { + merge: "bar", + validate() { } + } + }); + }, /key "foo" missing valid merge strategy/); + }); + + it("should throw an error when validate is an invalid string", () => { + assert.throws(() => { + new ObjectSchema({ + foo: { + merge: "assign", + validate: "s" + } + }); + }, /key "foo" missing valid validation strategy/); + }); + + }); + + + describe("merge()", () => { + + it("should throw an error when an unexpected key is found", () => { + let schema = new ObjectSchema({}); + + assert.throws(() => { + schema.merge({ foo: true }, { foo: true }); + }, /Unexpected key "foo"/); + }); + + it("should throw an error when merge() throws an error", () => { + let schema = new ObjectSchema({ + foo: { + merge() { + throw new Error("Boom!"); + }, + validate() {} + } + }); + + assert.throws(() => { + schema.merge({ foo: true }, { foo: true }); + }, /Key "foo": Boom!/); + + }); + + it("should call the merge() strategy for one key when called", () => { + + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate() {} + } + }); + + const result = schema.merge({ foo: true }, { foo: false }); + assert.propertyVal(result, "foo", "bar"); + }); + + it("should not call the merge() strategy when both objects don't contain the key", () => { + + let called = false; + + schema = new ObjectSchema({ + foo: { + merge() { + called = true; + }, + validate() {} + } + }); + + schema.merge({}, {}); + assert.isFalse(called, "The merge() strategy should not have been called."); + }); + + it("should omit returning the key when the merge() strategy returns undefined", () => { + schema = new ObjectSchema({ + foo: { + merge() { + return undefined; + }, + validate() { } + } + }); + + const result = schema.merge({ foo: true }, { foo: false }); + assert.notProperty(result, "foo"); + }); + + it("should call the merge() strategy for two keys when called", () => { + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate() { } + }, + bar: { + merge() { + return "baz"; + }, + validate() {} + } + }); + + const result = schema.merge({ foo: true, bar: 1 }, { foo: true, bar: 2 }); + assert.propertyVal(result, "foo", "bar"); + assert.propertyVal(result, "bar", "baz"); + }); + + it("should call the merge() strategy for two keys when called on three objects", () => { + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate() { } + }, + bar: { + merge() { + return "baz"; + }, + validate() { } + } + }); + + const result = schema.merge( + { foo: true, bar: 1 }, + { foo: true, bar: 3 }, + { foo: false, bar: 2 } + ); + assert.propertyVal(result, "foo", "bar"); + assert.propertyVal(result, "bar", "baz"); + }); + + it("should call the merge() strategy when defined as 'overwrite'", () => { + schema = new ObjectSchema({ + foo: { + merge: "overwrite", + validate() { } + } + }); + + const result = schema.merge( + { foo: true }, + { foo: false } + ); + assert.propertyVal(result, "foo", false); + }); + + it("should call the merge() strategy when defined as 'assign'", () => { + schema = new ObjectSchema({ + foo: { + merge: "assign", + validate() { } + } + }); + + const result = schema.merge( + { foo: { bar: true } }, + { foo: { baz: false } } + ); + + assert.strictEqual(result.foo.bar, true); + assert.strictEqual(result.foo.baz, false); + }); + + it("should call the merge strategy when there's a subschema", () => { + + schema = new ObjectSchema({ + name: { + schema: { + first: { + merge: "replace", + validate: "string" + }, + last: { + merge: "replace", + validate: "string" + } + } + } + }); + + const result = schema.merge({ + name: { + first: "n", + last: "z" + } + }, { + name: { + first: "g" + } + }); + + assert.strictEqual(result.name.first, "g"); + assert.strictEqual(result.name.last, "z"); + }); + + it("should return separate objects when using subschema", () => { + + schema = new ObjectSchema({ + age: { + merge: "replace", + validate: "number" + }, + address: { + schema: { + street: { + schema: { + number: { + merge: "replace", + validate: "number" + }, + streetName: { + merge: "replace", + validate: "string" + } + } + }, + state: { + merge: "replace", + validate: "string" + } + } + } + }); + + const baseObject = { + address: { + street: { + number: 100, + streetName: "Foo St" + }, + state: "HA" + } + }; + + const result = schema.merge(baseObject, { + age: 29 + }); + + assert.notStrictEqual(result.address.street, baseObject.address.street); + assert.deepStrictEqual(result.address, baseObject.address); + }); + + it("should not error when calling the merge strategy when there's a subschema and no matching key in second object", () => { + + schema = new ObjectSchema({ + name: { + schema: { + first: { + merge: "replace", + validate: "string" + }, + last: { + merge: "replace", + validate: "string" + } + } + } + }); + + const result = schema.merge({ + name: { + first: "n", + last: "z" + } + }, { + }); + + assert.strictEqual(result.name.first, "n"); + assert.strictEqual(result.name.last, "z"); + }); + + it("should not error when calling the merge strategy when there's multiple subschemas and no matching key in second object", () => { + + schema = new ObjectSchema({ + user: { + schema: { + name: { + schema: { + first: { + merge: "replace", + validate: "string" + }, + last: { + merge: "replace", + validate: "string" + } + } + } + + } + } + }); + + const result = schema.merge({ + user: { + name: { + first: "n", + last: "z" + } + } + }, { + }); + + assert.strictEqual(result.user.name.first, "n"); + assert.strictEqual(result.user.name.last, "z"); + }); + + + }); + + describe("validate()", () => { + + it("should throw an error when an unexpected key is found", () => { + let schema = new ObjectSchema({}); + assert.throws(() => { + schema.validate({ foo: true }); + }, /Unexpected key "foo"/); + }); + + it("should not throw an error when an expected key is found", () => { + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate() {} + } + }); + + schema.validate({ foo: true }); + }); + + it("should pass the property value into validate() when key is found", () => { + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate(value) { + assert.isTrue(value); + } + } + }); + + schema.validate({ foo: true }); + }); + + it("should not throw an error when expected keys are found", () => { + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate() {} + }, + bar: { + merge() { + return "baz"; + }, + validate() {} + } + }); + + schema.validate({ foo: true, bar: true }); + }); + + it("should not throw an error when expected keys are found with required keys", () => { + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate() { } + }, + bar: { + requires: ["foo"], + merge() { + return "baz"; + }, + validate() { } + } + }); + + schema.validate({ foo: true, bar: true }); + }); + + it("should throw an error when expected keys are found without required keys", () => { + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate() { } + }, + baz: { + merge() { + return "baz"; + }, + validate() { } + }, + bar: { + name: "bar", + requires: ["foo", "baz"], + merge() { }, + validate() { } + } + }); + + assert.throws(() => { + schema.validate({ bar: true }); + }, /Key "bar" requires keys "foo", "baz"./); + }); + + + it("should throw an error when an expected key is found but is invalid", () => { + + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate() { + throw new Error("Invalid key."); + } + } + }); + + assert.throws(() => { + schema.validate({ foo: true }); + }, /Key "foo": Invalid key/); + }); + + it("should throw an error when an expected key is found but is invalid with a string validator", () => { + + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate: "string" + } + }); + + assert.throws(() => { + schema.validate({ foo: true }); + }, /Key "foo": Expected a string/); + }); + + it("should throw an error when an expected key is found but is invalid with a number validator", () => { + + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate: "number" + } + }); + + assert.throws(() => { + schema.validate({ foo: true }); + }, /Key "foo": Expected a number/); + }); + + it("should throw an error when a required key is missing", () => { + + schema = new ObjectSchema({ + foo: { + required: true, + merge() { + return "bar"; + }, + validate() {} + } + }); + + assert.throws(() => { + schema.validate({}); + }, /Missing required key "foo"/); + }); + + it("should throw an error when a subschema is provided and the value doesn't validate", () => { + + schema = new ObjectSchema({ + name: { + schema: { + first: { + merge: "replace", + validate: "string" + }, + last: { + merge: "replace", + validate: "string" + } + } + } + }); + + assert.throws(() => { + schema.validate({ + name: { + first: 123, + last: "z" + } + }); + + }, /Key "name": Key "first": Expected a string/); + }); + + it("should not throw an error when a subschema is provided and the value validates", () => { + + schema = new ObjectSchema({ + name: { + schema: { + first: { + merge: "replace", + validate: "string" + }, + last: { + merge: "replace", + validate: "string" + } + } + } + }); + + schema.validate({ + name: { + first: "n", + last: "z" + } + }); + + }); + + }); + +}); diff --git a/node_modules/@humanwhocodes/object-schema/tests/validation-strategy.js b/node_modules/@humanwhocodes/object-schema/tests/validation-strategy.js new file mode 100644 index 000000000..5d3e4a24d --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/tests/validation-strategy.js @@ -0,0 +1,186 @@ +/** + * @filedescription Merge Strategy Tests + */ +/* global it, describe, beforeEach */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const assert = require("chai").assert; +const { ValidationStrategy } = require("../src/"); + +//----------------------------------------------------------------------------- +// Class +//----------------------------------------------------------------------------- + +describe("ValidationStrategy", () => { + + describe("boolean", () => { + it("should not throw an error when the value is a boolean", () => { + ValidationStrategy.boolean(true); + }); + + it("should throw an error when the value is null", () => { + assert.throws(() => { + ValidationStrategy.boolean(null); + }, /Expected a Boolean/); + }); + + it("should throw an error when the value is a string", () => { + assert.throws(() => { + ValidationStrategy.boolean("foo"); + }, /Expected a Boolean/); + }); + + it("should throw an error when the value is a number", () => { + assert.throws(() => { + ValidationStrategy.boolean(123); + }, /Expected a Boolean/); + }); + + it("should throw an error when the value is an object", () => { + assert.throws(() => { + ValidationStrategy.boolean({}); + }, /Expected a Boolean/); + }); + }); + + describe("number", () => { + it("should not throw an error when the value is a number", () => { + ValidationStrategy.number(25); + }); + + it("should throw an error when the value is null", () => { + assert.throws(() => { + ValidationStrategy.number(null); + }, /Expected a number/); + }); + + it("should throw an error when the value is a string", () => { + assert.throws(() => { + ValidationStrategy.number("foo"); + }, /Expected a number/); + }); + + it("should throw an error when the value is a boolean", () => { + assert.throws(() => { + ValidationStrategy.number(true); + }, /Expected a number/); + }); + + it("should throw an error when the value is an object", () => { + assert.throws(() => { + ValidationStrategy.number({}); + }, /Expected a number/); + }); + }); + + describe("object", () => { + it("should not throw an error when the value is an object", () => { + ValidationStrategy.object({}); + }); + + it("should throw an error when the value is null", () => { + assert.throws(() => { + ValidationStrategy.object(null); + }, /Expected an object/); + }); + + it("should throw an error when the value is a string", () => { + assert.throws(() => { + ValidationStrategy.object(""); + }, /Expected an object/); + }); + }); + + describe("array", () => { + it("should not throw an error when the value is an array", () => { + ValidationStrategy.array([]); + }); + + it("should throw an error when the value is null", () => { + assert.throws(() => { + ValidationStrategy.array(null); + }, /Expected an array/); + }); + + it("should throw an error when the value is a string", () => { + assert.throws(() => { + ValidationStrategy.array(""); + }, /Expected an array/); + }); + + it("should throw an error when the value is an object", () => { + assert.throws(() => { + ValidationStrategy.array({}); + }, /Expected an array/); + }); + }); + + describe("object?", () => { + it("should not throw an error when the value is an object", () => { + ValidationStrategy["object?"]({}); + }); + + it("should not throw an error when the value is null", () => { + ValidationStrategy["object?"](null); + }); + + it("should throw an error when the value is a string", () => { + assert.throws(() => { + ValidationStrategy["object?"](""); + }, /Expected an object/); + }); + }); + + describe("string", () => { + it("should not throw an error when the value is a string", () => { + ValidationStrategy.string("foo"); + }); + + it("should not throw an error when the value is an empty string", () => { + ValidationStrategy.string(""); + }); + + it("should throw an error when the value is null", () => { + assert.throws(() => { + ValidationStrategy.string(null); + }, /Expected a string/); + }); + + it("should throw an error when the value is an object", () => { + assert.throws(() => { + ValidationStrategy.string({}); + }, /Expected a string/); + }); + }); + + describe("string!", () => { + it("should not throw an error when the value is an string", () => { + ValidationStrategy["string!"]("foo"); + }); + + it("should throw an error when the value is an empty string", () => { + assert.throws(() => { + ValidationStrategy["string!"](""); + }, /Expected a non-empty string/); + }); + + it("should throw an error when the value is null", () => { + assert.throws(() => { + ValidationStrategy["string!"](null); + }, /Expected a non-empty string/); + }); + + it("should throw an error when the value is an object", () => { + assert.throws(() => { + ValidationStrategy["string!"]({}); + }, /Expected a non-empty string/); + }); + }); + + +}); diff --git a/node_modules/@nodelib/fs.scandir/LICENSE b/node_modules/@nodelib/fs.scandir/LICENSE new file mode 100644 index 000000000..65a999460 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@nodelib/fs.scandir/README.md b/node_modules/@nodelib/fs.scandir/README.md new file mode 100644 index 000000000..e0b218b9f --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/README.md @@ -0,0 +1,171 @@ +# @nodelib/fs.scandir + +> List files and directories inside the specified directory. + +## :bulb: Highlights + +The package is aimed at obtaining information about entries in the directory. + +* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional). +* :gear: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type. See [`old` and `modern` mode](#old-and-modern-mode). +* :link: Can safely work with broken symbolic links. + +## Install + +```console +npm install @nodelib/fs.scandir +``` + +## Usage + +```ts +import * as fsScandir from '@nodelib/fs.scandir'; + +fsScandir.scandir('path', (error, stats) => { /* … */ }); +``` + +## API + +### .scandir(path, [optionsOrSettings], callback) + +Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path with standard callback-style. + +```ts +fsScandir.scandir('path', (error, entries) => { /* … */ }); +fsScandir.scandir('path', {}, (error, entries) => { /* … */ }); +fsScandir.scandir('path', new fsScandir.Settings(), (error, entries) => { /* … */ }); +``` + +### .scandirSync(path, [optionsOrSettings]) + +Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path. + +```ts +const entries = fsScandir.scandirSync('path'); +const entries = fsScandir.scandirSync('path', {}); +const entries = fsScandir.scandirSync(('path', new fsScandir.Settings()); +``` + +#### path + +* Required: `true` +* Type: `string | Buffer | URL` + +A path to a file. If a URL is provided, it must use the `file:` protocol. + +#### optionsOrSettings + +* Required: `false` +* Type: `Options | Settings` +* Default: An instance of `Settings` class + +An [`Options`](#options) object or an instance of [`Settings`](#settingsoptions) class. + +> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. + +### Settings([options]) + +A class of full settings of the package. + +```ts +const settings = new fsScandir.Settings({ followSymbolicLinks: false }); + +const entries = fsScandir.scandirSync('path', settings); +``` + +## Entry + +* `name` — The name of the entry (`unknown.txt`). +* `path` — The path of the entry relative to call directory (`root/unknown.txt`). +* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. On Node.js below 10.10 will be emulated by [`DirentFromStats`](./src/utils/fs.ts) class. +* `stats` (optional) — An instance of `fs.Stats` class. + +For example, the `scandir` call for `tools` directory with one directory inside: + +```ts +{ + dirent: Dirent { name: 'typedoc', /* … */ }, + name: 'typedoc', + path: 'tools/typedoc' +} +``` + +## Options + +### stats + +* Type: `boolean` +* Default: `false` + +Adds an instance of `fs.Stats` class to the [`Entry`](#entry). + +> :book: Always use `fs.readdir` without the `withFileTypes` option. ??TODO?? + +### followSymbolicLinks + +* Type: `boolean` +* Default: `false` + +Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`. + +### `throwErrorOnBrokenSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Throw an error when symbolic link is broken if `true` or safely use `lstat` call if `false`. + +### `pathSegmentSeparator` + +* Type: `string` +* Default: `path.sep` + +By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead. + +### `fs` + +* Type: [`FileSystemAdapter`](./src/adapters/fs.ts) +* Default: A default FS methods + +By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. + +```ts +interface FileSystemAdapter { + lstat?: typeof fs.lstat; + stat?: typeof fs.stat; + lstatSync?: typeof fs.lstatSync; + statSync?: typeof fs.statSync; + readdir?: typeof fs.readdir; + readdirSync?: typeof fs.readdirSync; +} + +const settings = new fsScandir.Settings({ + fs: { lstat: fakeLstat } +}); +``` + +## `old` and `modern` mode + +This package has two modes that are used depending on the environment and parameters of use. + +### old + +* Node.js below `10.10` or when the `stats` option is enabled + +When working in the old mode, the directory is read first (`fs.readdir`), then the type of entries is determined (`fs.lstat` and/or `fs.stat` for symbolic links). + +### modern + +* Node.js 10.10+ and the `stats` option is disabled + +In the modern mode, reading the directory (`fs.readdir` with the `withFileTypes` option) is combined with obtaining information about its entries. An additional call for symbolic links (`fs.stat`) is still present. + +This mode makes fewer calls to the file system. It's faster. + +## Changelog + +See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts b/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts new file mode 100644 index 000000000..827f1db09 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts @@ -0,0 +1,20 @@ +import type * as fsStat from '@nodelib/fs.stat'; +import type { Dirent, ErrnoException } from '../types'; +export interface ReaddirAsynchronousMethod { + (filepath: string, options: { + withFileTypes: true; + }, callback: (error: ErrnoException | null, files: Dirent[]) => void): void; + (filepath: string, callback: (error: ErrnoException | null, files: string[]) => void): void; +} +export interface ReaddirSynchronousMethod { + (filepath: string, options: { + withFileTypes: true; + }): Dirent[]; + (filepath: string): string[]; +} +export declare type FileSystemAdapter = fsStat.FileSystemAdapter & { + readdir: ReaddirAsynchronousMethod; + readdirSync: ReaddirSynchronousMethod; +}; +export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter; +export declare function createFileSystemAdapter(fsMethods?: Partial): FileSystemAdapter; diff --git a/node_modules/@nodelib/fs.scandir/out/adapters/fs.js b/node_modules/@nodelib/fs.scandir/out/adapters/fs.js new file mode 100644 index 000000000..f0fe02202 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/adapters/fs.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; +const fs = require("fs"); +exports.FILE_SYSTEM_ADAPTER = { + lstat: fs.lstat, + stat: fs.stat, + lstatSync: fs.lstatSync, + statSync: fs.statSync, + readdir: fs.readdir, + readdirSync: fs.readdirSync +}; +function createFileSystemAdapter(fsMethods) { + if (fsMethods === undefined) { + return exports.FILE_SYSTEM_ADAPTER; + } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); +} +exports.createFileSystemAdapter = createFileSystemAdapter; diff --git a/node_modules/@nodelib/fs.scandir/out/constants.d.ts b/node_modules/@nodelib/fs.scandir/out/constants.d.ts new file mode 100644 index 000000000..33f17497d --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/constants.d.ts @@ -0,0 +1,4 @@ +/** + * IS `true` for Node.js 10.10 and greater. + */ +export declare const IS_SUPPORT_READDIR_WITH_FILE_TYPES: boolean; diff --git a/node_modules/@nodelib/fs.scandir/out/constants.js b/node_modules/@nodelib/fs.scandir/out/constants.js new file mode 100644 index 000000000..7e3d4411f --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/constants.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; +const NODE_PROCESS_VERSION_PARTS = process.versions.node.split('.'); +if (NODE_PROCESS_VERSION_PARTS[0] === undefined || NODE_PROCESS_VERSION_PARTS[1] === undefined) { + throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`); +} +const MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10); +const MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10); +const SUPPORTED_MAJOR_VERSION = 10; +const SUPPORTED_MINOR_VERSION = 10; +const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION; +const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION; +/** + * IS `true` for Node.js 10.10 and greater. + */ +exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; diff --git a/node_modules/@nodelib/fs.scandir/out/index.d.ts b/node_modules/@nodelib/fs.scandir/out/index.d.ts new file mode 100644 index 000000000..b9da83ed1 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/index.d.ts @@ -0,0 +1,12 @@ +import type { FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod } from './adapters/fs'; +import * as async from './providers/async'; +import Settings, { Options } from './settings'; +import type { Dirent, Entry } from './types'; +declare type AsyncCallback = async.AsyncCallback; +declare function scandir(path: string, callback: AsyncCallback): void; +declare function scandir(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; +declare namespace scandir { + function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise; +} +declare function scandirSync(path: string, optionsOrSettings?: Options | Settings): Entry[]; +export { scandir, scandirSync, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod, Options }; diff --git a/node_modules/@nodelib/fs.scandir/out/index.js b/node_modules/@nodelib/fs.scandir/out/index.js new file mode 100644 index 000000000..99c70d3d6 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/index.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Settings = exports.scandirSync = exports.scandir = void 0; +const async = require("./providers/async"); +const sync = require("./providers/sync"); +const settings_1 = require("./settings"); +exports.Settings = settings_1.default; +function scandir(path, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + async.read(path, getSettings(), optionsOrSettingsOrCallback); + return; + } + async.read(path, getSettings(optionsOrSettingsOrCallback), callback); +} +exports.scandir = scandir; +function scandirSync(path, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + return sync.read(path, settings); +} +exports.scandirSync = scandirSync; +function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); +} diff --git a/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts new file mode 100644 index 000000000..5829676df --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts @@ -0,0 +1,7 @@ +/// +import type Settings from '../settings'; +import type { Entry } from '../types'; +export declare type AsyncCallback = (error: NodeJS.ErrnoException, entries: Entry[]) => void; +export declare function read(directory: string, settings: Settings, callback: AsyncCallback): void; +export declare function readdirWithFileTypes(directory: string, settings: Settings, callback: AsyncCallback): void; +export declare function readdir(directory: string, settings: Settings, callback: AsyncCallback): void; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/async.js b/node_modules/@nodelib/fs.scandir/out/providers/async.js new file mode 100644 index 000000000..e8e2f0a9c --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/async.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; +const fsStat = require("@nodelib/fs.stat"); +const rpl = require("run-parallel"); +const constants_1 = require("../constants"); +const utils = require("../utils"); +const common = require("./common"); +function read(directory, settings, callback) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + readdirWithFileTypes(directory, settings, callback); + return; + } + readdir(directory, settings, callback); +} +exports.read = read; +function readdirWithFileTypes(directory, settings, callback) { + settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); + return; + } + const entries = dirents.map((dirent) => ({ + dirent, + name: dirent.name, + path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + })); + if (!settings.followSymbolicLinks) { + callSuccessCallback(callback, entries); + return; + } + const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings)); + rpl(tasks, (rplError, rplEntries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, rplEntries); + }); + }); +} +exports.readdirWithFileTypes = readdirWithFileTypes; +function makeRplTaskEntry(entry, settings) { + return (done) => { + if (!entry.dirent.isSymbolicLink()) { + done(null, entry); + return; + } + settings.fs.stat(entry.path, (statError, stats) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + done(statError); + return; + } + done(null, entry); + return; + } + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + done(null, entry); + }); + }; +} +function readdir(directory, settings, callback) { + settings.fs.readdir(directory, (readdirError, names) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); + return; + } + const tasks = names.map((name) => { + const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); + return (done) => { + fsStat.stat(path, settings.fsStatSettings, (error, stats) => { + if (error !== null) { + done(error); + return; + } + const entry = { + name, + path, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + done(null, entry); + }); + }; + }); + rpl(tasks, (rplError, entries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, entries); + }); + }); +} +exports.readdir = readdir; +function callFailureCallback(callback, error) { + callback(error); +} +function callSuccessCallback(callback, result) { + callback(null, result); +} diff --git a/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts new file mode 100644 index 000000000..2b4d08b57 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts @@ -0,0 +1 @@ +export declare function joinPathSegments(a: string, b: string, separator: string): string; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/common.js b/node_modules/@nodelib/fs.scandir/out/providers/common.js new file mode 100644 index 000000000..8724cb59a --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/common.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.joinPathSegments = void 0; +function joinPathSegments(a, b, separator) { + /** + * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). + */ + if (a.endsWith(separator)) { + return a + b; + } + return a + separator + b; +} +exports.joinPathSegments = joinPathSegments; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts new file mode 100644 index 000000000..e05c8f072 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts @@ -0,0 +1,5 @@ +import type Settings from '../settings'; +import type { Entry } from '../types'; +export declare function read(directory: string, settings: Settings): Entry[]; +export declare function readdirWithFileTypes(directory: string, settings: Settings): Entry[]; +export declare function readdir(directory: string, settings: Settings): Entry[]; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/sync.js b/node_modules/@nodelib/fs.scandir/out/providers/sync.js new file mode 100644 index 000000000..146db3434 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/sync.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; +const fsStat = require("@nodelib/fs.stat"); +const constants_1 = require("../constants"); +const utils = require("../utils"); +const common = require("./common"); +function read(directory, settings) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + return readdirWithFileTypes(directory, settings); + } + return readdir(directory, settings); +} +exports.read = read; +function readdirWithFileTypes(directory, settings) { + const dirents = settings.fs.readdirSync(directory, { withFileTypes: true }); + return dirents.map((dirent) => { + const entry = { + dirent, + name: dirent.name, + path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + }; + if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) { + try { + const stats = settings.fs.statSync(entry.path); + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + } + catch (error) { + if (settings.throwErrorOnBrokenSymbolicLink) { + throw error; + } + } + } + return entry; + }); +} +exports.readdirWithFileTypes = readdirWithFileTypes; +function readdir(directory, settings) { + const names = settings.fs.readdirSync(directory); + return names.map((name) => { + const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); + const stats = fsStat.statSync(entryPath, settings.fsStatSettings); + const entry = { + name, + path: entryPath, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + return entry; + }); +} +exports.readdir = readdir; diff --git a/node_modules/@nodelib/fs.scandir/out/settings.d.ts b/node_modules/@nodelib/fs.scandir/out/settings.d.ts new file mode 100644 index 000000000..a0db11559 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/settings.d.ts @@ -0,0 +1,20 @@ +import * as fsStat from '@nodelib/fs.stat'; +import * as fs from './adapters/fs'; +export interface Options { + followSymbolicLinks?: boolean; + fs?: Partial; + pathSegmentSeparator?: string; + stats?: boolean; + throwErrorOnBrokenSymbolicLink?: boolean; +} +export default class Settings { + private readonly _options; + readonly followSymbolicLinks: boolean; + readonly fs: fs.FileSystemAdapter; + readonly pathSegmentSeparator: string; + readonly stats: boolean; + readonly throwErrorOnBrokenSymbolicLink: boolean; + readonly fsStatSettings: fsStat.Settings; + constructor(_options?: Options); + private _getValue; +} diff --git a/node_modules/@nodelib/fs.scandir/out/settings.js b/node_modules/@nodelib/fs.scandir/out/settings.js new file mode 100644 index 000000000..15a3e8cde --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/settings.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const path = require("path"); +const fsStat = require("@nodelib/fs.stat"); +const fs = require("./adapters/fs"); +class Settings { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); + this.fs = fs.createFileSystemAdapter(this._options.fs); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); + this.stats = this._getValue(this._options.stats, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + this.fsStatSettings = new fsStat.Settings({ + followSymbolicLink: this.followSymbolicLinks, + fs: this.fs, + throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink + }); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +} +exports.default = Settings; diff --git a/node_modules/@nodelib/fs.scandir/out/types/index.d.ts b/node_modules/@nodelib/fs.scandir/out/types/index.d.ts new file mode 100644 index 000000000..f326c5e5e --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/types/index.d.ts @@ -0,0 +1,20 @@ +/// +import type * as fs from 'fs'; +export interface Entry { + dirent: Dirent; + name: string; + path: string; + stats?: Stats; +} +export declare type Stats = fs.Stats; +export declare type ErrnoException = NodeJS.ErrnoException; +export interface Dirent { + isBlockDevice: () => boolean; + isCharacterDevice: () => boolean; + isDirectory: () => boolean; + isFIFO: () => boolean; + isFile: () => boolean; + isSocket: () => boolean; + isSymbolicLink: () => boolean; + name: string; +} diff --git a/node_modules/@nodelib/fs.scandir/out/types/index.js b/node_modules/@nodelib/fs.scandir/out/types/index.js new file mode 100644 index 000000000..c8ad2e549 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/types/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts b/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts new file mode 100644 index 000000000..bb863f157 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts @@ -0,0 +1,2 @@ +import type { Dirent, Stats } from '../types'; +export declare function createDirentFromStats(name: string, stats: Stats): Dirent; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/fs.js b/node_modules/@nodelib/fs.scandir/out/utils/fs.js new file mode 100644 index 000000000..ace7c74d6 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/utils/fs.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createDirentFromStats = void 0; +class DirentFromStats { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); + } +} +function createDirentFromStats(name, stats) { + return new DirentFromStats(name, stats); +} +exports.createDirentFromStats = createDirentFromStats; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts b/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts new file mode 100644 index 000000000..1b41954e7 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts @@ -0,0 +1,2 @@ +import * as fs from './fs'; +export { fs }; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/index.js b/node_modules/@nodelib/fs.scandir/out/utils/index.js new file mode 100644 index 000000000..f5de129f4 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/utils/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fs = void 0; +const fs = require("./fs"); +exports.fs = fs; diff --git a/node_modules/@nodelib/fs.scandir/package.json b/node_modules/@nodelib/fs.scandir/package.json new file mode 100644 index 000000000..d3a89241b --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/package.json @@ -0,0 +1,44 @@ +{ + "name": "@nodelib/fs.scandir", + "version": "2.1.5", + "description": "List files and directories inside the specified directory", + "license": "MIT", + "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.scandir", + "keywords": [ + "NodeLib", + "fs", + "FileSystem", + "file system", + "scandir", + "readdir", + "dirent" + ], + "engines": { + "node": ">= 8" + }, + "files": [ + "out/**", + "!out/**/*.map", + "!out/**/*.spec.*" + ], + "main": "out/index.js", + "typings": "out/index.d.ts", + "scripts": { + "clean": "rimraf {tsconfig.tsbuildinfo,out}", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc -b .", + "compile:watch": "tsc -p . --watch --sourceMap", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile:watch" + }, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "devDependencies": { + "@nodelib/fs.macchiato": "1.0.4", + "@types/run-parallel": "^1.1.0" + }, + "gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562" +} diff --git a/node_modules/@nodelib/fs.stat/LICENSE b/node_modules/@nodelib/fs.stat/LICENSE new file mode 100644 index 000000000..65a999460 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@nodelib/fs.stat/README.md b/node_modules/@nodelib/fs.stat/README.md new file mode 100644 index 000000000..686f0471d --- /dev/null +++ b/node_modules/@nodelib/fs.stat/README.md @@ -0,0 +1,126 @@ +# @nodelib/fs.stat + +> Get the status of a file with some features. + +## :bulb: Highlights + +Wrapper around standard method `fs.lstat` and `fs.stat` with some features. + +* :beginner: Normally follows symbolic link. +* :gear: Can safely work with broken symbolic link. + +## Install + +```console +npm install @nodelib/fs.stat +``` + +## Usage + +```ts +import * as fsStat from '@nodelib/fs.stat'; + +fsStat.stat('path', (error, stats) => { /* … */ }); +``` + +## API + +### .stat(path, [optionsOrSettings], callback) + +Returns an instance of `fs.Stats` class for provided path with standard callback-style. + +```ts +fsStat.stat('path', (error, stats) => { /* … */ }); +fsStat.stat('path', {}, (error, stats) => { /* … */ }); +fsStat.stat('path', new fsStat.Settings(), (error, stats) => { /* … */ }); +``` + +### .statSync(path, [optionsOrSettings]) + +Returns an instance of `fs.Stats` class for provided path. + +```ts +const stats = fsStat.stat('path'); +const stats = fsStat.stat('path', {}); +const stats = fsStat.stat('path', new fsStat.Settings()); +``` + +#### path + +* Required: `true` +* Type: `string | Buffer | URL` + +A path to a file. If a URL is provided, it must use the `file:` protocol. + +#### optionsOrSettings + +* Required: `false` +* Type: `Options | Settings` +* Default: An instance of `Settings` class + +An [`Options`](#options) object or an instance of [`Settings`](#settings) class. + +> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. + +### Settings([options]) + +A class of full settings of the package. + +```ts +const settings = new fsStat.Settings({ followSymbolicLink: false }); + +const stats = fsStat.stat('path', settings); +``` + +## Options + +### `followSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Follow symbolic link or not. Call `fs.stat` on symbolic link if `true`. + +### `markSymbolicLink` + +* Type: `boolean` +* Default: `false` + +Mark symbolic link by setting the return value of `isSymbolicLink` function to always `true` (even after `fs.stat`). + +> :book: Can be used if you want to know what is hidden behind a symbolic link, but still continue to know that it is a symbolic link. + +### `throwErrorOnBrokenSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. + +### `fs` + +* Type: [`FileSystemAdapter`](./src/adapters/fs.ts) +* Default: A default FS methods + +By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. + +```ts +interface FileSystemAdapter { + lstat?: typeof fs.lstat; + stat?: typeof fs.stat; + lstatSync?: typeof fs.lstatSync; + statSync?: typeof fs.statSync; +} + +const settings = new fsStat.Settings({ + fs: { lstat: fakeLstat } +}); +``` + +## Changelog + +See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts b/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts new file mode 100644 index 000000000..3af759c95 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts @@ -0,0 +1,13 @@ +/// +import * as fs from 'fs'; +import type { ErrnoException } from '../types'; +export declare type StatAsynchronousMethod = (path: string, callback: (error: ErrnoException | null, stats: fs.Stats) => void) => void; +export declare type StatSynchronousMethod = (path: string) => fs.Stats; +export interface FileSystemAdapter { + lstat: StatAsynchronousMethod; + stat: StatAsynchronousMethod; + lstatSync: StatSynchronousMethod; + statSync: StatSynchronousMethod; +} +export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter; +export declare function createFileSystemAdapter(fsMethods?: Partial): FileSystemAdapter; diff --git a/node_modules/@nodelib/fs.stat/out/adapters/fs.js b/node_modules/@nodelib/fs.stat/out/adapters/fs.js new file mode 100644 index 000000000..8dc08c8ca --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/adapters/fs.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; +const fs = require("fs"); +exports.FILE_SYSTEM_ADAPTER = { + lstat: fs.lstat, + stat: fs.stat, + lstatSync: fs.lstatSync, + statSync: fs.statSync +}; +function createFileSystemAdapter(fsMethods) { + if (fsMethods === undefined) { + return exports.FILE_SYSTEM_ADAPTER; + } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); +} +exports.createFileSystemAdapter = createFileSystemAdapter; diff --git a/node_modules/@nodelib/fs.stat/out/index.d.ts b/node_modules/@nodelib/fs.stat/out/index.d.ts new file mode 100644 index 000000000..f95db995c --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/index.d.ts @@ -0,0 +1,12 @@ +import type { FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod } from './adapters/fs'; +import * as async from './providers/async'; +import Settings, { Options } from './settings'; +import type { Stats } from './types'; +declare type AsyncCallback = async.AsyncCallback; +declare function stat(path: string, callback: AsyncCallback): void; +declare function stat(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; +declare namespace stat { + function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise; +} +declare function statSync(path: string, optionsOrSettings?: Options | Settings): Stats; +export { Settings, stat, statSync, AsyncCallback, FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod, Options, Stats }; diff --git a/node_modules/@nodelib/fs.stat/out/index.js b/node_modules/@nodelib/fs.stat/out/index.js new file mode 100644 index 000000000..b23f7510d --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/index.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.statSync = exports.stat = exports.Settings = void 0; +const async = require("./providers/async"); +const sync = require("./providers/sync"); +const settings_1 = require("./settings"); +exports.Settings = settings_1.default; +function stat(path, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + async.read(path, getSettings(), optionsOrSettingsOrCallback); + return; + } + async.read(path, getSettings(optionsOrSettingsOrCallback), callback); +} +exports.stat = stat; +function statSync(path, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + return sync.read(path, settings); +} +exports.statSync = statSync; +function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); +} diff --git a/node_modules/@nodelib/fs.stat/out/providers/async.d.ts b/node_modules/@nodelib/fs.stat/out/providers/async.d.ts new file mode 100644 index 000000000..85423ce11 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/async.d.ts @@ -0,0 +1,4 @@ +import type Settings from '../settings'; +import type { ErrnoException, Stats } from '../types'; +export declare type AsyncCallback = (error: ErrnoException, stats: Stats) => void; +export declare function read(path: string, settings: Settings, callback: AsyncCallback): void; diff --git a/node_modules/@nodelib/fs.stat/out/providers/async.js b/node_modules/@nodelib/fs.stat/out/providers/async.js new file mode 100644 index 000000000..983ff0e6c --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/async.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.read = void 0; +function read(path, settings, callback) { + settings.fs.lstat(path, (lstatError, lstat) => { + if (lstatError !== null) { + callFailureCallback(callback, lstatError); + return; + } + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + callSuccessCallback(callback, lstat); + return; + } + settings.fs.stat(path, (statError, stat) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + callFailureCallback(callback, statError); + return; + } + callSuccessCallback(callback, lstat); + return; + } + if (settings.markSymbolicLink) { + stat.isSymbolicLink = () => true; + } + callSuccessCallback(callback, stat); + }); + }); +} +exports.read = read; +function callFailureCallback(callback, error) { + callback(error); +} +function callSuccessCallback(callback, result) { + callback(null, result); +} diff --git a/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts b/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts new file mode 100644 index 000000000..428c3d792 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts @@ -0,0 +1,3 @@ +import type Settings from '../settings'; +import type { Stats } from '../types'; +export declare function read(path: string, settings: Settings): Stats; diff --git a/node_modules/@nodelib/fs.stat/out/providers/sync.js b/node_modules/@nodelib/fs.stat/out/providers/sync.js new file mode 100644 index 000000000..1521c3616 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/sync.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.read = void 0; +function read(path, settings) { + const lstat = settings.fs.lstatSync(path); + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + return lstat; + } + try { + const stat = settings.fs.statSync(path); + if (settings.markSymbolicLink) { + stat.isSymbolicLink = () => true; + } + return stat; + } + catch (error) { + if (!settings.throwErrorOnBrokenSymbolicLink) { + return lstat; + } + throw error; + } +} +exports.read = read; diff --git a/node_modules/@nodelib/fs.stat/out/settings.d.ts b/node_modules/@nodelib/fs.stat/out/settings.d.ts new file mode 100644 index 000000000..f4b3d4443 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/settings.d.ts @@ -0,0 +1,16 @@ +import * as fs from './adapters/fs'; +export interface Options { + followSymbolicLink?: boolean; + fs?: Partial; + markSymbolicLink?: boolean; + throwErrorOnBrokenSymbolicLink?: boolean; +} +export default class Settings { + private readonly _options; + readonly followSymbolicLink: boolean; + readonly fs: fs.FileSystemAdapter; + readonly markSymbolicLink: boolean; + readonly throwErrorOnBrokenSymbolicLink: boolean; + constructor(_options?: Options); + private _getValue; +} diff --git a/node_modules/@nodelib/fs.stat/out/settings.js b/node_modules/@nodelib/fs.stat/out/settings.js new file mode 100644 index 000000000..111ec09ca --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/settings.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const fs = require("./adapters/fs"); +class Settings { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); + this.fs = fs.createFileSystemAdapter(this._options.fs); + this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +} +exports.default = Settings; diff --git a/node_modules/@nodelib/fs.stat/out/types/index.d.ts b/node_modules/@nodelib/fs.stat/out/types/index.d.ts new file mode 100644 index 000000000..74c08ed2f --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/types/index.d.ts @@ -0,0 +1,4 @@ +/// +import type * as fs from 'fs'; +export declare type Stats = fs.Stats; +export declare type ErrnoException = NodeJS.ErrnoException; diff --git a/node_modules/@nodelib/fs.stat/out/types/index.js b/node_modules/@nodelib/fs.stat/out/types/index.js new file mode 100644 index 000000000..c8ad2e549 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/types/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nodelib/fs.stat/package.json b/node_modules/@nodelib/fs.stat/package.json new file mode 100644 index 000000000..f2540c289 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/package.json @@ -0,0 +1,37 @@ +{ + "name": "@nodelib/fs.stat", + "version": "2.0.5", + "description": "Get the status of a file with some features", + "license": "MIT", + "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat", + "keywords": [ + "NodeLib", + "fs", + "FileSystem", + "file system", + "stat" + ], + "engines": { + "node": ">= 8" + }, + "files": [ + "out/**", + "!out/**/*.map", + "!out/**/*.spec.*" + ], + "main": "out/index.js", + "typings": "out/index.d.ts", + "scripts": { + "clean": "rimraf {tsconfig.tsbuildinfo,out}", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc -b .", + "compile:watch": "tsc -p . --watch --sourceMap", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile:watch" + }, + "devDependencies": { + "@nodelib/fs.macchiato": "1.0.4" + }, + "gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562" +} diff --git a/node_modules/@nodelib/fs.walk/LICENSE b/node_modules/@nodelib/fs.walk/LICENSE new file mode 100644 index 000000000..65a999460 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@nodelib/fs.walk/README.md b/node_modules/@nodelib/fs.walk/README.md new file mode 100644 index 000000000..6ccc08db4 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/README.md @@ -0,0 +1,215 @@ +# @nodelib/fs.walk + +> A library for efficiently walking a directory recursively. + +## :bulb: Highlights + +* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional). +* :rocket: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type for performance reasons. See [`old` and `modern` mode](https://github.com/nodelib/nodelib/blob/master/packages/fs/fs.scandir/README.md#old-and-modern-mode). +* :gear: Built-in directories/files and error filtering system. +* :link: Can safely work with broken symbolic links. + +## Install + +```console +npm install @nodelib/fs.walk +``` + +## Usage + +```ts +import * as fsWalk from '@nodelib/fs.walk'; + +fsWalk.walk('path', (error, entries) => { /* … */ }); +``` + +## API + +### .walk(path, [optionsOrSettings], callback) + +Reads the directory recursively and asynchronously. Requires a callback function. + +> :book: If you want to use the Promise API, use `util.promisify`. + +```ts +fsWalk.walk('path', (error, entries) => { /* … */ }); +fsWalk.walk('path', {}, (error, entries) => { /* … */ }); +fsWalk.walk('path', new fsWalk.Settings(), (error, entries) => { /* … */ }); +``` + +### .walkStream(path, [optionsOrSettings]) + +Reads the directory recursively and asynchronously. [Readable Stream](https://nodejs.org/dist/latest-v12.x/docs/api/stream.html#stream_readable_streams) is used as a provider. + +```ts +const stream = fsWalk.walkStream('path'); +const stream = fsWalk.walkStream('path', {}); +const stream = fsWalk.walkStream('path', new fsWalk.Settings()); +``` + +### .walkSync(path, [optionsOrSettings]) + +Reads the directory recursively and synchronously. Returns an array of entries. + +```ts +const entries = fsWalk.walkSync('path'); +const entries = fsWalk.walkSync('path', {}); +const entries = fsWalk.walkSync('path', new fsWalk.Settings()); +``` + +#### path + +* Required: `true` +* Type: `string | Buffer | URL` + +A path to a file. If a URL is provided, it must use the `file:` protocol. + +#### optionsOrSettings + +* Required: `false` +* Type: `Options | Settings` +* Default: An instance of `Settings` class + +An [`Options`](#options) object or an instance of [`Settings`](#settings) class. + +> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. + +### Settings([options]) + +A class of full settings of the package. + +```ts +const settings = new fsWalk.Settings({ followSymbolicLinks: true }); + +const entries = fsWalk.walkSync('path', settings); +``` + +## Entry + +* `name` — The name of the entry (`unknown.txt`). +* `path` — The path of the entry relative to call directory (`root/unknown.txt`). +* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. +* [`stats`] — An instance of `fs.Stats` class. + +## Options + +### basePath + +* Type: `string` +* Default: `undefined` + +By default, all paths are built relative to the root path. You can use this option to set custom root path. + +In the example below we read the files from the `root` directory, but in the results the root path will be `custom`. + +```ts +fsWalk.walkSync('root'); // → ['root/file.txt'] +fsWalk.walkSync('root', { basePath: 'custom' }); // → ['custom/file.txt'] +``` + +### concurrency + +* Type: `number` +* Default: `Infinity` + +The maximum number of concurrent calls to `fs.readdir`. + +> :book: The higher the number, the higher performance and the load on the File System. If you want to read in quiet mode, set the value to `4 * os.cpus().length` (4 is default size of [thread pool work scheduling](http://docs.libuv.org/en/v1.x/threadpool.html#thread-pool-work-scheduling)). + +### deepFilter + +* Type: [`DeepFilterFunction`](./src/settings.ts) +* Default: `undefined` + +A function that indicates whether the directory will be read deep or not. + +```ts +// Skip all directories that starts with `node_modules` +const filter: DeepFilterFunction = (entry) => !entry.path.startsWith('node_modules'); +``` + +### entryFilter + +* Type: [`EntryFilterFunction`](./src/settings.ts) +* Default: `undefined` + +A function that indicates whether the entry will be included to results or not. + +```ts +// Exclude all `.js` files from results +const filter: EntryFilterFunction = (entry) => !entry.name.endsWith('.js'); +``` + +### errorFilter + +* Type: [`ErrorFilterFunction`](./src/settings.ts) +* Default: `undefined` + +A function that allows you to skip errors that occur when reading directories. + +For example, you can skip `ENOENT` errors if required: + +```ts +// Skip all ENOENT errors +const filter: ErrorFilterFunction = (error) => error.code == 'ENOENT'; +``` + +### stats + +* Type: `boolean` +* Default: `false` + +Adds an instance of `fs.Stats` class to the [`Entry`](#entry). + +> :book: Always use `fs.readdir` with additional `fs.lstat/fs.stat` calls to determine the entry type. + +### followSymbolicLinks + +* Type: `boolean` +* Default: `false` + +Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`. + +### `throwErrorOnBrokenSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. + +### `pathSegmentSeparator` + +* Type: `string` +* Default: `path.sep` + +By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead. + +### `fs` + +* Type: `FileSystemAdapter` +* Default: A default FS methods + +By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. + +```ts +interface FileSystemAdapter { + lstat: typeof fs.lstat; + stat: typeof fs.stat; + lstatSync: typeof fs.lstatSync; + statSync: typeof fs.statSync; + readdir: typeof fs.readdir; + readdirSync: typeof fs.readdirSync; +} + +const settings = new fsWalk.Settings({ + fs: { lstat: fakeLstat } +}); +``` + +## Changelog + +See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.walk/out/index.d.ts b/node_modules/@nodelib/fs.walk/out/index.d.ts new file mode 100644 index 000000000..8864c7bff --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/index.d.ts @@ -0,0 +1,14 @@ +/// +import type { Readable } from 'stream'; +import type { Dirent, FileSystemAdapter } from '@nodelib/fs.scandir'; +import { AsyncCallback } from './providers/async'; +import Settings, { DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction, Options } from './settings'; +import type { Entry } from './types'; +declare function walk(directory: string, callback: AsyncCallback): void; +declare function walk(directory: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; +declare namespace walk { + function __promisify__(directory: string, optionsOrSettings?: Options | Settings): Promise; +} +declare function walkSync(directory: string, optionsOrSettings?: Options | Settings): Entry[]; +declare function walkStream(directory: string, optionsOrSettings?: Options | Settings): Readable; +export { walk, walkSync, walkStream, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, Options, DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction }; diff --git a/node_modules/@nodelib/fs.walk/out/index.js b/node_modules/@nodelib/fs.walk/out/index.js new file mode 100644 index 000000000..15207874a --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/index.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; +const async_1 = require("./providers/async"); +const stream_1 = require("./providers/stream"); +const sync_1 = require("./providers/sync"); +const settings_1 = require("./settings"); +exports.Settings = settings_1.default; +function walk(directory, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback); + return; + } + new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback); +} +exports.walk = walk; +function walkSync(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new sync_1.default(directory, settings); + return provider.read(); +} +exports.walkSync = walkSync; +function walkStream(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new stream_1.default(directory, settings); + return provider.read(); +} +exports.walkStream = walkStream; +function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/async.d.ts b/node_modules/@nodelib/fs.walk/out/providers/async.d.ts new file mode 100644 index 000000000..0f6717d78 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/async.d.ts @@ -0,0 +1,12 @@ +import AsyncReader from '../readers/async'; +import type Settings from '../settings'; +import type { Entry, Errno } from '../types'; +export declare type AsyncCallback = (error: Errno, entries: Entry[]) => void; +export default class AsyncProvider { + private readonly _root; + private readonly _settings; + protected readonly _reader: AsyncReader; + private readonly _storage; + constructor(_root: string, _settings: Settings); + read(callback: AsyncCallback): void; +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/async.js b/node_modules/@nodelib/fs.walk/out/providers/async.js new file mode 100644 index 000000000..51d3be51a --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/async.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const async_1 = require("../readers/async"); +class AsyncProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._storage = []; + } + read(callback) { + this._reader.onError((error) => { + callFailureCallback(callback, error); + }); + this._reader.onEntry((entry) => { + this._storage.push(entry); + }); + this._reader.onEnd(() => { + callSuccessCallback(callback, this._storage); + }); + this._reader.read(); + } +} +exports.default = AsyncProvider; +function callFailureCallback(callback, error) { + callback(error); +} +function callSuccessCallback(callback, entries) { + callback(null, entries); +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/index.d.ts b/node_modules/@nodelib/fs.walk/out/providers/index.d.ts new file mode 100644 index 000000000..874f60c5a --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/index.d.ts @@ -0,0 +1,4 @@ +import AsyncProvider from './async'; +import StreamProvider from './stream'; +import SyncProvider from './sync'; +export { AsyncProvider, StreamProvider, SyncProvider }; diff --git a/node_modules/@nodelib/fs.walk/out/providers/index.js b/node_modules/@nodelib/fs.walk/out/providers/index.js new file mode 100644 index 000000000..4c2529ce8 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SyncProvider = exports.StreamProvider = exports.AsyncProvider = void 0; +const async_1 = require("./async"); +exports.AsyncProvider = async_1.default; +const stream_1 = require("./stream"); +exports.StreamProvider = stream_1.default; +const sync_1 = require("./sync"); +exports.SyncProvider = sync_1.default; diff --git a/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts b/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts new file mode 100644 index 000000000..294185f85 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts @@ -0,0 +1,12 @@ +/// +import { Readable } from 'stream'; +import AsyncReader from '../readers/async'; +import type Settings from '../settings'; +export default class StreamProvider { + private readonly _root; + private readonly _settings; + protected readonly _reader: AsyncReader; + protected readonly _stream: Readable; + constructor(_root: string, _settings: Settings); + read(): Readable; +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/stream.js b/node_modules/@nodelib/fs.walk/out/providers/stream.js new file mode 100644 index 000000000..51298b0f5 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/stream.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const stream_1 = require("stream"); +const async_1 = require("../readers/async"); +class StreamProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._stream = new stream_1.Readable({ + objectMode: true, + read: () => { }, + destroy: () => { + if (!this._reader.isDestroyed) { + this._reader.destroy(); + } + } + }); + } + read() { + this._reader.onError((error) => { + this._stream.emit('error', error); + }); + this._reader.onEntry((entry) => { + this._stream.push(entry); + }); + this._reader.onEnd(() => { + this._stream.push(null); + }); + this._reader.read(); + return this._stream; + } +} +exports.default = StreamProvider; diff --git a/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts b/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts new file mode 100644 index 000000000..551c42e41 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts @@ -0,0 +1,10 @@ +import SyncReader from '../readers/sync'; +import type Settings from '../settings'; +import type { Entry } from '../types'; +export default class SyncProvider { + private readonly _root; + private readonly _settings; + protected readonly _reader: SyncReader; + constructor(_root: string, _settings: Settings); + read(): Entry[]; +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/sync.js b/node_modules/@nodelib/fs.walk/out/providers/sync.js new file mode 100644 index 000000000..faab6ca2a --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/sync.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const sync_1 = require("../readers/sync"); +class SyncProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new sync_1.default(this._root, this._settings); + } + read() { + return this._reader.read(); + } +} +exports.default = SyncProvider; diff --git a/node_modules/@nodelib/fs.walk/out/readers/async.d.ts b/node_modules/@nodelib/fs.walk/out/readers/async.d.ts new file mode 100644 index 000000000..9acf4e6c2 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/async.d.ts @@ -0,0 +1,30 @@ +/// +import { EventEmitter } from 'events'; +import * as fsScandir from '@nodelib/fs.scandir'; +import type Settings from '../settings'; +import type { Entry, Errno } from '../types'; +import Reader from './reader'; +declare type EntryEventCallback = (entry: Entry) => void; +declare type ErrorEventCallback = (error: Errno) => void; +declare type EndEventCallback = () => void; +export default class AsyncReader extends Reader { + protected readonly _settings: Settings; + protected readonly _scandir: typeof fsScandir.scandir; + protected readonly _emitter: EventEmitter; + private readonly _queue; + private _isFatalError; + private _isDestroyed; + constructor(_root: string, _settings: Settings); + read(): EventEmitter; + get isDestroyed(): boolean; + destroy(): void; + onEntry(callback: EntryEventCallback): void; + onError(callback: ErrorEventCallback): void; + onEnd(callback: EndEventCallback): void; + private _pushToQueue; + private _worker; + private _handleError; + private _handleEntry; + private _emitEntry; +} +export {}; diff --git a/node_modules/@nodelib/fs.walk/out/readers/async.js b/node_modules/@nodelib/fs.walk/out/readers/async.js new file mode 100644 index 000000000..ebe8dd573 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/async.js @@ -0,0 +1,97 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const events_1 = require("events"); +const fsScandir = require("@nodelib/fs.scandir"); +const fastq = require("fastq"); +const common = require("./common"); +const reader_1 = require("./reader"); +class AsyncReader extends reader_1.default { + constructor(_root, _settings) { + super(_root, _settings); + this._settings = _settings; + this._scandir = fsScandir.scandir; + this._emitter = new events_1.EventEmitter(); + this._queue = fastq(this._worker.bind(this), this._settings.concurrency); + this._isFatalError = false; + this._isDestroyed = false; + this._queue.drain = () => { + if (!this._isFatalError) { + this._emitter.emit('end'); + } + }; + } + read() { + this._isFatalError = false; + this._isDestroyed = false; + setImmediate(() => { + this._pushToQueue(this._root, this._settings.basePath); + }); + return this._emitter; + } + get isDestroyed() { + return this._isDestroyed; + } + destroy() { + if (this._isDestroyed) { + throw new Error('The reader is already destroyed'); + } + this._isDestroyed = true; + this._queue.killAndDrain(); + } + onEntry(callback) { + this._emitter.on('entry', callback); + } + onError(callback) { + this._emitter.once('error', callback); + } + onEnd(callback) { + this._emitter.once('end', callback); + } + _pushToQueue(directory, base) { + const queueItem = { directory, base }; + this._queue.push(queueItem, (error) => { + if (error !== null) { + this._handleError(error); + } + }); + } + _worker(item, done) { + this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => { + if (error !== null) { + done(error, undefined); + return; + } + for (const entry of entries) { + this._handleEntry(entry, item.base); + } + done(null, undefined); + }); + } + _handleError(error) { + if (this._isDestroyed || !common.isFatalError(this._settings, error)) { + return; + } + this._isFatalError = true; + this._isDestroyed = true; + this._emitter.emit('error', error); + } + _handleEntry(entry, base) { + if (this._isDestroyed || this._isFatalError) { + return; + } + const fullpath = entry.path; + if (base !== undefined) { + entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common.isAppliedFilter(this._settings.entryFilter, entry)) { + this._emitEntry(entry); + } + if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); + } + } + _emitEntry(entry) { + this._emitter.emit('entry', entry); + } +} +exports.default = AsyncReader; diff --git a/node_modules/@nodelib/fs.walk/out/readers/common.d.ts b/node_modules/@nodelib/fs.walk/out/readers/common.d.ts new file mode 100644 index 000000000..5985f97c4 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/common.d.ts @@ -0,0 +1,7 @@ +import type { FilterFunction } from '../settings'; +import type Settings from '../settings'; +import type { Errno } from '../types'; +export declare function isFatalError(settings: Settings, error: Errno): boolean; +export declare function isAppliedFilter(filter: FilterFunction | null, value: T): boolean; +export declare function replacePathSegmentSeparator(filepath: string, separator: string): string; +export declare function joinPathSegments(a: string, b: string, separator: string): string; diff --git a/node_modules/@nodelib/fs.walk/out/readers/common.js b/node_modules/@nodelib/fs.walk/out/readers/common.js new file mode 100644 index 000000000..a93572f48 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/common.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0; +function isFatalError(settings, error) { + if (settings.errorFilter === null) { + return true; + } + return !settings.errorFilter(error); +} +exports.isFatalError = isFatalError; +function isAppliedFilter(filter, value) { + return filter === null || filter(value); +} +exports.isAppliedFilter = isAppliedFilter; +function replacePathSegmentSeparator(filepath, separator) { + return filepath.split(/[/\\]/).join(separator); +} +exports.replacePathSegmentSeparator = replacePathSegmentSeparator; +function joinPathSegments(a, b, separator) { + if (a === '') { + return b; + } + /** + * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). + */ + if (a.endsWith(separator)) { + return a + b; + } + return a + separator + b; +} +exports.joinPathSegments = joinPathSegments; diff --git a/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts b/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts new file mode 100644 index 000000000..e1f383b25 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts @@ -0,0 +1,6 @@ +import type Settings from '../settings'; +export default class Reader { + protected readonly _root: string; + protected readonly _settings: Settings; + constructor(_root: string, _settings: Settings); +} diff --git a/node_modules/@nodelib/fs.walk/out/readers/reader.js b/node_modules/@nodelib/fs.walk/out/readers/reader.js new file mode 100644 index 000000000..782f07cbf --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/reader.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const common = require("./common"); +class Reader { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator); + } +} +exports.default = Reader; diff --git a/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts b/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts new file mode 100644 index 000000000..af4103353 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts @@ -0,0 +1,15 @@ +import * as fsScandir from '@nodelib/fs.scandir'; +import type { Entry } from '../types'; +import Reader from './reader'; +export default class SyncReader extends Reader { + protected readonly _scandir: typeof fsScandir.scandirSync; + private readonly _storage; + private readonly _queue; + read(): Entry[]; + private _pushToQueue; + private _handleQueue; + private _handleDirectory; + private _handleError; + private _handleEntry; + private _pushToStorage; +} diff --git a/node_modules/@nodelib/fs.walk/out/readers/sync.js b/node_modules/@nodelib/fs.walk/out/readers/sync.js new file mode 100644 index 000000000..9a8d5a6f1 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/sync.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const fsScandir = require("@nodelib/fs.scandir"); +const common = require("./common"); +const reader_1 = require("./reader"); +class SyncReader extends reader_1.default { + constructor() { + super(...arguments); + this._scandir = fsScandir.scandirSync; + this._storage = []; + this._queue = new Set(); + } + read() { + this._pushToQueue(this._root, this._settings.basePath); + this._handleQueue(); + return this._storage; + } + _pushToQueue(directory, base) { + this._queue.add({ directory, base }); + } + _handleQueue() { + for (const item of this._queue.values()) { + this._handleDirectory(item.directory, item.base); + } + } + _handleDirectory(directory, base) { + try { + const entries = this._scandir(directory, this._settings.fsScandirSettings); + for (const entry of entries) { + this._handleEntry(entry, base); + } + } + catch (error) { + this._handleError(error); + } + } + _handleError(error) { + if (!common.isFatalError(this._settings, error)) { + return; + } + throw error; + } + _handleEntry(entry, base) { + const fullpath = entry.path; + if (base !== undefined) { + entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common.isAppliedFilter(this._settings.entryFilter, entry)) { + this._pushToStorage(entry); + } + if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); + } + } + _pushToStorage(entry) { + this._storage.push(entry); + } +} +exports.default = SyncReader; diff --git a/node_modules/@nodelib/fs.walk/out/settings.d.ts b/node_modules/@nodelib/fs.walk/out/settings.d.ts new file mode 100644 index 000000000..d1c4b45f6 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/settings.d.ts @@ -0,0 +1,30 @@ +import * as fsScandir from '@nodelib/fs.scandir'; +import type { Entry, Errno } from './types'; +export declare type FilterFunction = (value: T) => boolean; +export declare type DeepFilterFunction = FilterFunction; +export declare type EntryFilterFunction = FilterFunction; +export declare type ErrorFilterFunction = FilterFunction; +export interface Options { + basePath?: string; + concurrency?: number; + deepFilter?: DeepFilterFunction; + entryFilter?: EntryFilterFunction; + errorFilter?: ErrorFilterFunction; + followSymbolicLinks?: boolean; + fs?: Partial; + pathSegmentSeparator?: string; + stats?: boolean; + throwErrorOnBrokenSymbolicLink?: boolean; +} +export default class Settings { + private readonly _options; + readonly basePath?: string; + readonly concurrency: number; + readonly deepFilter: DeepFilterFunction | null; + readonly entryFilter: EntryFilterFunction | null; + readonly errorFilter: ErrorFilterFunction | null; + readonly pathSegmentSeparator: string; + readonly fsScandirSettings: fsScandir.Settings; + constructor(_options?: Options); + private _getValue; +} diff --git a/node_modules/@nodelib/fs.walk/out/settings.js b/node_modules/@nodelib/fs.walk/out/settings.js new file mode 100644 index 000000000..d7a85c81e --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/settings.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const path = require("path"); +const fsScandir = require("@nodelib/fs.scandir"); +class Settings { + constructor(_options = {}) { + this._options = _options; + this.basePath = this._getValue(this._options.basePath, undefined); + this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY); + this.deepFilter = this._getValue(this._options.deepFilter, null); + this.entryFilter = this._getValue(this._options.entryFilter, null); + this.errorFilter = this._getValue(this._options.errorFilter, null); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); + this.fsScandirSettings = new fsScandir.Settings({ + followSymbolicLinks: this._options.followSymbolicLinks, + fs: this._options.fs, + pathSegmentSeparator: this._options.pathSegmentSeparator, + stats: this._options.stats, + throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink + }); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +} +exports.default = Settings; diff --git a/node_modules/@nodelib/fs.walk/out/types/index.d.ts b/node_modules/@nodelib/fs.walk/out/types/index.d.ts new file mode 100644 index 000000000..6ee9bd3f9 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/types/index.d.ts @@ -0,0 +1,8 @@ +/// +import type * as scandir from '@nodelib/fs.scandir'; +export declare type Entry = scandir.Entry; +export declare type Errno = NodeJS.ErrnoException; +export interface QueueItem { + directory: string; + base?: string; +} diff --git a/node_modules/@nodelib/fs.walk/out/types/index.js b/node_modules/@nodelib/fs.walk/out/types/index.js new file mode 100644 index 000000000..c8ad2e549 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/types/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nodelib/fs.walk/package.json b/node_modules/@nodelib/fs.walk/package.json new file mode 100644 index 000000000..86bfce48b --- /dev/null +++ b/node_modules/@nodelib/fs.walk/package.json @@ -0,0 +1,44 @@ +{ + "name": "@nodelib/fs.walk", + "version": "1.2.8", + "description": "A library for efficiently walking a directory recursively", + "license": "MIT", + "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.walk", + "keywords": [ + "NodeLib", + "fs", + "FileSystem", + "file system", + "walk", + "scanner", + "crawler" + ], + "engines": { + "node": ">= 8" + }, + "files": [ + "out/**", + "!out/**/*.map", + "!out/**/*.spec.*", + "!out/**/tests/**" + ], + "main": "out/index.js", + "typings": "out/index.d.ts", + "scripts": { + "clean": "rimraf {tsconfig.tsbuildinfo,out}", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc -b .", + "compile:watch": "tsc -p . --watch --sourceMap", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile:watch" + }, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "devDependencies": { + "@nodelib/fs.macchiato": "1.0.4" + }, + "gitHead": "1e5bad48565da2b06b8600e744324ea240bf49d8" +} diff --git a/node_modules/acorn-jsx/LICENSE b/node_modules/acorn-jsx/LICENSE new file mode 100644 index 000000000..695d4b930 --- /dev/null +++ b/node_modules/acorn-jsx/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2012-2017 by Ingvar Stepanyan + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/acorn-jsx/README.md b/node_modules/acorn-jsx/README.md new file mode 100644 index 000000000..317c3ac4a --- /dev/null +++ b/node_modules/acorn-jsx/README.md @@ -0,0 +1,40 @@ +# Acorn-JSX + +[![Build Status](https://travis-ci.org/acornjs/acorn-jsx.svg?branch=master)](https://travis-ci.org/acornjs/acorn-jsx) +[![NPM version](https://img.shields.io/npm/v/acorn-jsx.svg)](https://www.npmjs.org/package/acorn-jsx) + +This is plugin for [Acorn](http://marijnhaverbeke.nl/acorn/) - a tiny, fast JavaScript parser, written completely in JavaScript. + +It was created as an experimental alternative, faster [React.js JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) parser. Later, it replaced the [official parser](https://github.com/facebookarchive/esprima) and these days is used by many prominent development tools. + +## Transpiler + +Please note that this tool only parses source code to JSX AST, which is useful for various language tools and services. If you want to transpile your code to regular ES5-compliant JavaScript with source map, check out [Babel](https://babeljs.io/) and [Buble](https://buble.surge.sh/) transpilers which use `acorn-jsx` under the hood. + +## Usage + +Requiring this module provides you with an Acorn plugin that you can use like this: + +```javascript +var acorn = require("acorn"); +var jsx = require("acorn-jsx"); +acorn.Parser.extend(jsx()).parse("my(, 'code');"); +``` + +Note that official spec doesn't support mix of XML namespaces and object-style access in tag names (#27) like in ``, so it was deprecated in `acorn-jsx@3.0`. If you still want to opt-in to support of such constructions, you can pass the following option: + +```javascript +acorn.Parser.extend(jsx({ allowNamespacedObjects: true })) +``` + +Also, since most apps use pure React transformer, a new option was introduced that allows to prohibit namespaces completely: + +```javascript +acorn.Parser.extend(jsx({ allowNamespaces: false })) +``` + +Note that by default `allowNamespaces` is enabled for spec compliancy. + +## License + +This plugin is issued under the [MIT license](./LICENSE). diff --git a/node_modules/acorn-jsx/index.d.ts b/node_modules/acorn-jsx/index.d.ts new file mode 100644 index 000000000..f37b1df4c --- /dev/null +++ b/node_modules/acorn-jsx/index.d.ts @@ -0,0 +1,12 @@ +import { Parser } from 'acorn' + +declare const jsx: (options?: jsx.Options) => (BaseParser: typeof Parser) => typeof Parser; + +declare namespace jsx { + interface Options { + allowNamespacedObjects?: boolean; + allowNamespaces?: boolean; + } +} + +export = jsx; diff --git a/node_modules/acorn-jsx/index.js b/node_modules/acorn-jsx/index.js new file mode 100644 index 000000000..004e08090 --- /dev/null +++ b/node_modules/acorn-jsx/index.js @@ -0,0 +1,488 @@ +'use strict'; + +const XHTMLEntities = require('./xhtml'); + +const hexNumber = /^[\da-fA-F]+$/; +const decimalNumber = /^\d+$/; + +// The map to `acorn-jsx` tokens from `acorn` namespace objects. +const acornJsxMap = new WeakMap(); + +// Get the original tokens for the given `acorn` namespace object. +function getJsxTokens(acorn) { + acorn = acorn.Parser.acorn || acorn; + let acornJsx = acornJsxMap.get(acorn); + if (!acornJsx) { + const tt = acorn.tokTypes; + const TokContext = acorn.TokContext; + const TokenType = acorn.TokenType; + const tc_oTag = new TokContext('...', true, true); + const tokContexts = { + tc_oTag: tc_oTag, + tc_cTag: tc_cTag, + tc_expr: tc_expr + }; + const tokTypes = { + jsxName: new TokenType('jsxName'), + jsxText: new TokenType('jsxText', {beforeExpr: true}), + jsxTagStart: new TokenType('jsxTagStart', {startsExpr: true}), + jsxTagEnd: new TokenType('jsxTagEnd') + }; + + tokTypes.jsxTagStart.updateContext = function() { + this.context.push(tc_expr); // treat as beginning of JSX expression + this.context.push(tc_oTag); // start opening tag context + this.exprAllowed = false; + }; + tokTypes.jsxTagEnd.updateContext = function(prevType) { + let out = this.context.pop(); + if (out === tc_oTag && prevType === tt.slash || out === tc_cTag) { + this.context.pop(); + this.exprAllowed = this.curContext() === tc_expr; + } else { + this.exprAllowed = true; + } + }; + + acornJsx = { tokContexts: tokContexts, tokTypes: tokTypes }; + acornJsxMap.set(acorn, acornJsx); + } + + return acornJsx; +} + +// Transforms JSX element name to string. + +function getQualifiedJSXName(object) { + if (!object) + return object; + + if (object.type === 'JSXIdentifier') + return object.name; + + if (object.type === 'JSXNamespacedName') + return object.namespace.name + ':' + object.name.name; + + if (object.type === 'JSXMemberExpression') + return getQualifiedJSXName(object.object) + '.' + + getQualifiedJSXName(object.property); +} + +module.exports = function(options) { + options = options || {}; + return function(Parser) { + return plugin({ + allowNamespaces: options.allowNamespaces !== false, + allowNamespacedObjects: !!options.allowNamespacedObjects + }, Parser); + }; +}; + +// This is `tokTypes` of the peer dep. +// This can be different instances from the actual `tokTypes` this plugin uses. +Object.defineProperty(module.exports, "tokTypes", { + get: function get_tokTypes() { + return getJsxTokens(require("acorn")).tokTypes; + }, + configurable: true, + enumerable: true +}); + +function plugin(options, Parser) { + const acorn = Parser.acorn || require("acorn"); + const acornJsx = getJsxTokens(acorn); + const tt = acorn.tokTypes; + const tok = acornJsx.tokTypes; + const tokContexts = acorn.tokContexts; + const tc_oTag = acornJsx.tokContexts.tc_oTag; + const tc_cTag = acornJsx.tokContexts.tc_cTag; + const tc_expr = acornJsx.tokContexts.tc_expr; + const isNewLine = acorn.isNewLine; + const isIdentifierStart = acorn.isIdentifierStart; + const isIdentifierChar = acorn.isIdentifierChar; + + return class extends Parser { + // Expose actual `tokTypes` and `tokContexts` to other plugins. + static get acornJsx() { + return acornJsx; + } + + // Reads inline JSX contents token. + jsx_readToken() { + let out = '', chunkStart = this.pos; + for (;;) { + if (this.pos >= this.input.length) + this.raise(this.start, 'Unterminated JSX contents'); + let ch = this.input.charCodeAt(this.pos); + + switch (ch) { + case 60: // '<' + case 123: // '{' + if (this.pos === this.start) { + if (ch === 60 && this.exprAllowed) { + ++this.pos; + return this.finishToken(tok.jsxTagStart); + } + return this.getTokenFromCode(ch); + } + out += this.input.slice(chunkStart, this.pos); + return this.finishToken(tok.jsxText, out); + + case 38: // '&' + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readEntity(); + chunkStart = this.pos; + break; + + case 62: // '>' + case 125: // '}' + this.raise( + this.pos, + "Unexpected token `" + this.input[this.pos] + "`. Did you mean `" + + (ch === 62 ? ">" : "}") + "` or " + "`{\"" + this.input[this.pos] + "\"}" + "`?" + ); + + default: + if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readNewLine(true); + chunkStart = this.pos; + } else { + ++this.pos; + } + } + } + } + + jsx_readNewLine(normalizeCRLF) { + let ch = this.input.charCodeAt(this.pos); + let out; + ++this.pos; + if (ch === 13 && this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + out = normalizeCRLF ? '\n' : '\r\n'; + } else { + out = String.fromCharCode(ch); + } + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + + return out; + } + + jsx_readString(quote) { + let out = '', chunkStart = ++this.pos; + for (;;) { + if (this.pos >= this.input.length) + this.raise(this.start, 'Unterminated string constant'); + let ch = this.input.charCodeAt(this.pos); + if (ch === quote) break; + if (ch === 38) { // '&' + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readEntity(); + chunkStart = this.pos; + } else if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readNewLine(false); + chunkStart = this.pos; + } else { + ++this.pos; + } + } + out += this.input.slice(chunkStart, this.pos++); + return this.finishToken(tt.string, out); + } + + jsx_readEntity() { + let str = '', count = 0, entity; + let ch = this.input[this.pos]; + if (ch !== '&') + this.raise(this.pos, 'Entity must start with an ampersand'); + let startPos = ++this.pos; + while (this.pos < this.input.length && count++ < 10) { + ch = this.input[this.pos++]; + if (ch === ';') { + if (str[0] === '#') { + if (str[1] === 'x') { + str = str.substr(2); + if (hexNumber.test(str)) + entity = String.fromCharCode(parseInt(str, 16)); + } else { + str = str.substr(1); + if (decimalNumber.test(str)) + entity = String.fromCharCode(parseInt(str, 10)); + } + } else { + entity = XHTMLEntities[str]; + } + break; + } + str += ch; + } + if (!entity) { + this.pos = startPos; + return '&'; + } + return entity; + } + + // Read a JSX identifier (valid tag or attribute name). + // + // Optimized version since JSX identifiers can't contain + // escape characters and so can be read as single slice. + // Also assumes that first character was already checked + // by isIdentifierStart in readToken. + + jsx_readWord() { + let ch, start = this.pos; + do { + ch = this.input.charCodeAt(++this.pos); + } while (isIdentifierChar(ch) || ch === 45); // '-' + return this.finishToken(tok.jsxName, this.input.slice(start, this.pos)); + } + + // Parse next token as JSX identifier + + jsx_parseIdentifier() { + let node = this.startNode(); + if (this.type === tok.jsxName) + node.name = this.value; + else if (this.type.keyword) + node.name = this.type.keyword; + else + this.unexpected(); + this.next(); + return this.finishNode(node, 'JSXIdentifier'); + } + + // Parse namespaced identifier. + + jsx_parseNamespacedName() { + let startPos = this.start, startLoc = this.startLoc; + let name = this.jsx_parseIdentifier(); + if (!options.allowNamespaces || !this.eat(tt.colon)) return name; + var node = this.startNodeAt(startPos, startLoc); + node.namespace = name; + node.name = this.jsx_parseIdentifier(); + return this.finishNode(node, 'JSXNamespacedName'); + } + + // Parses element name in any form - namespaced, member + // or single identifier. + + jsx_parseElementName() { + if (this.type === tok.jsxTagEnd) return ''; + let startPos = this.start, startLoc = this.startLoc; + let node = this.jsx_parseNamespacedName(); + if (this.type === tt.dot && node.type === 'JSXNamespacedName' && !options.allowNamespacedObjects) { + this.unexpected(); + } + while (this.eat(tt.dot)) { + let newNode = this.startNodeAt(startPos, startLoc); + newNode.object = node; + newNode.property = this.jsx_parseIdentifier(); + node = this.finishNode(newNode, 'JSXMemberExpression'); + } + return node; + } + + // Parses any type of JSX attribute value. + + jsx_parseAttributeValue() { + switch (this.type) { + case tt.braceL: + let node = this.jsx_parseExpressionContainer(); + if (node.expression.type === 'JSXEmptyExpression') + this.raise(node.start, 'JSX attributes must only be assigned a non-empty expression'); + return node; + + case tok.jsxTagStart: + case tt.string: + return this.parseExprAtom(); + + default: + this.raise(this.start, 'JSX value should be either an expression or a quoted JSX text'); + } + } + + // JSXEmptyExpression is unique type since it doesn't actually parse anything, + // and so it should start at the end of last read token (left brace) and finish + // at the beginning of the next one (right brace). + + jsx_parseEmptyExpression() { + let node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc); + return this.finishNodeAt(node, 'JSXEmptyExpression', this.start, this.startLoc); + } + + // Parses JSX expression enclosed into curly brackets. + + jsx_parseExpressionContainer() { + let node = this.startNode(); + this.next(); + node.expression = this.type === tt.braceR + ? this.jsx_parseEmptyExpression() + : this.parseExpression(); + this.expect(tt.braceR); + return this.finishNode(node, 'JSXExpressionContainer'); + } + + // Parses following JSX attribute name-value pair. + + jsx_parseAttribute() { + let node = this.startNode(); + if (this.eat(tt.braceL)) { + this.expect(tt.ellipsis); + node.argument = this.parseMaybeAssign(); + this.expect(tt.braceR); + return this.finishNode(node, 'JSXSpreadAttribute'); + } + node.name = this.jsx_parseNamespacedName(); + node.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null; + return this.finishNode(node, 'JSXAttribute'); + } + + // Parses JSX opening tag starting after '<'. + + jsx_parseOpeningElementAt(startPos, startLoc) { + let node = this.startNodeAt(startPos, startLoc); + node.attributes = []; + let nodeName = this.jsx_parseElementName(); + if (nodeName) node.name = nodeName; + while (this.type !== tt.slash && this.type !== tok.jsxTagEnd) + node.attributes.push(this.jsx_parseAttribute()); + node.selfClosing = this.eat(tt.slash); + this.expect(tok.jsxTagEnd); + return this.finishNode(node, nodeName ? 'JSXOpeningElement' : 'JSXOpeningFragment'); + } + + // Parses JSX closing tag starting after ''); + } + } + let fragmentOrElement = openingElement.name ? 'Element' : 'Fragment'; + + node['opening' + fragmentOrElement] = openingElement; + node['closing' + fragmentOrElement] = closingElement; + node.children = children; + if (this.type === tt.relational && this.value === "<") { + this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag"); + } + return this.finishNode(node, 'JSX' + fragmentOrElement); + } + + // Parse JSX text + + jsx_parseText() { + let node = this.parseLiteral(this.value); + node.type = "JSXText"; + return node; + } + + // Parses entire JSX element from current position. + + jsx_parseElement() { + let startPos = this.start, startLoc = this.startLoc; + this.next(); + return this.jsx_parseElementAt(startPos, startLoc); + } + + parseExprAtom(refShortHandDefaultPos) { + if (this.type === tok.jsxText) + return this.jsx_parseText(); + else if (this.type === tok.jsxTagStart) + return this.jsx_parseElement(); + else + return super.parseExprAtom(refShortHandDefaultPos); + } + + readToken(code) { + let context = this.curContext(); + + if (context === tc_expr) return this.jsx_readToken(); + + if (context === tc_oTag || context === tc_cTag) { + if (isIdentifierStart(code)) return this.jsx_readWord(); + + if (code == 62) { + ++this.pos; + return this.finishToken(tok.jsxTagEnd); + } + + if ((code === 34 || code === 39) && context == tc_oTag) + return this.jsx_readString(code); + } + + if (code === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33) { + ++this.pos; + return this.finishToken(tok.jsxTagStart); + } + return super.readToken(code); + } + + updateContext(prevType) { + if (this.type == tt.braceL) { + var curContext = this.curContext(); + if (curContext == tc_oTag) this.context.push(tokContexts.b_expr); + else if (curContext == tc_expr) this.context.push(tokContexts.b_tmpl); + else super.updateContext(prevType); + this.exprAllowed = true; + } else if (this.type === tt.slash && prevType === tok.jsxTagStart) { + this.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore + this.context.push(tc_cTag); // reconsider as closing tag context + this.exprAllowed = false; + } else { + return super.updateContext(prevType); + } + } + }; +} diff --git a/node_modules/acorn-jsx/package.json b/node_modules/acorn-jsx/package.json new file mode 100644 index 000000000..6debde9ca --- /dev/null +++ b/node_modules/acorn-jsx/package.json @@ -0,0 +1,27 @@ +{ + "name": "acorn-jsx", + "description": "Modern, fast React.js JSX parser", + "homepage": "https://github.com/acornjs/acorn-jsx", + "version": "5.3.2", + "maintainers": [ + { + "name": "Ingvar Stepanyan", + "email": "me@rreverser.com", + "web": "http://rreverser.com/" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/acornjs/acorn-jsx" + }, + "license": "MIT", + "scripts": { + "test": "node test/run.js" + }, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "devDependencies": { + "acorn": "^8.0.1" + } +} diff --git a/node_modules/acorn-jsx/xhtml.js b/node_modules/acorn-jsx/xhtml.js new file mode 100644 index 000000000..c1520092f --- /dev/null +++ b/node_modules/acorn-jsx/xhtml.js @@ -0,0 +1,255 @@ +module.exports = { + quot: '\u0022', + amp: '&', + apos: '\u0027', + lt: '<', + gt: '>', + nbsp: '\u00A0', + iexcl: '\u00A1', + cent: '\u00A2', + pound: '\u00A3', + curren: '\u00A4', + yen: '\u00A5', + brvbar: '\u00A6', + sect: '\u00A7', + uml: '\u00A8', + copy: '\u00A9', + ordf: '\u00AA', + laquo: '\u00AB', + not: '\u00AC', + shy: '\u00AD', + reg: '\u00AE', + macr: '\u00AF', + deg: '\u00B0', + plusmn: '\u00B1', + sup2: '\u00B2', + sup3: '\u00B3', + acute: '\u00B4', + micro: '\u00B5', + para: '\u00B6', + middot: '\u00B7', + cedil: '\u00B8', + sup1: '\u00B9', + ordm: '\u00BA', + raquo: '\u00BB', + frac14: '\u00BC', + frac12: '\u00BD', + frac34: '\u00BE', + iquest: '\u00BF', + Agrave: '\u00C0', + Aacute: '\u00C1', + Acirc: '\u00C2', + Atilde: '\u00C3', + Auml: '\u00C4', + Aring: '\u00C5', + AElig: '\u00C6', + Ccedil: '\u00C7', + Egrave: '\u00C8', + Eacute: '\u00C9', + Ecirc: '\u00CA', + Euml: '\u00CB', + Igrave: '\u00CC', + Iacute: '\u00CD', + Icirc: '\u00CE', + Iuml: '\u00CF', + ETH: '\u00D0', + Ntilde: '\u00D1', + Ograve: '\u00D2', + Oacute: '\u00D3', + Ocirc: '\u00D4', + Otilde: '\u00D5', + Ouml: '\u00D6', + times: '\u00D7', + Oslash: '\u00D8', + Ugrave: '\u00D9', + Uacute: '\u00DA', + Ucirc: '\u00DB', + Uuml: '\u00DC', + Yacute: '\u00DD', + THORN: '\u00DE', + szlig: '\u00DF', + agrave: '\u00E0', + aacute: '\u00E1', + acirc: '\u00E2', + atilde: '\u00E3', + auml: '\u00E4', + aring: '\u00E5', + aelig: '\u00E6', + ccedil: '\u00E7', + egrave: '\u00E8', + eacute: '\u00E9', + ecirc: '\u00EA', + euml: '\u00EB', + igrave: '\u00EC', + iacute: '\u00ED', + icirc: '\u00EE', + iuml: '\u00EF', + eth: '\u00F0', + ntilde: '\u00F1', + ograve: '\u00F2', + oacute: '\u00F3', + ocirc: '\u00F4', + otilde: '\u00F5', + ouml: '\u00F6', + divide: '\u00F7', + oslash: '\u00F8', + ugrave: '\u00F9', + uacute: '\u00FA', + ucirc: '\u00FB', + uuml: '\u00FC', + yacute: '\u00FD', + thorn: '\u00FE', + yuml: '\u00FF', + OElig: '\u0152', + oelig: '\u0153', + Scaron: '\u0160', + scaron: '\u0161', + Yuml: '\u0178', + fnof: '\u0192', + circ: '\u02C6', + tilde: '\u02DC', + Alpha: '\u0391', + Beta: '\u0392', + Gamma: '\u0393', + Delta: '\u0394', + Epsilon: '\u0395', + Zeta: '\u0396', + Eta: '\u0397', + Theta: '\u0398', + Iota: '\u0399', + Kappa: '\u039A', + Lambda: '\u039B', + Mu: '\u039C', + Nu: '\u039D', + Xi: '\u039E', + Omicron: '\u039F', + Pi: '\u03A0', + Rho: '\u03A1', + Sigma: '\u03A3', + Tau: '\u03A4', + Upsilon: '\u03A5', + Phi: '\u03A6', + Chi: '\u03A7', + Psi: '\u03A8', + Omega: '\u03A9', + alpha: '\u03B1', + beta: '\u03B2', + gamma: '\u03B3', + delta: '\u03B4', + epsilon: '\u03B5', + zeta: '\u03B6', + eta: '\u03B7', + theta: '\u03B8', + iota: '\u03B9', + kappa: '\u03BA', + lambda: '\u03BB', + mu: '\u03BC', + nu: '\u03BD', + xi: '\u03BE', + omicron: '\u03BF', + pi: '\u03C0', + rho: '\u03C1', + sigmaf: '\u03C2', + sigma: '\u03C3', + tau: '\u03C4', + upsilon: '\u03C5', + phi: '\u03C6', + chi: '\u03C7', + psi: '\u03C8', + omega: '\u03C9', + thetasym: '\u03D1', + upsih: '\u03D2', + piv: '\u03D6', + ensp: '\u2002', + emsp: '\u2003', + thinsp: '\u2009', + zwnj: '\u200C', + zwj: '\u200D', + lrm: '\u200E', + rlm: '\u200F', + ndash: '\u2013', + mdash: '\u2014', + lsquo: '\u2018', + rsquo: '\u2019', + sbquo: '\u201A', + ldquo: '\u201C', + rdquo: '\u201D', + bdquo: '\u201E', + dagger: '\u2020', + Dagger: '\u2021', + bull: '\u2022', + hellip: '\u2026', + permil: '\u2030', + prime: '\u2032', + Prime: '\u2033', + lsaquo: '\u2039', + rsaquo: '\u203A', + oline: '\u203E', + frasl: '\u2044', + euro: '\u20AC', + image: '\u2111', + weierp: '\u2118', + real: '\u211C', + trade: '\u2122', + alefsym: '\u2135', + larr: '\u2190', + uarr: '\u2191', + rarr: '\u2192', + darr: '\u2193', + harr: '\u2194', + crarr: '\u21B5', + lArr: '\u21D0', + uArr: '\u21D1', + rArr: '\u21D2', + dArr: '\u21D3', + hArr: '\u21D4', + forall: '\u2200', + part: '\u2202', + exist: '\u2203', + empty: '\u2205', + nabla: '\u2207', + isin: '\u2208', + notin: '\u2209', + ni: '\u220B', + prod: '\u220F', + sum: '\u2211', + minus: '\u2212', + lowast: '\u2217', + radic: '\u221A', + prop: '\u221D', + infin: '\u221E', + ang: '\u2220', + and: '\u2227', + or: '\u2228', + cap: '\u2229', + cup: '\u222A', + 'int': '\u222B', + there4: '\u2234', + sim: '\u223C', + cong: '\u2245', + asymp: '\u2248', + ne: '\u2260', + equiv: '\u2261', + le: '\u2264', + ge: '\u2265', + sub: '\u2282', + sup: '\u2283', + nsub: '\u2284', + sube: '\u2286', + supe: '\u2287', + oplus: '\u2295', + otimes: '\u2297', + perp: '\u22A5', + sdot: '\u22C5', + lceil: '\u2308', + rceil: '\u2309', + lfloor: '\u230A', + rfloor: '\u230B', + lang: '\u2329', + rang: '\u232A', + loz: '\u25CA', + spades: '\u2660', + clubs: '\u2663', + hearts: '\u2665', + diams: '\u2666' +}; diff --git a/node_modules/acorn/CHANGELOG.md b/node_modules/acorn/CHANGELOG.md new file mode 100644 index 000000000..ea8d6c04d --- /dev/null +++ b/node_modules/acorn/CHANGELOG.md @@ -0,0 +1,810 @@ +## 8.8.0 (2022-07-21) + +### Bug fixes + +Allow parentheses around spread args in destructuring object assignment. + +Fix an issue where the tree contained `directive` properties in when parsing with a language version that doesn't support them. + +### New features + +Support hashbang comments by default in ECMAScript 2023 and later. + +## 8.7.1 (2021-04-26) + +### Bug fixes + +Stop handling `"use strict"` directives in ECMAScript versions before 5. + +Fix an issue where duplicate quoted export names in `export *` syntax were incorrectly checked. + +Add missing type for `tokTypes`. + +## 8.7.0 (2021-12-27) + +### New features + +Support quoted export names. + +Upgrade to Unicode 14. + +Add support for Unicode 13 properties in regular expressions. + +### Bug fixes + +Use a loop to find line breaks, because the existing regexp search would overrun the end of the searched range and waste a lot of time in minified code. + +## 8.6.0 (2021-11-18) + +### Bug fixes + +Fix a bug where an object literal with multiple `__proto__` properties would incorrectly be accepted if a later property value held an assigment. + +### New features + +Support class private fields with the `in` operator. + +## 8.5.0 (2021-09-06) + +### Bug fixes + +Improve context-dependent tokenization in a number of corner cases. + +Fix location tracking after a 0x2028 or 0x2029 character in a string literal (which before did not increase the line number). + +Fix an issue where arrow function bodies in for loop context would inappropriately consume `in` operators. + +Fix wrong end locations stored on SequenceExpression nodes. + +Implement restriction that `for`/`of` loop LHS can't start with `let`. + +### New features + +Add support for ES2022 class static blocks. + +Allow multiple input files to be passed to the CLI tool. + +## 8.4.1 (2021-06-24) + +### Bug fixes + +Fix a bug where `allowAwaitOutsideFunction` would allow `await` in class field initializers, and setting `ecmaVersion` to 13 or higher would allow top-level await in non-module sources. + +## 8.4.0 (2021-06-11) + +### New features + +A new option, `allowSuperOutsideMethod`, can be used to suppress the error when `super` is used in the wrong context. + +## 8.3.0 (2021-05-31) + +### New features + +Default `allowAwaitOutsideFunction` to true for ECMAScript 2022 an higher. + +Add support for the `d` ([indices](https://github.com/tc39/proposal-regexp-match-indices)) regexp flag. + +## 8.2.4 (2021-05-04) + +### Bug fixes + +Fix spec conformity in corner case 'for await (async of ...)'. + +## 8.2.3 (2021-05-04) + +### Bug fixes + +Fix an issue where the library couldn't parse 'for (async of ...)'. + +Fix a bug in UTF-16 decoding that would read characters incorrectly in some circumstances. + +## 8.2.2 (2021-04-29) + +### Bug fixes + +Fix a bug where a class field initialized to an async arrow function wouldn't allow await inside it. Same issue existed for generator arrow functions with yield. + +## 8.2.1 (2021-04-24) + +### Bug fixes + +Fix a regression introduced in 8.2.0 where static or async class methods with keyword names fail to parse. + +## 8.2.0 (2021-04-24) + +### New features + +Add support for ES2022 class fields and private methods. + +## 8.1.1 (2021-04-12) + +### Various + +Stop shipping source maps in the NPM package. + +## 8.1.0 (2021-03-09) + +### Bug fixes + +Fix a spurious error in nested destructuring arrays. + +### New features + +Expose `allowAwaitOutsideFunction` in CLI interface. + +Make `allowImportExportAnywhere` also apply to `import.meta`. + +## 8.0.5 (2021-01-25) + +### Bug fixes + +Adjust package.json to work with Node 12.16.0 and 13.0-13.6. + +## 8.0.4 (2020-10-05) + +### Bug fixes + +Make `await x ** y` an error, following the spec. + +Fix potentially exponential regular expression. + +## 8.0.3 (2020-10-02) + +### Bug fixes + +Fix a wasteful loop during `Parser` creation when setting `ecmaVersion` to `"latest"`. + +## 8.0.2 (2020-09-30) + +### Bug fixes + +Make the TypeScript types reflect the current allowed values for `ecmaVersion`. + +Fix another regexp/division tokenizer issue. + +## 8.0.1 (2020-08-12) + +### Bug fixes + +Provide the correct value in the `version` export. + +## 8.0.0 (2020-08-12) + +### Bug fixes + +Disallow expressions like `(a = b) = c`. + +Make non-octal escape sequences a syntax error in strict mode. + +### New features + +The package can now be loaded directly as an ECMAScript module in node 13+. + +Update to the set of Unicode properties from ES2021. + +### Breaking changes + +The `ecmaVersion` option is now required. For the moment, omitting it will still work with a warning, but that will change in a future release. + +Some changes to method signatures that may be used by plugins. + +## 7.4.0 (2020-08-03) + +### New features + +Add support for logical assignment operators. + +Add support for numeric separators. + +## 7.3.1 (2020-06-11) + +### Bug fixes + +Make the string in the `version` export match the actual library version. + +## 7.3.0 (2020-06-11) + +### Bug fixes + +Fix a bug that caused parsing of object patterns with a property named `set` that had a default value to fail. + +### New features + +Add support for optional chaining (`?.`). + +## 7.2.0 (2020-05-09) + +### Bug fixes + +Fix precedence issue in parsing of async arrow functions. + +### New features + +Add support for nullish coalescing. + +Add support for `import.meta`. + +Support `export * as ...` syntax. + +Upgrade to Unicode 13. + +## 6.4.1 (2020-03-09) + +### Bug fixes + +More carefully check for valid UTF16 surrogate pairs in regexp validator. + +## 7.1.1 (2020-03-01) + +### Bug fixes + +Treat `\8` and `\9` as invalid escapes in template strings. + +Allow unicode escapes in property names that are keywords. + +Don't error on an exponential operator expression as argument to `await`. + +More carefully check for valid UTF16 surrogate pairs in regexp validator. + +## 7.1.0 (2019-09-24) + +### Bug fixes + +Disallow trailing object literal commas when ecmaVersion is less than 5. + +### New features + +Add a static `acorn` property to the `Parser` class that contains the entire module interface, to allow plugins to access the instance of the library that they are acting on. + +## 7.0.0 (2019-08-13) + +### Breaking changes + +Changes the node format for dynamic imports to use the `ImportExpression` node type, as defined in [ESTree](https://github.com/estree/estree/blob/master/es2020.md#importexpression). + +Makes 10 (ES2019) the default value for the `ecmaVersion` option. + +## 6.3.0 (2019-08-12) + +### New features + +`sourceType: "module"` can now be used even when `ecmaVersion` is less than 6, to parse module-style code that otherwise conforms to an older standard. + +## 6.2.1 (2019-07-21) + +### Bug fixes + +Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such. + +Fix issue where setting the `allowReserved` option to `"never"` allowed reserved words in some circumstances. + +## 6.2.0 (2019-07-04) + +### Bug fixes + +Improve valid assignment checking in `for`/`in` and `for`/`of` loops. + +Disallow binding `let` in patterns. + +### New features + +Support bigint syntax with `ecmaVersion` >= 11. + +Support dynamic `import` syntax with `ecmaVersion` >= 11. + +Upgrade to Unicode version 12. + +## 6.1.1 (2019-02-27) + +### Bug fixes + +Fix bug that caused parsing default exports of with names to fail. + +## 6.1.0 (2019-02-08) + +### Bug fixes + +Fix scope checking when redefining a `var` as a lexical binding. + +### New features + +Split up `parseSubscripts` to use an internal `parseSubscript` method to make it easier to extend with plugins. + +## 6.0.7 (2019-02-04) + +### Bug fixes + +Check that exported bindings are defined. + +Don't treat `\u180e` as a whitespace character. + +Check for duplicate parameter names in methods. + +Don't allow shorthand properties when they are generators or async methods. + +Forbid binding `await` in async arrow function's parameter list. + +## 6.0.6 (2019-01-30) + +### Bug fixes + +The content of class declarations and expressions is now always parsed in strict mode. + +Don't allow `let` or `const` to bind the variable name `let`. + +Treat class declarations as lexical. + +Don't allow a generator function declaration as the sole body of an `if` or `else`. + +Ignore `"use strict"` when after an empty statement. + +Allow string line continuations with special line terminator characters. + +Treat `for` bodies as part of the `for` scope when checking for conflicting bindings. + +Fix bug with parsing `yield` in a `for` loop initializer. + +Implement special cases around scope checking for functions. + +## 6.0.5 (2019-01-02) + +### Bug fixes + +Fix TypeScript type for `Parser.extend` and add `allowAwaitOutsideFunction` to options type. + +Don't treat `let` as a keyword when the next token is `{` on the next line. + +Fix bug that broke checking for parentheses around an object pattern in a destructuring assignment when `preserveParens` was on. + +## 6.0.4 (2018-11-05) + +### Bug fixes + +Further improvements to tokenizing regular expressions in corner cases. + +## 6.0.3 (2018-11-04) + +### Bug fixes + +Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression. + +Remove stray symlink in the package tarball. + +## 6.0.2 (2018-09-26) + +### Bug fixes + +Fix bug where default expressions could fail to parse inside an object destructuring assignment expression. + +## 6.0.1 (2018-09-14) + +### Bug fixes + +Fix wrong value in `version` export. + +## 6.0.0 (2018-09-14) + +### Bug fixes + +Better handle variable-redefinition checks for catch bindings and functions directly under if statements. + +Forbid `new.target` in top-level arrow functions. + +Fix issue with parsing a regexp after `yield` in some contexts. + +### New features + +The package now comes with TypeScript definitions. + +### Breaking changes + +The default value of the `ecmaVersion` option is now 9 (2018). + +Plugins work differently, and will have to be rewritten to work with this version. + +The loose parser and walker have been moved into separate packages (`acorn-loose` and `acorn-walk`). + +## 5.7.3 (2018-09-10) + +### Bug fixes + +Fix failure to tokenize regexps after expressions like `x.of`. + +Better error message for unterminated template literals. + +## 5.7.2 (2018-08-24) + +### Bug fixes + +Properly handle `allowAwaitOutsideFunction` in for statements. + +Treat function declarations at the top level of modules like let bindings. + +Don't allow async function declarations as the only statement under a label. + +## 5.7.0 (2018-06-15) + +### New features + +Upgraded to Unicode 11. + +## 5.6.0 (2018-05-31) + +### New features + +Allow U+2028 and U+2029 in string when ECMAVersion >= 10. + +Allow binding-less catch statements when ECMAVersion >= 10. + +Add `allowAwaitOutsideFunction` option for parsing top-level `await`. + +## 5.5.3 (2018-03-08) + +### Bug fixes + +A _second_ republish of the code in 5.5.1, this time with yarn, to hopefully get valid timestamps. + +## 5.5.2 (2018-03-08) + +### Bug fixes + +A republish of the code in 5.5.1 in an attempt to solve an issue with the file timestamps in the npm package being 0. + +## 5.5.1 (2018-03-06) + +### Bug fixes + +Fix misleading error message for octal escapes in template strings. + +## 5.5.0 (2018-02-27) + +### New features + +The identifier character categorization is now based on Unicode version 10. + +Acorn will now validate the content of regular expressions, including new ES9 features. + +## 5.4.0 (2018-02-01) + +### Bug fixes + +Disallow duplicate or escaped flags on regular expressions. + +Disallow octal escapes in strings in strict mode. + +### New features + +Add support for async iteration. + +Add support for object spread and rest. + +## 5.3.0 (2017-12-28) + +### Bug fixes + +Fix parsing of floating point literals with leading zeroes in loose mode. + +Allow duplicate property names in object patterns. + +Don't allow static class methods named `prototype`. + +Disallow async functions directly under `if` or `else`. + +Parse right-hand-side of `for`/`of` as an assignment expression. + +Stricter parsing of `for`/`in`. + +Don't allow unicode escapes in contextual keywords. + +### New features + +Parsing class members was factored into smaller methods to allow plugins to hook into it. + +## 5.2.1 (2017-10-30) + +### Bug fixes + +Fix a token context corruption bug. + +## 5.2.0 (2017-10-30) + +### Bug fixes + +Fix token context tracking for `class` and `function` in property-name position. + +Make sure `%*` isn't parsed as a valid operator. + +Allow shorthand properties `get` and `set` to be followed by default values. + +Disallow `super` when not in callee or object position. + +### New features + +Support [`directive` property](https://github.com/estree/estree/compare/b3de58c9997504d6fba04b72f76e6dd1619ee4eb...1da8e603237144f44710360f8feb7a9977e905e0) on directive expression statements. + +## 5.1.2 (2017-09-04) + +### Bug fixes + +Disable parsing of legacy HTML-style comments in modules. + +Fix parsing of async methods whose names are keywords. + +## 5.1.1 (2017-07-06) + +### Bug fixes + +Fix problem with disambiguating regexp and division after a class. + +## 5.1.0 (2017-07-05) + +### Bug fixes + +Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`. + +Parse zero-prefixed numbers with non-octal digits as decimal. + +Allow object/array patterns in rest parameters. + +Don't error when `yield` is used as a property name. + +Allow `async` as a shorthand object property. + +### New features + +Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9. + +## 5.0.3 (2017-04-01) + +### Bug fixes + +Fix spurious duplicate variable definition errors for named functions. + +## 5.0.2 (2017-03-30) + +### Bug fixes + +A binary operator after a parenthesized arrow expression is no longer incorrectly treated as an error. + +## 5.0.0 (2017-03-28) + +### Bug fixes + +Raise an error for duplicated lexical bindings. + +Fix spurious error when an assignement expression occurred after a spread expression. + +Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions. + +Allow labels in front or `var` declarations, even in strict mode. + +### Breaking changes + +Parse declarations following `export default` as declaration nodes, not expressions. This means that class and function declarations nodes can now have `null` as their `id`. + +## 4.0.11 (2017-02-07) + +### Bug fixes + +Allow all forms of member expressions to be parenthesized as lvalue. + +## 4.0.10 (2017-02-07) + +### Bug fixes + +Don't expect semicolons after default-exported functions or classes, even when they are expressions. + +Check for use of `'use strict'` directives in non-simple parameter functions, even when already in strict mode. + +## 4.0.9 (2017-02-06) + +### Bug fixes + +Fix incorrect error raised for parenthesized simple assignment targets, so that `(x) = 1` parses again. + +## 4.0.8 (2017-02-03) + +### Bug fixes + +Solve spurious parenthesized pattern errors by temporarily erring on the side of accepting programs that our delayed errors don't handle correctly yet. + +## 4.0.7 (2017-02-02) + +### Bug fixes + +Accept invalidly rejected code like `(x).y = 2` again. + +Don't raise an error when a function _inside_ strict code has a non-simple parameter list. + +## 4.0.6 (2017-02-02) + +### Bug fixes + +Fix exponential behavior (manifesting itself as a complete hang for even relatively small source files) introduced by the new 'use strict' check. + +## 4.0.5 (2017-02-02) + +### Bug fixes + +Disallow parenthesized pattern expressions. + +Allow keywords as export names. + +Don't allow the `async` keyword to be parenthesized. + +Properly raise an error when a keyword contains a character escape. + +Allow `"use strict"` to appear after other string literal expressions. + +Disallow labeled declarations. + +## 4.0.4 (2016-12-19) + +### Bug fixes + +Fix crash when `export` was followed by a keyword that can't be +exported. + +## 4.0.3 (2016-08-16) + +### Bug fixes + +Allow regular function declarations inside single-statement `if` branches in loose mode. Forbid them entirely in strict mode. + +Properly parse properties named `async` in ES2017 mode. + +Fix bug where reserved words were broken in ES2017 mode. + +## 4.0.2 (2016-08-11) + +### Bug fixes + +Don't ignore period or 'e' characters after octal numbers. + +Fix broken parsing for call expressions in default parameter values of arrow functions. + +## 4.0.1 (2016-08-08) + +### Bug fixes + +Fix false positives in duplicated export name errors. + +## 4.0.0 (2016-08-07) + +### Breaking changes + +The default `ecmaVersion` option value is now 7. + +A number of internal method signatures changed, so plugins might need to be updated. + +### Bug fixes + +The parser now raises errors on duplicated export names. + +`arguments` and `eval` can now be used in shorthand properties. + +Duplicate parameter names in non-simple argument lists now always produce an error. + +### New features + +The `ecmaVersion` option now also accepts year-style version numbers +(2015, etc). + +Support for `async`/`await` syntax when `ecmaVersion` is >= 8. + +Support for trailing commas in call expressions when `ecmaVersion` is >= 8. + +## 3.3.0 (2016-07-25) + +### Bug fixes + +Fix bug in tokenizing of regexp operator after a function declaration. + +Fix parser crash when parsing an array pattern with a hole. + +### New features + +Implement check against complex argument lists in functions that enable strict mode in ES7. + +## 3.2.0 (2016-06-07) + +### Bug fixes + +Improve handling of lack of unicode regexp support in host +environment. + +Properly reject shorthand properties whose name is a keyword. + +### New features + +Visitors created with `visit.make` now have their base as _prototype_, rather than copying properties into a fresh object. + +## 3.1.0 (2016-04-18) + +### Bug fixes + +Properly tokenize the division operator directly after a function expression. + +Allow trailing comma in destructuring arrays. + +## 3.0.4 (2016-02-25) + +### Fixes + +Allow update expressions as left-hand-side of the ES7 exponential operator. + +## 3.0.2 (2016-02-10) + +### Fixes + +Fix bug that accidentally made `undefined` a reserved word when parsing ES7. + +## 3.0.0 (2016-02-10) + +### Breaking changes + +The default value of the `ecmaVersion` option is now 6 (used to be 5). + +Support for comprehension syntax (which was dropped from the draft spec) has been removed. + +### Fixes + +`let` and `yield` are now “contextual keywords”, meaning you can mostly use them as identifiers in ES5 non-strict code. + +A parenthesized class or function expression after `export default` is now parsed correctly. + +### New features + +When `ecmaVersion` is set to 7, Acorn will parse the exponentiation operator (`**`). + +The identifier character ranges are now based on Unicode 8.0.0. + +Plugins can now override the `raiseRecoverable` method to override the way non-critical errors are handled. + +## 2.7.0 (2016-01-04) + +### Fixes + +Stop allowing rest parameters in setters. + +Disallow `y` rexexp flag in ES5. + +Disallow `\00` and `\000` escapes in strict mode. + +Raise an error when an import name is a reserved word. + +## 2.6.2 (2015-11-10) + +### Fixes + +Don't crash when no options object is passed. + +## 2.6.0 (2015-11-09) + +### Fixes + +Add `await` as a reserved word in module sources. + +Disallow `yield` in a parameter default value for a generator. + +Forbid using a comma after a rest pattern in an array destructuring. + +### New features + +Support parsing stdin in command-line tool. + +## 2.5.0 (2015-10-27) + +### Fixes + +Fix tokenizer support in the command-line tool. + +Stop allowing `new.target` outside of functions. + +Remove legacy `guard` and `guardedHandler` properties from try nodes. + +Stop allowing multiple `__proto__` properties on an object literal in strict mode. + +Don't allow rest parameters to be non-identifier patterns. + +Check for duplicate paramter names in arrow functions. diff --git a/node_modules/acorn/LICENSE b/node_modules/acorn/LICENSE new file mode 100644 index 000000000..9d71cc63a --- /dev/null +++ b/node_modules/acorn/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (C) 2012-2022 by various contributors (see AUTHORS) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/acorn/README.md b/node_modules/acorn/README.md new file mode 100644 index 000000000..61e7dd35e --- /dev/null +++ b/node_modules/acorn/README.md @@ -0,0 +1,273 @@ +# Acorn + +A tiny, fast JavaScript parser written in JavaScript. + +## Community + +Acorn is open source software released under an +[MIT license](https://github.com/acornjs/acorn/blob/master/acorn/LICENSE). + +You are welcome to +[report bugs](https://github.com/acornjs/acorn/issues) or create pull +requests on [github](https://github.com/acornjs/acorn). For questions +and discussion, please use the +[Tern discussion forum](https://discuss.ternjs.net). + +## Installation + +The easiest way to install acorn is from [`npm`](https://www.npmjs.com/): + +```sh +npm install acorn +``` + +Alternately, you can download the source and build acorn yourself: + +```sh +git clone https://github.com/acornjs/acorn.git +cd acorn +npm install +``` + +## Interface + +**parse**`(input, options)` is the main interface to the library. The +`input` parameter is a string, `options` must be an object setting +some of the options listed below. The return value will be an abstract +syntax tree object as specified by the [ESTree +spec](https://github.com/estree/estree). + +```javascript +let acorn = require("acorn"); +console.log(acorn.parse("1 + 1", {ecmaVersion: 2020})); +``` + +When encountering a syntax error, the parser will raise a +`SyntaxError` object with a meaningful message. The error object will +have a `pos` property that indicates the string offset at which the +error occurred, and a `loc` object that contains a `{line, column}` +object referring to that same position. + +Options are provided by in a second argument, which should be an +object containing any of these fields (only `ecmaVersion` is +required): + +- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be + either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 (2019), + 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"` (the + latest the library supports). This influences support for strict + mode, the set of reserved words, and support for new syntax + features. + + **NOTE**: Only 'stage 4' (finalized) ECMAScript features are being + implemented by Acorn. Other proposed new features must be + implemented through plugins. + +- **sourceType**: Indicate the mode the code should be parsed in. Can be + either `"script"` or `"module"`. This influences global strict mode + and parsing of `import` and `export` declarations. + + **NOTE**: If set to `"module"`, then static `import` / `export` syntax + will be valid, even if `ecmaVersion` is less than 6. + +- **onInsertedSemicolon**: If given a callback, that callback will be + called whenever a missing semicolon is inserted by the parser. The + callback will be given the character offset of the point where the + semicolon is inserted as argument, and if `locations` is on, also a + `{line, column}` object representing this position. + +- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing + commas. + +- **allowReserved**: If `false`, using a reserved word will generate + an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher + versions. When given the value `"never"`, reserved words and + keywords can also not be used as property names (as in Internet + Explorer's old parser). + +- **allowReturnOutsideFunction**: By default, a return statement at + the top level raises an error. Set this to `true` to accept such + code. + +- **allowImportExportEverywhere**: By default, `import` and `export` + declarations can only appear at a program's top level. Setting this + option to `true` allows them anywhere where a statement is allowed, + and also allows `import.meta` expressions to appear in scripts + (when `sourceType` is not `"module"`). + +- **allowAwaitOutsideFunction**: If `false`, `await` expressions can + only appear inside `async` functions. Defaults to `true` for + `ecmaVersion` 2022 and later, `false` for lower versions. Setting this option to + `true` allows to have top-level `await` expressions. They are + still not allowed in non-`async` functions, though. + +- **allowSuperOutsideMethod**: By default, `super` outside a method + raises an error. Set this to `true` to accept such code. + +- **allowHashBang**: When this is enabled, if the code starts with the + characters `#!` (as in a shellscript), the first line will be + treated as a comment. Defaults to true when `ecmaVersion` >= 2023. + +- **locations**: When `true`, each node has a `loc` object attached + with `start` and `end` subobjects, each of which contains the + one-based line and zero-based column numbers in `{line, column}` + form. Default is `false`. + +- **onToken**: If a function is passed for this option, each found + token will be passed in same format as tokens returned from + `tokenizer().getToken()`. + + If array is passed, each found token is pushed to it. + + Note that you are not allowed to call the parser from the + callback—that will corrupt its internal state. + +- **onComment**: If a function is passed for this option, whenever a + comment is encountered the function will be called with the + following parameters: + + - `block`: `true` if the comment is a block comment, false if it + is a line comment. + - `text`: The content of the comment. + - `start`: Character offset of the start of the comment. + - `end`: Character offset of the end of the comment. + + When the `locations` options is on, the `{line, column}` locations + of the comment’s start and end are passed as two additional + parameters. + + If array is passed for this option, each found comment is pushed + to it as object in Esprima format: + + ```javascript + { + "type": "Line" | "Block", + "value": "comment text", + "start": Number, + "end": Number, + // If `locations` option is on: + "loc": { + "start": {line: Number, column: Number} + "end": {line: Number, column: Number} + }, + // If `ranges` option is on: + "range": [Number, Number] + } + ``` + + Note that you are not allowed to call the parser from the + callback—that will corrupt its internal state. + +- **ranges**: Nodes have their start and end characters offsets + recorded in `start` and `end` properties (directly on the node, + rather than the `loc` object, which holds line/column data. To also + add a + [semi-standardized](https://bugzilla.mozilla.org/show_bug.cgi?id=745678) + `range` property holding a `[start, end]` array with the same + numbers, set the `ranges` option to `true`. + +- **program**: It is possible to parse multiple files into a single + AST by passing the tree produced by parsing the first file as the + `program` option in subsequent parses. This will add the toplevel + forms of the parsed file to the "Program" (top) node of an existing + parse tree. + +- **sourceFile**: When the `locations` option is `true`, you can pass + this option to add a `source` attribute in every node’s `loc` + object. Note that the contents of this option are not examined or + processed in any way; you are free to use whatever format you + choose. + +- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property + will be added (regardless of the `location` option) directly to the + nodes, rather than the `loc` object. + +- **preserveParens**: If this option is `true`, parenthesized expressions + are represented by (non-standard) `ParenthesizedExpression` nodes + that have a single `expression` property containing the expression + inside parentheses. + +**parseExpressionAt**`(input, offset, options)` will parse a single +expression in a string, and return its AST. It will not complain if +there is more of the string left after the expression. + +**tokenizer**`(input, options)` returns an object with a `getToken` +method that can be called repeatedly to get the next token, a `{start, +end, type, value}` object (with added `loc` property when the +`locations` option is enabled and `range` property when the `ranges` +option is enabled). When the token's type is `tokTypes.eof`, you +should stop calling the method, since it will keep returning that same +token forever. + +In ES6 environment, returned result can be used as any other +protocol-compliant iterable: + +```javascript +for (let token of acorn.tokenizer(str)) { + // iterate over the tokens +} + +// transform code to array of tokens: +var tokens = [...acorn.tokenizer(str)]; +``` + +**tokTypes** holds an object mapping names to the token type objects +that end up in the `type` properties of tokens. + +**getLineInfo**`(input, offset)` can be used to get a `{line, +column}` object for a given program string and offset. + +### The `Parser` class + +Instances of the **`Parser`** class contain all the state and logic +that drives a parse. It has static methods `parse`, +`parseExpressionAt`, and `tokenizer` that match the top-level +functions by the same name. + +When extending the parser with plugins, you need to call these methods +on the extended version of the class. To extend a parser with plugins, +you can use its static `extend` method. + +```javascript +var acorn = require("acorn"); +var jsx = require("acorn-jsx"); +var JSXParser = acorn.Parser.extend(jsx()); +JSXParser.parse("foo()", {ecmaVersion: 2020}); +``` + +The `extend` method takes any number of plugin values, and returns a +new `Parser` class that includes the extra parser logic provided by +the plugins. + +## Command line interface + +The `bin/acorn` utility can be used to parse a file from the command +line. It accepts as arguments its input file and the following +options: + +- `--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|--ecma10`: Sets the ECMAScript version + to parse. Default is version 9. + +- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise. + +- `--locations`: Attaches a "loc" object to each node with "start" and + "end" subobjects, each of which contains the one-based line and + zero-based column numbers in `{line, column}` form. + +- `--allow-hash-bang`: If the code starts with the characters #! (as + in a shellscript), the first line will be treated as a comment. + +- `--allow-await-outside-function`: Allows top-level `await` expressions. + See the `allowAwaitOutsideFunction` option for more information. + +- `--compact`: No whitespace is used in the AST output. + +- `--silent`: Do not output the AST, just return the exit status. + +- `--help`: Print the usage information and quit. + +The utility spits out the syntax tree as JSON data. + +## Existing plugins + + - [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx) diff --git a/node_modules/acorn/bin/acorn b/node_modules/acorn/bin/acorn new file mode 100755 index 000000000..3ef3c124b --- /dev/null +++ b/node_modules/acorn/bin/acorn @@ -0,0 +1,4 @@ +#!/usr/bin/env node +"use strict" + +require("../dist/bin.js") diff --git a/node_modules/acorn/dist/acorn.d.ts b/node_modules/acorn/dist/acorn.d.ts new file mode 100644 index 000000000..140f6ed12 --- /dev/null +++ b/node_modules/acorn/dist/acorn.d.ts @@ -0,0 +1,252 @@ +export as namespace acorn +export = acorn + +declare namespace acorn { + function parse(input: string, options: Options): Node + + function parseExpressionAt(input: string, pos: number, options: Options): Node + + function tokenizer(input: string, options: Options): { + getToken(): Token + [Symbol.iterator](): Iterator + } + + type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 'latest' + + interface Options { + ecmaVersion: ecmaVersion + sourceType?: 'script' | 'module' + onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: Position) => void + onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: Position) => void + allowReserved?: boolean | 'never' + allowReturnOutsideFunction?: boolean + allowImportExportEverywhere?: boolean + allowAwaitOutsideFunction?: boolean + allowSuperOutsideMethod?: boolean + allowHashBang?: boolean + locations?: boolean + onToken?: ((token: Token) => any) | Token[] + onComment?: (( + isBlock: boolean, text: string, start: number, end: number, startLoc?: Position, + endLoc?: Position + ) => void) | Comment[] + ranges?: boolean + program?: Node + sourceFile?: string + directSourceFile?: string + preserveParens?: boolean + } + + class Parser { + // state.js + lineStart: number; + options: Options; + curLine: number; + start: number; + end: number; + input: string; + type: TokenType; + + // state.js + constructor(options: Options, input: string, startPos?: number) + parse(this: Parser): Node + + // tokenize.js + next(): void; + nextToken(): void; + + // statement.js + parseTopLevel(node: Node): Node; + + // node.js + finishNode(node: Node, type: string): Node; + finishNodeAt(node: Node, type: string, pos: number, loc: Position): Node; + + // location.js + raise(pos: number, message: string) : void; + raiseRecoverable?(pos: number, message: string) : void; + + // parseutils.js + unexpected(pos: number) : void; + + // index.js + static acorn: typeof acorn; + + // state.js + static parse(this: typeof Parser, input: string, options: Options): Node + static parseExpressionAt(this: typeof Parser, input: string, pos: number, options: Options): Node + static tokenizer(this: typeof Parser, input: string, options: Options): { + getToken(): Token + [Symbol.iterator](): Iterator + } + static extend(this: typeof Parser, ...plugins: ((BaseParser: typeof Parser) => typeof Parser)[]): typeof Parser + } + + interface Position { line: number; column: number; offset: number } + + const defaultOptions: Options + + function getLineInfo(input: string, offset: number): Position + + class SourceLocation { + start: Position + end: Position + source?: string | null + constructor(p: Parser, start: Position, end: Position) + } + + class Node { + type: string + start: number + end: number + loc?: SourceLocation + sourceFile?: string + range?: [number, number] + constructor(parser: Parser, pos: number, loc?: SourceLocation) + } + + class TokenType { + label: string + keyword: string + beforeExpr: boolean + startsExpr: boolean + isLoop: boolean + isAssign: boolean + prefix: boolean + postfix: boolean + binop: number + updateContext?: (prevType: TokenType) => void + constructor(label: string, conf?: any) + } + + const tokTypes: { + num: TokenType + regexp: TokenType + string: TokenType + name: TokenType + privateId: TokenType + eof: TokenType + bracketL: TokenType + bracketR: TokenType + braceL: TokenType + braceR: TokenType + parenL: TokenType + parenR: TokenType + comma: TokenType + semi: TokenType + colon: TokenType + dot: TokenType + question: TokenType + questionDot: TokenType + arrow: TokenType + template: TokenType + invalidTemplate: TokenType + ellipsis: TokenType + backQuote: TokenType + dollarBraceL: TokenType + eq: TokenType + assign: TokenType + incDec: TokenType + prefix: TokenType + logicalOR: TokenType + logicalAND: TokenType + bitwiseOR: TokenType + bitwiseXOR: TokenType + bitwiseAND: TokenType + equality: TokenType + relational: TokenType + bitShift: TokenType + plusMin: TokenType + modulo: TokenType + star: TokenType + slash: TokenType + starstar: TokenType + coalesce: TokenType + _break: TokenType + _case: TokenType + _catch: TokenType + _continue: TokenType + _debugger: TokenType + _default: TokenType + _do: TokenType + _else: TokenType + _finally: TokenType + _for: TokenType + _function: TokenType + _if: TokenType + _return: TokenType + _switch: TokenType + _throw: TokenType + _try: TokenType + _var: TokenType + _const: TokenType + _while: TokenType + _with: TokenType + _new: TokenType + _this: TokenType + _super: TokenType + _class: TokenType + _extends: TokenType + _export: TokenType + _import: TokenType + _null: TokenType + _true: TokenType + _false: TokenType + _in: TokenType + _instanceof: TokenType + _typeof: TokenType + _void: TokenType + _delete: TokenType + } + + class TokContext { + constructor(token: string, isExpr: boolean, preserveSpace: boolean, override?: (p: Parser) => void) + } + + const tokContexts: { + b_stat: TokContext + b_expr: TokContext + b_tmpl: TokContext + p_stat: TokContext + p_expr: TokContext + q_tmpl: TokContext + f_expr: TokContext + f_stat: TokContext + f_expr_gen: TokContext + f_gen: TokContext + } + + function isIdentifierStart(code: number, astral?: boolean): boolean + + function isIdentifierChar(code: number, astral?: boolean): boolean + + interface AbstractToken { + } + + interface Comment extends AbstractToken { + type: string + value: string + start: number + end: number + loc?: SourceLocation + range?: [number, number] + } + + class Token { + type: TokenType + value: any + start: number + end: number + loc?: SourceLocation + range?: [number, number] + constructor(p: Parser) + } + + function isNewLine(code: number): boolean + + const lineBreak: RegExp + + const lineBreakG: RegExp + + const version: string +} diff --git a/node_modules/acorn/dist/acorn.js b/node_modules/acorn/dist/acorn.js new file mode 100644 index 000000000..8e8b225b0 --- /dev/null +++ b/node_modules/acorn/dist/acorn.js @@ -0,0 +1,5605 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.acorn = {})); +})(this, (function (exports) { 'use strict'; + + // This file was generated. Do not modify manually! + var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; + + // This file was generated. Do not modify manually! + var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; + + // This file was generated. Do not modify manually! + var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; + + // This file was generated. Do not modify manually! + var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; + + // These are a run-length and offset encoded representation of the + + // Reserved word lists for various dialects of the language + + var reservedWords = { + 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", + 5: "class enum extends super const export import", + 6: "enum", + strict: "implements interface let package private protected public static yield", + strictBind: "eval arguments" + }; + + // And the keywords + + var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; + + var keywords$1 = { + 5: ecma5AndLessKeywords, + "5module": ecma5AndLessKeywords + " export import", + 6: ecma5AndLessKeywords + " const class extends export import super" + }; + + var keywordRelationalOperator = /^in(stanceof)?$/; + + // ## Character categories + + var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); + var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); + + // This has a complexity linear to the value of the code. The + // assumption is that looking up astral identifier characters is + // rare. + function isInAstralSet(code, set) { + var pos = 0x10000; + for (var i = 0; i < set.length; i += 2) { + pos += set[i]; + if (pos > code) { return false } + pos += set[i + 1]; + if (pos >= code) { return true } + } + } + + // Test whether a given character code starts an identifier. + + function isIdentifierStart(code, astral) { + if (code < 65) { return code === 36 } + if (code < 91) { return true } + if (code < 97) { return code === 95 } + if (code < 123) { return true } + if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) } + if (astral === false) { return false } + return isInAstralSet(code, astralIdentifierStartCodes) + } + + // Test whether a given character is part of an identifier. + + function isIdentifierChar(code, astral) { + if (code < 48) { return code === 36 } + if (code < 58) { return true } + if (code < 65) { return false } + if (code < 91) { return true } + if (code < 97) { return code === 95 } + if (code < 123) { return true } + if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) } + if (astral === false) { return false } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes) + } + + // ## Token types + + // The assignment of fine-grained, information-carrying type objects + // allows the tokenizer to store the information it has about a + // token in a way that is very cheap for the parser to look up. + + // All token type variables start with an underscore, to make them + // easy to recognize. + + // The `beforeExpr` property is used to disambiguate between regular + // expressions and divisions. It is set on all token types that can + // be followed by an expression (thus, a slash after them would be a + // regular expression). + // + // The `startsExpr` property is used to check if the token ends a + // `yield` expression. It is set on all token types that either can + // directly start an expression (like a quotation mark) or can + // continue an expression (like the body of a string). + // + // `isLoop` marks a keyword as starting a loop, which is important + // to know when parsing a label, in order to allow or disallow + // continue jumps to that label. + + var TokenType = function TokenType(label, conf) { + if ( conf === void 0 ) conf = {}; + + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop || null; + this.updateContext = null; + }; + + function binop(name, prec) { + return new TokenType(name, {beforeExpr: true, binop: prec}) + } + var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true}; + + // Map keyword names to token types. + + var keywords = {}; + + // Succinct definitions of keyword token types + function kw(name, options) { + if ( options === void 0 ) options = {}; + + options.keyword = name; + return keywords[name] = new TokenType(name, options) + } + + var types$1 = { + num: new TokenType("num", startsExpr), + regexp: new TokenType("regexp", startsExpr), + string: new TokenType("string", startsExpr), + name: new TokenType("name", startsExpr), + privateId: new TokenType("privateId", startsExpr), + eof: new TokenType("eof"), + + // Punctuation token types. + bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}), + bracketR: new TokenType("]"), + braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}), + braceR: new TokenType("}"), + parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}), + parenR: new TokenType(")"), + comma: new TokenType(",", beforeExpr), + semi: new TokenType(";", beforeExpr), + colon: new TokenType(":", beforeExpr), + dot: new TokenType("."), + question: new TokenType("?", beforeExpr), + questionDot: new TokenType("?."), + arrow: new TokenType("=>", beforeExpr), + template: new TokenType("template"), + invalidTemplate: new TokenType("invalidTemplate"), + ellipsis: new TokenType("...", beforeExpr), + backQuote: new TokenType("`", startsExpr), + dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}), + + // Operators. These carry several kinds of properties to help the + // parser use them properly (the presence of these properties is + // what categorizes them as operators). + // + // `binop`, when present, specifies that this operator is a binary + // operator, and will refer to its precedence. + // + // `prefix` and `postfix` mark the operator as a prefix or postfix + // unary operator. + // + // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as + // binary operators with a very low precedence, that should result + // in AssignmentExpression nodes. + + eq: new TokenType("=", {beforeExpr: true, isAssign: true}), + assign: new TokenType("_=", {beforeExpr: true, isAssign: true}), + incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}), + prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}), + logicalOR: binop("||", 1), + logicalAND: binop("&&", 2), + bitwiseOR: binop("|", 3), + bitwiseXOR: binop("^", 4), + bitwiseAND: binop("&", 5), + equality: binop("==/!=/===/!==", 6), + relational: binop("/<=/>=", 7), + bitShift: binop("<>/>>>", 8), + plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}), + modulo: binop("%", 10), + star: binop("*", 10), + slash: binop("/", 10), + starstar: new TokenType("**", {beforeExpr: true}), + coalesce: binop("??", 1), + + // Keyword token types. + _break: kw("break"), + _case: kw("case", beforeExpr), + _catch: kw("catch"), + _continue: kw("continue"), + _debugger: kw("debugger"), + _default: kw("default", beforeExpr), + _do: kw("do", {isLoop: true, beforeExpr: true}), + _else: kw("else", beforeExpr), + _finally: kw("finally"), + _for: kw("for", {isLoop: true}), + _function: kw("function", startsExpr), + _if: kw("if"), + _return: kw("return", beforeExpr), + _switch: kw("switch"), + _throw: kw("throw", beforeExpr), + _try: kw("try"), + _var: kw("var"), + _const: kw("const"), + _while: kw("while", {isLoop: true}), + _with: kw("with"), + _new: kw("new", {beforeExpr: true, startsExpr: true}), + _this: kw("this", startsExpr), + _super: kw("super", startsExpr), + _class: kw("class", startsExpr), + _extends: kw("extends", beforeExpr), + _export: kw("export"), + _import: kw("import", startsExpr), + _null: kw("null", startsExpr), + _true: kw("true", startsExpr), + _false: kw("false", startsExpr), + _in: kw("in", {beforeExpr: true, binop: 7}), + _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}), + _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}), + _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}), + _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true}) + }; + + // Matches a whole line break (where CRLF is considered a single + // line break). Used to count lines. + + var lineBreak = /\r\n?|\n|\u2028|\u2029/; + var lineBreakG = new RegExp(lineBreak.source, "g"); + + function isNewLine(code) { + return code === 10 || code === 13 || code === 0x2028 || code === 0x2029 + } + + function nextLineBreak(code, from, end) { + if ( end === void 0 ) end = code.length; + + for (var i = from; i < end; i++) { + var next = code.charCodeAt(i); + if (isNewLine(next)) + { return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 } + } + return -1 + } + + var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; + + var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; + + var ref = Object.prototype; + var hasOwnProperty = ref.hasOwnProperty; + var toString = ref.toString; + + var hasOwn = Object.hasOwn || (function (obj, propName) { return ( + hasOwnProperty.call(obj, propName) + ); }); + + var isArray = Array.isArray || (function (obj) { return ( + toString.call(obj) === "[object Array]" + ); }); + + function wordsRegexp(words) { + return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") + } + + function codePointToString(code) { + // UTF-16 Decoding + if (code <= 0xFFFF) { return String.fromCharCode(code) } + code -= 0x10000; + return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00) + } + + var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; + + // These are used when `options.locations` is on, for the + // `startLoc` and `endLoc` properties. + + var Position = function Position(line, col) { + this.line = line; + this.column = col; + }; + + Position.prototype.offset = function offset (n) { + return new Position(this.line, this.column + n) + }; + + var SourceLocation = function SourceLocation(p, start, end) { + this.start = start; + this.end = end; + if (p.sourceFile !== null) { this.source = p.sourceFile; } + }; + + // The `getLineInfo` function is mostly useful when the + // `locations` option is off (for performance reasons) and you + // want to find the line/column position for a given character + // offset. `input` should be the code string that the offset refers + // into. + + function getLineInfo(input, offset) { + for (var line = 1, cur = 0;;) { + var nextBreak = nextLineBreak(input, cur, offset); + if (nextBreak < 0) { return new Position(line, offset - cur) } + ++line; + cur = nextBreak; + } + } + + // A second argument must be given to configure the parser process. + // These options are recognized (only `ecmaVersion` is required): + + var defaultOptions = { + // `ecmaVersion` indicates the ECMAScript version to parse. Must be + // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 + // (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"` + // (the latest version the library supports). This influences + // support for strict mode, the set of reserved words, and support + // for new syntax features. + ecmaVersion: null, + // `sourceType` indicates the mode the code should be parsed in. + // Can be either `"script"` or `"module"`. This influences global + // strict mode and parsing of `import` and `export` declarations. + sourceType: "script", + // `onInsertedSemicolon` can be a callback that will be called + // when a semicolon is automatically inserted. It will be passed + // the position of the comma as an offset, and if `locations` is + // enabled, it is given the location as a `{line, column}` object + // as second argument. + onInsertedSemicolon: null, + // `onTrailingComma` is similar to `onInsertedSemicolon`, but for + // trailing commas. + onTrailingComma: null, + // By default, reserved words are only enforced if ecmaVersion >= 5. + // Set `allowReserved` to a boolean value to explicitly turn this on + // an off. When this option has the value "never", reserved words + // and keywords can also not be used as property names. + allowReserved: null, + // When enabled, a return at the top level is not considered an + // error. + allowReturnOutsideFunction: false, + // When enabled, import/export statements are not constrained to + // appearing at the top of the program, and an import.meta expression + // in a script isn't considered an error. + allowImportExportEverywhere: false, + // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022. + // When enabled, await identifiers are allowed to appear at the top-level scope, + // but they are still not allowed in non-async functions. + allowAwaitOutsideFunction: null, + // When enabled, super identifiers are not constrained to + // appearing in methods and do not raise an error when they appear elsewhere. + allowSuperOutsideMethod: null, + // When enabled, hashbang directive in the beginning of file is + // allowed and treated as a line comment. Enabled by default when + // `ecmaVersion` >= 2023. + allowHashBang: false, + // When `locations` is on, `loc` properties holding objects with + // `start` and `end` properties in `{line, column}` form (with + // line being 1-based and column 0-based) will be attached to the + // nodes. + locations: false, + // A function can be passed as `onToken` option, which will + // cause Acorn to call that function with object in the same + // format as tokens returned from `tokenizer().getToken()`. Note + // that you are not allowed to call the parser from the + // callback—that will corrupt its internal state. + onToken: null, + // A function can be passed as `onComment` option, which will + // cause Acorn to call that function with `(block, text, start, + // end)` parameters whenever a comment is skipped. `block` is a + // boolean indicating whether this is a block (`/* */`) comment, + // `text` is the content of the comment, and `start` and `end` are + // character offsets that denote the start and end of the comment. + // When the `locations` option is on, two more parameters are + // passed, the full `{line, column}` locations of the start and + // end of the comments. Note that you are not allowed to call the + // parser from the callback—that will corrupt its internal state. + onComment: null, + // Nodes have their start and end characters offsets recorded in + // `start` and `end` properties (directly on the node, rather than + // the `loc` object, which holds line/column data. To also add a + // [semi-standardized][range] `range` property holding a `[start, + // end]` array with the same numbers, set the `ranges` option to + // `true`. + // + // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 + ranges: false, + // It is possible to parse multiple files into a single AST by + // passing the tree produced by parsing the first file as + // `program` option in subsequent parses. This will add the + // toplevel forms of the parsed file to the `Program` (top) node + // of an existing parse tree. + program: null, + // When `locations` is on, you can pass this to record the source + // file in every node's `loc` object. + sourceFile: null, + // This value, if given, is stored in every node, whether + // `locations` is on or off. + directSourceFile: null, + // When enabled, parenthesized expressions are represented by + // (non-standard) ParenthesizedExpression nodes + preserveParens: false + }; + + // Interpret and default an options object + + var warnedAboutEcmaVersion = false; + + function getOptions(opts) { + var options = {}; + + for (var opt in defaultOptions) + { options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; } + + if (options.ecmaVersion === "latest") { + options.ecmaVersion = 1e8; + } else if (options.ecmaVersion == null) { + if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) { + warnedAboutEcmaVersion = true; + console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future."); + } + options.ecmaVersion = 11; + } else if (options.ecmaVersion >= 2015) { + options.ecmaVersion -= 2009; + } + + if (options.allowReserved == null) + { options.allowReserved = options.ecmaVersion < 5; } + + if (opts.allowHashBang == null) + { options.allowHashBang = options.ecmaVersion >= 14; } + + if (isArray(options.onToken)) { + var tokens = options.onToken; + options.onToken = function (token) { return tokens.push(token); }; + } + if (isArray(options.onComment)) + { options.onComment = pushComment(options, options.onComment); } + + return options + } + + function pushComment(options, array) { + return function(block, text, start, end, startLoc, endLoc) { + var comment = { + type: block ? "Block" : "Line", + value: text, + start: start, + end: end + }; + if (options.locations) + { comment.loc = new SourceLocation(this, startLoc, endLoc); } + if (options.ranges) + { comment.range = [start, end]; } + array.push(comment); + } + } + + // Each scope gets a bitset that may contain these flags + var + SCOPE_TOP = 1, + SCOPE_FUNCTION = 2, + SCOPE_ASYNC = 4, + SCOPE_GENERATOR = 8, + SCOPE_ARROW = 16, + SCOPE_SIMPLE_CATCH = 32, + SCOPE_SUPER = 64, + SCOPE_DIRECT_SUPER = 128, + SCOPE_CLASS_STATIC_BLOCK = 256, + SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK; + + function functionFlags(async, generator) { + return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0) + } + + // Used in checkLVal* and declareName to determine the type of a binding + var + BIND_NONE = 0, // Not a binding + BIND_VAR = 1, // Var-style binding + BIND_LEXICAL = 2, // Let- or const-style binding + BIND_FUNCTION = 3, // Function declaration + BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding + BIND_OUTSIDE = 5; // Special case for function names as bound inside the function + + var Parser = function Parser(options, input, startPos) { + this.options = options = getOptions(options); + this.sourceFile = options.sourceFile; + this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); + var reserved = ""; + if (options.allowReserved !== true) { + reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3]; + if (options.sourceType === "module") { reserved += " await"; } + } + this.reservedWords = wordsRegexp(reserved); + var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; + this.reservedWordsStrict = wordsRegexp(reservedStrict); + this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind); + this.input = String(input); + + // Used to signal to callers of `readWord1` whether the word + // contained any escape sequences. This is needed because words with + // escape sequences must not be interpreted as keywords. + this.containsEsc = false; + + // Set up token state + + // The current position of the tokenizer in the input. + if (startPos) { + this.pos = startPos; + this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; + this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; + } else { + this.pos = this.lineStart = 0; + this.curLine = 1; + } + + // Properties of the current token: + // Its type + this.type = types$1.eof; + // For tokens that include more information than their type, the value + this.value = null; + // Its start and end offset + this.start = this.end = this.pos; + // And, if locations are used, the {line, column} object + // corresponding to those offsets + this.startLoc = this.endLoc = this.curPosition(); + + // Position information for the previous token + this.lastTokEndLoc = this.lastTokStartLoc = null; + this.lastTokStart = this.lastTokEnd = this.pos; + + // The context stack is used to superficially track syntactic + // context to predict whether a regular expression is allowed in a + // given position. + this.context = this.initialContext(); + this.exprAllowed = true; + + // Figure out if it's a module code. + this.inModule = options.sourceType === "module"; + this.strict = this.inModule || this.strictDirective(this.pos); + + // Used to signify the start of a potential arrow function + this.potentialArrowAt = -1; + this.potentialArrowInForAwait = false; + + // Positions to delayed-check that yield/await does not exist in default parameters. + this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; + // Labels in scope. + this.labels = []; + // Thus-far undefined exports. + this.undefinedExports = Object.create(null); + + // If enabled, skip leading hashbang line. + if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") + { this.skipLineComment(2); } + + // Scope tracking for duplicate variable names (see scope.js) + this.scopeStack = []; + this.enterScope(SCOPE_TOP); + + // For RegExp validation + this.regexpState = null; + + // The stack of private names. + // Each element has two properties: 'declared' and 'used'. + // When it exited from the outermost class definition, all used private names must be declared. + this.privateNameStack = []; + }; + + var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },allowNewDotTarget: { configurable: true },inClassStaticBlock: { configurable: true } }; + + Parser.prototype.parse = function parse () { + var node = this.options.program || this.startNode(); + this.nextToken(); + return this.parseTopLevel(node) + }; + + prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }; + + prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit }; + + prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit }; + + prototypeAccessors.canAwait.get = function () { + for (var i = this.scopeStack.length - 1; i >= 0; i--) { + var scope = this.scopeStack[i]; + if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) { return false } + if (scope.flags & SCOPE_FUNCTION) { return (scope.flags & SCOPE_ASYNC) > 0 } + } + return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction + }; + + prototypeAccessors.allowSuper.get = function () { + var ref = this.currentThisScope(); + var flags = ref.flags; + var inClassFieldInit = ref.inClassFieldInit; + return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod + }; + + prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }; + + prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) }; + + prototypeAccessors.allowNewDotTarget.get = function () { + var ref = this.currentThisScope(); + var flags = ref.flags; + var inClassFieldInit = ref.inClassFieldInit; + return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit + }; + + prototypeAccessors.inClassStaticBlock.get = function () { + return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0 + }; + + Parser.extend = function extend () { + var plugins = [], len = arguments.length; + while ( len-- ) plugins[ len ] = arguments[ len ]; + + var cls = this; + for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); } + return cls + }; + + Parser.parse = function parse (input, options) { + return new this(options, input).parse() + }; + + Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) { + var parser = new this(options, input, pos); + parser.nextToken(); + return parser.parseExpression() + }; + + Parser.tokenizer = function tokenizer (input, options) { + return new this(options, input) + }; + + Object.defineProperties( Parser.prototype, prototypeAccessors ); + + var pp$9 = Parser.prototype; + + // ## Parser utilities + + var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; + pp$9.strictDirective = function(start) { + if (this.options.ecmaVersion < 5) { return false } + for (;;) { + // Try to find string literal. + skipWhiteSpace.lastIndex = start; + start += skipWhiteSpace.exec(this.input)[0].length; + var match = literal.exec(this.input.slice(start)); + if (!match) { return false } + if ((match[1] || match[2]) === "use strict") { + skipWhiteSpace.lastIndex = start + match[0].length; + var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length; + var next = this.input.charAt(end); + return next === ";" || next === "}" || + (lineBreak.test(spaceAfter[0]) && + !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "=")) + } + start += match[0].length; + + // Skip semicolon, if any. + skipWhiteSpace.lastIndex = start; + start += skipWhiteSpace.exec(this.input)[0].length; + if (this.input[start] === ";") + { start++; } + } + }; + + // Predicate that tests whether the next token is of the given + // type, and if yes, consumes it as a side effect. + + pp$9.eat = function(type) { + if (this.type === type) { + this.next(); + return true + } else { + return false + } + }; + + // Tests whether parsed token is a contextual keyword. + + pp$9.isContextual = function(name) { + return this.type === types$1.name && this.value === name && !this.containsEsc + }; + + // Consumes contextual keyword if possible. + + pp$9.eatContextual = function(name) { + if (!this.isContextual(name)) { return false } + this.next(); + return true + }; + + // Asserts that following token is given contextual keyword. + + pp$9.expectContextual = function(name) { + if (!this.eatContextual(name)) { this.unexpected(); } + }; + + // Test whether a semicolon can be inserted at the current position. + + pp$9.canInsertSemicolon = function() { + return this.type === types$1.eof || + this.type === types$1.braceR || + lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) + }; + + pp$9.insertSemicolon = function() { + if (this.canInsertSemicolon()) { + if (this.options.onInsertedSemicolon) + { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); } + return true + } + }; + + // Consume a semicolon, or, failing that, see if we are allowed to + // pretend that there is a semicolon at this position. + + pp$9.semicolon = function() { + if (!this.eat(types$1.semi) && !this.insertSemicolon()) { this.unexpected(); } + }; + + pp$9.afterTrailingComma = function(tokType, notNext) { + if (this.type === tokType) { + if (this.options.onTrailingComma) + { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); } + if (!notNext) + { this.next(); } + return true + } + }; + + // Expect a token of a given type. If found, consume it, otherwise, + // raise an unexpected token error. + + pp$9.expect = function(type) { + this.eat(type) || this.unexpected(); + }; + + // Raise an unexpected token error. + + pp$9.unexpected = function(pos) { + this.raise(pos != null ? pos : this.start, "Unexpected token"); + }; + + var DestructuringErrors = function DestructuringErrors() { + this.shorthandAssign = + this.trailingComma = + this.parenthesizedAssign = + this.parenthesizedBind = + this.doubleProto = + -1; + }; + + pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) { + if (!refDestructuringErrors) { return } + if (refDestructuringErrors.trailingComma > -1) + { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } + var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; + if (parens > -1) { this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern"); } + }; + + pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) { + if (!refDestructuringErrors) { return false } + var shorthandAssign = refDestructuringErrors.shorthandAssign; + var doubleProto = refDestructuringErrors.doubleProto; + if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 } + if (shorthandAssign >= 0) + { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); } + if (doubleProto >= 0) + { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); } + }; + + pp$9.checkYieldAwaitInDefaultParams = function() { + if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) + { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } + if (this.awaitPos) + { this.raise(this.awaitPos, "Await expression cannot be a default value"); } + }; + + pp$9.isSimpleAssignTarget = function(expr) { + if (expr.type === "ParenthesizedExpression") + { return this.isSimpleAssignTarget(expr.expression) } + return expr.type === "Identifier" || expr.type === "MemberExpression" + }; + + var pp$8 = Parser.prototype; + + // ### Statement parsing + + // Parse a program. Initializes the parser, reads any number of + // statements, and wraps them in a Program node. Optionally takes a + // `program` argument. If present, the statements will be appended + // to its body instead of creating a new node. + + pp$8.parseTopLevel = function(node) { + var exports = Object.create(null); + if (!node.body) { node.body = []; } + while (this.type !== types$1.eof) { + var stmt = this.parseStatement(null, true, exports); + node.body.push(stmt); + } + if (this.inModule) + { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) + { + var name = list[i]; + + this.raiseRecoverable(this.undefinedExports[name].start, ("Export '" + name + "' is not defined")); + } } + this.adaptDirectivePrologue(node.body); + this.next(); + node.sourceType = this.options.sourceType; + return this.finishNode(node, "Program") + }; + + var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; + + pp$8.isLet = function(context) { + if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + // For ambiguous cases, determine if a LexicalDeclaration (or only a + // Statement) is allowed here. If context is not empty then only a Statement + // is allowed. However, `let [` is an explicit negative lookahead for + // ExpressionStatement, so special-case it first. + if (nextCh === 91 || nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '[', '/', astral + if (context) { return false } + + if (nextCh === 123) { return true } // '{' + if (isIdentifierStart(nextCh, true)) { + var pos = next + 1; + while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { ++pos; } + if (nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } + var ident = this.input.slice(next, pos); + if (!keywordRelationalOperator.test(ident)) { return true } + } + return false + }; + + // check 'async [no LineTerminator here] function' + // - 'async /*foo*/ function' is OK. + // - 'async /*\n*/ function' is invalid. + pp$8.isAsyncFunction = function() { + if (this.options.ecmaVersion < 8 || !this.isContextual("async")) + { return false } + + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, after; + return !lineBreak.test(this.input.slice(this.pos, next)) && + this.input.slice(next, next + 8) === "function" && + (next + 8 === this.input.length || + !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 0xd7ff && after < 0xdc00)) + }; + + // Parse a single statement. + // + // If expecting a statement and finding a slash operator, parse a + // regular expression literal. This is to handle cases like + // `if (foo) /blah/.exec(foo)`, where looking at the previous token + // does not help. + + pp$8.parseStatement = function(context, topLevel, exports) { + var starttype = this.type, node = this.startNode(), kind; + + if (this.isLet(context)) { + starttype = types$1._var; + kind = "let"; + } + + // Most types of statements are recognized by the keyword they + // start with. Many are trivial to parse, some require a bit of + // complexity. + + switch (starttype) { + case types$1._break: case types$1._continue: return this.parseBreakContinueStatement(node, starttype.keyword) + case types$1._debugger: return this.parseDebuggerStatement(node) + case types$1._do: return this.parseDoStatement(node) + case types$1._for: return this.parseForStatement(node) + case types$1._function: + // Function as sole body of either an if statement or a labeled statement + // works, but not when it is part of a labeled statement that is the sole + // body of an if statement. + if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); } + return this.parseFunctionStatement(node, false, !context) + case types$1._class: + if (context) { this.unexpected(); } + return this.parseClass(node, true) + case types$1._if: return this.parseIfStatement(node) + case types$1._return: return this.parseReturnStatement(node) + case types$1._switch: return this.parseSwitchStatement(node) + case types$1._throw: return this.parseThrowStatement(node) + case types$1._try: return this.parseTryStatement(node) + case types$1._const: case types$1._var: + kind = kind || this.value; + if (context && kind !== "var") { this.unexpected(); } + return this.parseVarStatement(node, kind) + case types$1._while: return this.parseWhileStatement(node) + case types$1._with: return this.parseWithStatement(node) + case types$1.braceL: return this.parseBlock(true, node) + case types$1.semi: return this.parseEmptyStatement(node) + case types$1._export: + case types$1._import: + if (this.options.ecmaVersion > 10 && starttype === types$1._import) { + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 40 || nextCh === 46) // '(' or '.' + { return this.parseExpressionStatement(node, this.parseExpression()) } + } + + if (!this.options.allowImportExportEverywhere) { + if (!topLevel) + { this.raise(this.start, "'import' and 'export' may only appear at the top level"); } + if (!this.inModule) + { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } + } + return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports) + + // If the statement does not start with a statement keyword or a + // brace, it's an ExpressionStatement or LabeledStatement. We + // simply start parsing an expression, and afterwards, if the + // next token is a colon and the expression was a simple + // Identifier node, we switch to interpreting it as a label. + default: + if (this.isAsyncFunction()) { + if (context) { this.unexpected(); } + this.next(); + return this.parseFunctionStatement(node, true, !context) + } + + var maybeName = this.value, expr = this.parseExpression(); + if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) + { return this.parseLabeledStatement(node, maybeName, expr, context) } + else { return this.parseExpressionStatement(node, expr) } + } + }; + + pp$8.parseBreakContinueStatement = function(node, keyword) { + var isBreak = keyword === "break"; + this.next(); + if (this.eat(types$1.semi) || this.insertSemicolon()) { node.label = null; } + else if (this.type !== types$1.name) { this.unexpected(); } + else { + node.label = this.parseIdent(); + this.semicolon(); + } + + // Verify that there is an actual destination to break or + // continue to. + var i = 0; + for (; i < this.labels.length; ++i) { + var lab = this.labels[i]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) { break } + if (node.label && isBreak) { break } + } + } + if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); } + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement") + }; + + pp$8.parseDebuggerStatement = function(node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement") + }; + + pp$8.parseDoStatement = function(node) { + this.next(); + this.labels.push(loopLabel); + node.body = this.parseStatement("do"); + this.labels.pop(); + this.expect(types$1._while); + node.test = this.parseParenExpression(); + if (this.options.ecmaVersion >= 6) + { this.eat(types$1.semi); } + else + { this.semicolon(); } + return this.finishNode(node, "DoWhileStatement") + }; + + // Disambiguating between a `for` and a `for`/`in` or `for`/`of` + // loop is non-trivial. Basically, we have to parse the init `var` + // statement or expression, disallowing the `in` operator (see + // the second parameter to `parseExpression`), and then check + // whether the next token is `in` or `of`. When there is no init + // part (semicolon immediately after the opening parenthesis), it + // is a regular `for` loop. + + pp$8.parseForStatement = function(node) { + this.next(); + var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await")) ? this.lastTokStart : -1; + this.labels.push(loopLabel); + this.enterScope(0); + this.expect(types$1.parenL); + if (this.type === types$1.semi) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, null) + } + var isLet = this.isLet(); + if (this.type === types$1._var || this.type === types$1._const || isLet) { + var init$1 = this.startNode(), kind = isLet ? "let" : this.value; + this.next(); + this.parseVar(init$1, true, kind); + this.finishNode(init$1, "VariableDeclaration"); + if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types$1._in) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + } else { node.await = awaitAt > -1; } + } + return this.parseForIn(node, init$1) + } + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, init$1) + } + var startsWithLet = this.isContextual("let"), isForOf = false; + var refDestructuringErrors = new DestructuringErrors; + var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors); + if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types$1._in) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + } else { node.await = awaitAt > -1; } + } + if (startsWithLet && isForOf) { this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); } + this.toAssignable(init, false, refDestructuringErrors); + this.checkLValPattern(init); + return this.parseForIn(node, init) + } else { + this.checkExpressionErrors(refDestructuringErrors, true); + } + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, init) + }; + + pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) { + this.next(); + return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync) + }; + + pp$8.parseIfStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + // allow function declarations in branches, but only in non-strict mode + node.consequent = this.parseStatement("if"); + node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null; + return this.finishNode(node, "IfStatement") + }; + + pp$8.parseReturnStatement = function(node) { + if (!this.inFunction && !this.options.allowReturnOutsideFunction) + { this.raise(this.start, "'return' outside of function"); } + this.next(); + + // In `return` (and `break`/`continue`), the keywords with + // optional arguments, we eagerly look for a semicolon or the + // possibility to insert one. + + if (this.eat(types$1.semi) || this.insertSemicolon()) { node.argument = null; } + else { node.argument = this.parseExpression(); this.semicolon(); } + return this.finishNode(node, "ReturnStatement") + }; + + pp$8.parseSwitchStatement = function(node) { + this.next(); + node.discriminant = this.parseParenExpression(); + node.cases = []; + this.expect(types$1.braceL); + this.labels.push(switchLabel); + this.enterScope(0); + + // Statements under must be grouped (by label) in SwitchCase + // nodes. `cur` is used to keep the node that we are currently + // adding statements to. + + var cur; + for (var sawDefault = false; this.type !== types$1.braceR;) { + if (this.type === types$1._case || this.type === types$1._default) { + var isCase = this.type === types$1._case; + if (cur) { this.finishNode(cur, "SwitchCase"); } + node.cases.push(cur = this.startNode()); + cur.consequent = []; + this.next(); + if (isCase) { + cur.test = this.parseExpression(); + } else { + if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); } + sawDefault = true; + cur.test = null; + } + this.expect(types$1.colon); + } else { + if (!cur) { this.unexpected(); } + cur.consequent.push(this.parseStatement(null)); + } + } + this.exitScope(); + if (cur) { this.finishNode(cur, "SwitchCase"); } + this.next(); // Closing brace + this.labels.pop(); + return this.finishNode(node, "SwitchStatement") + }; + + pp$8.parseThrowStatement = function(node) { + this.next(); + if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) + { this.raise(this.lastTokEnd, "Illegal newline after throw"); } + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement") + }; + + // Reused empty array added for node fields that are always empty. + + var empty$1 = []; + + pp$8.parseTryStatement = function(node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.type === types$1._catch) { + var clause = this.startNode(); + this.next(); + if (this.eat(types$1.parenL)) { + clause.param = this.parseBindingAtom(); + var simple = clause.param.type === "Identifier"; + this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); + this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); + this.expect(types$1.parenR); + } else { + if (this.options.ecmaVersion < 10) { this.unexpected(); } + clause.param = null; + this.enterScope(0); + } + clause.body = this.parseBlock(false); + this.exitScope(); + node.handler = this.finishNode(clause, "CatchClause"); + } + node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null; + if (!node.handler && !node.finalizer) + { this.raise(node.start, "Missing catch or finally clause"); } + return this.finishNode(node, "TryStatement") + }; + + pp$8.parseVarStatement = function(node, kind) { + this.next(); + this.parseVar(node, false, kind); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration") + }; + + pp$8.parseWhileStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + this.labels.push(loopLabel); + node.body = this.parseStatement("while"); + this.labels.pop(); + return this.finishNode(node, "WhileStatement") + }; + + pp$8.parseWithStatement = function(node) { + if (this.strict) { this.raise(this.start, "'with' in strict mode"); } + this.next(); + node.object = this.parseParenExpression(); + node.body = this.parseStatement("with"); + return this.finishNode(node, "WithStatement") + }; + + pp$8.parseEmptyStatement = function(node) { + this.next(); + return this.finishNode(node, "EmptyStatement") + }; + + pp$8.parseLabeledStatement = function(node, maybeName, expr, context) { + for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) + { + var label = list[i$1]; + + if (label.name === maybeName) + { this.raise(expr.start, "Label '" + maybeName + "' is already declared"); + } } + var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null; + for (var i = this.labels.length - 1; i >= 0; i--) { + var label$1 = this.labels[i]; + if (label$1.statementStart === node.start) { + // Update information about previous labels on this node + label$1.statementStart = this.start; + label$1.kind = kind; + } else { break } + } + this.labels.push({name: maybeName, kind: kind, statementStart: this.start}); + node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); + this.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement") + }; + + pp$8.parseExpressionStatement = function(node, expr) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement") + }; + + // Parse a semicolon-enclosed block of statements, handling `"use + // strict"` declarations when `allowStrict` is true (used for + // function bodies). + + pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) { + if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; + if ( node === void 0 ) node = this.startNode(); + + node.body = []; + this.expect(types$1.braceL); + if (createNewLexicalScope) { this.enterScope(0); } + while (this.type !== types$1.braceR) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + if (exitStrict) { this.strict = false; } + this.next(); + if (createNewLexicalScope) { this.exitScope(); } + return this.finishNode(node, "BlockStatement") + }; + + // Parse a regular `for` loop. The disambiguation code in + // `parseStatement` will already have parsed the init statement or + // expression. + + pp$8.parseFor = function(node, init) { + node.init = init; + this.expect(types$1.semi); + node.test = this.type === types$1.semi ? null : this.parseExpression(); + this.expect(types$1.semi); + node.update = this.type === types$1.parenR ? null : this.parseExpression(); + this.expect(types$1.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, "ForStatement") + }; + + // Parse a `for`/`in` and `for`/`of` loop, which are almost + // same from parser's perspective. + + pp$8.parseForIn = function(node, init) { + var isForIn = this.type === types$1._in; + this.next(); + + if ( + init.type === "VariableDeclaration" && + init.declarations[0].init != null && + ( + !isForIn || + this.options.ecmaVersion < 8 || + this.strict || + init.kind !== "var" || + init.declarations[0].id.type !== "Identifier" + ) + ) { + this.raise( + init.start, + ((isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer") + ); + } + node.left = init; + node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); + this.expect(types$1.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement") + }; + + // Parse a list of variable declarations. + + pp$8.parseVar = function(node, isFor, kind) { + node.declarations = []; + node.kind = kind; + for (;;) { + var decl = this.startNode(); + this.parseVarId(decl, kind); + if (this.eat(types$1.eq)) { + decl.init = this.parseMaybeAssign(isFor); + } else if (kind === "const" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { + this.unexpected(); + } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) { + this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); + } else { + decl.init = null; + } + node.declarations.push(this.finishNode(decl, "VariableDeclarator")); + if (!this.eat(types$1.comma)) { break } + } + return node + }; + + pp$8.parseVarId = function(decl, kind) { + decl.id = this.parseBindingAtom(); + this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); + }; + + var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4; + + // Parse a function declaration or literal (depending on the + // `statement & FUNC_STATEMENT`). + + // Remove `allowExpressionBody` for 7.0.0, as it is only called with false + pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) { + this.initFunction(node); + if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { + if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT)) + { this.unexpected(); } + node.generator = this.eat(types$1.star); + } + if (this.options.ecmaVersion >= 8) + { node.async = !!isAsync; } + + if (statement & FUNC_STATEMENT) { + node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent(); + if (node.id && !(statement & FUNC_HANGING_STATEMENT)) + // If it is a regular function declaration in sloppy mode, then it is + // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding + // mode depends on properties of the current scope (see + // treatFunctionsAsVar). + { this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); } + } + + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(node.async, node.generator)); + + if (!(statement & FUNC_STATEMENT)) + { node.id = this.type === types$1.name ? this.parseIdent() : null; } + + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody, false, forInit); + + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression") + }; + + pp$8.parseFunctionParams = function(node) { + this.expect(types$1.parenL); + node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + }; + + // Parse a class declaration or literal (depending on the + // `isStatement` parameter). + + pp$8.parseClass = function(node, isStatement) { + this.next(); + + // ecma-262 14.6 Class Definitions + // A class definition is always strict mode code. + var oldStrict = this.strict; + this.strict = true; + + this.parseClassId(node, isStatement); + this.parseClassSuper(node); + var privateNameMap = this.enterClassBody(); + var classBody = this.startNode(); + var hadConstructor = false; + classBody.body = []; + this.expect(types$1.braceL); + while (this.type !== types$1.braceR) { + var element = this.parseClassElement(node.superClass !== null); + if (element) { + classBody.body.push(element); + if (element.type === "MethodDefinition" && element.kind === "constructor") { + if (hadConstructor) { this.raise(element.start, "Duplicate constructor in the same class"); } + hadConstructor = true; + } else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) { + this.raiseRecoverable(element.key.start, ("Identifier '#" + (element.key.name) + "' has already been declared")); + } + } + } + this.strict = oldStrict; + this.next(); + node.body = this.finishNode(classBody, "ClassBody"); + this.exitClassBody(); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") + }; + + pp$8.parseClassElement = function(constructorAllowsSuper) { + if (this.eat(types$1.semi)) { return null } + + var ecmaVersion = this.options.ecmaVersion; + var node = this.startNode(); + var keyName = ""; + var isGenerator = false; + var isAsync = false; + var kind = "method"; + var isStatic = false; + + if (this.eatContextual("static")) { + // Parse static init block + if (ecmaVersion >= 13 && this.eat(types$1.braceL)) { + this.parseClassStaticBlock(node); + return node + } + if (this.isClassElementNameStart() || this.type === types$1.star) { + isStatic = true; + } else { + keyName = "static"; + } + } + node.static = isStatic; + if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) { + if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) { + isAsync = true; + } else { + keyName = "async"; + } + } + if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) { + isGenerator = true; + } + if (!keyName && !isAsync && !isGenerator) { + var lastValue = this.value; + if (this.eatContextual("get") || this.eatContextual("set")) { + if (this.isClassElementNameStart()) { + kind = lastValue; + } else { + keyName = lastValue; + } + } + } + + // Parse element name + if (keyName) { + // 'async', 'get', 'set', or 'static' were not a keyword contextually. + // The last token is any of those. Make it the element name. + node.computed = false; + node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc); + node.key.name = keyName; + this.finishNode(node.key, "Identifier"); + } else { + this.parseClassElementName(node); + } + + // Parse element value + if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) { + var isConstructor = !node.static && checkKeyName(node, "constructor"); + var allowsDirectSuper = isConstructor && constructorAllowsSuper; + // Couldn't move this check into the 'parseClassMethod' method for backward compatibility. + if (isConstructor && kind !== "method") { this.raise(node.key.start, "Constructor can't have get/set modifier"); } + node.kind = isConstructor ? "constructor" : kind; + this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper); + } else { + this.parseClassField(node); + } + + return node + }; + + pp$8.isClassElementNameStart = function() { + return ( + this.type === types$1.name || + this.type === types$1.privateId || + this.type === types$1.num || + this.type === types$1.string || + this.type === types$1.bracketL || + this.type.keyword + ) + }; + + pp$8.parseClassElementName = function(element) { + if (this.type === types$1.privateId) { + if (this.value === "constructor") { + this.raise(this.start, "Classes can't have an element named '#constructor'"); + } + element.computed = false; + element.key = this.parsePrivateIdent(); + } else { + this.parsePropertyName(element); + } + }; + + pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { + // Check key and flags + var key = method.key; + if (method.kind === "constructor") { + if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); } + if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); } + } else if (method.static && checkKeyName(method, "prototype")) { + this.raise(key.start, "Classes may not have a static property named prototype"); + } + + // Parse value + var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); + + // Check value + if (method.kind === "get" && value.params.length !== 0) + { this.raiseRecoverable(value.start, "getter should have no params"); } + if (method.kind === "set" && value.params.length !== 1) + { this.raiseRecoverable(value.start, "setter should have exactly one param"); } + if (method.kind === "set" && value.params[0].type === "RestElement") + { this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); } + + return this.finishNode(method, "MethodDefinition") + }; + + pp$8.parseClassField = function(field) { + if (checkKeyName(field, "constructor")) { + this.raise(field.key.start, "Classes can't have a field named 'constructor'"); + } else if (field.static && checkKeyName(field, "prototype")) { + this.raise(field.key.start, "Classes can't have a static field named 'prototype'"); + } + + if (this.eat(types$1.eq)) { + // To raise SyntaxError if 'arguments' exists in the initializer. + var scope = this.currentThisScope(); + var inClassFieldInit = scope.inClassFieldInit; + scope.inClassFieldInit = true; + field.value = this.parseMaybeAssign(); + scope.inClassFieldInit = inClassFieldInit; + } else { + field.value = null; + } + this.semicolon(); + + return this.finishNode(field, "PropertyDefinition") + }; + + pp$8.parseClassStaticBlock = function(node) { + node.body = []; + + var oldLabels = this.labels; + this.labels = []; + this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER); + while (this.type !== types$1.braceR) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + this.next(); + this.exitScope(); + this.labels = oldLabels; + + return this.finishNode(node, "StaticBlock") + }; + + pp$8.parseClassId = function(node, isStatement) { + if (this.type === types$1.name) { + node.id = this.parseIdent(); + if (isStatement) + { this.checkLValSimple(node.id, BIND_LEXICAL, false); } + } else { + if (isStatement === true) + { this.unexpected(); } + node.id = null; + } + }; + + pp$8.parseClassSuper = function(node) { + node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(false) : null; + }; + + pp$8.enterClassBody = function() { + var element = {declared: Object.create(null), used: []}; + this.privateNameStack.push(element); + return element.declared + }; + + pp$8.exitClassBody = function() { + var ref = this.privateNameStack.pop(); + var declared = ref.declared; + var used = ref.used; + var len = this.privateNameStack.length; + var parent = len === 0 ? null : this.privateNameStack[len - 1]; + for (var i = 0; i < used.length; ++i) { + var id = used[i]; + if (!hasOwn(declared, id.name)) { + if (parent) { + parent.used.push(id); + } else { + this.raiseRecoverable(id.start, ("Private field '#" + (id.name) + "' must be declared in an enclosing class")); + } + } + } + }; + + function isPrivateNameConflicted(privateNameMap, element) { + var name = element.key.name; + var curr = privateNameMap[name]; + + var next = "true"; + if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) { + next = (element.static ? "s" : "i") + element.kind; + } + + // `class { get #a(){}; static set #a(_){} }` is also conflict. + if ( + curr === "iget" && next === "iset" || + curr === "iset" && next === "iget" || + curr === "sget" && next === "sset" || + curr === "sset" && next === "sget" + ) { + privateNameMap[name] = "true"; + return false + } else if (!curr) { + privateNameMap[name] = next; + return false + } else { + return true + } + } + + function checkKeyName(node, name) { + var computed = node.computed; + var key = node.key; + return !computed && ( + key.type === "Identifier" && key.name === name || + key.type === "Literal" && key.value === name + ) + } + + // Parses module export declaration. + + pp$8.parseExport = function(node, exports) { + this.next(); + // export * from '...' + if (this.eat(types$1.star)) { + if (this.options.ecmaVersion >= 11) { + if (this.eatContextual("as")) { + node.exported = this.parseModuleExportName(); + this.checkExport(exports, node.exported, this.lastTokStart); + } else { + node.exported = null; + } + } + this.expectContextual("from"); + if (this.type !== types$1.string) { this.unexpected(); } + node.source = this.parseExprAtom(); + this.semicolon(); + return this.finishNode(node, "ExportAllDeclaration") + } + if (this.eat(types$1._default)) { // export default ... + this.checkExport(exports, "default", this.lastTokStart); + var isAsync; + if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) { + var fNode = this.startNode(); + this.next(); + if (isAsync) { this.next(); } + node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); + } else if (this.type === types$1._class) { + var cNode = this.startNode(); + node.declaration = this.parseClass(cNode, "nullableID"); + } else { + node.declaration = this.parseMaybeAssign(); + this.semicolon(); + } + return this.finishNode(node, "ExportDefaultDeclaration") + } + // export var|const|let|function|class ... + if (this.shouldParseExportStatement()) { + node.declaration = this.parseStatement(null); + if (node.declaration.type === "VariableDeclaration") + { this.checkVariableExport(exports, node.declaration.declarations); } + else + { this.checkExport(exports, node.declaration.id, node.declaration.id.start); } + node.specifiers = []; + node.source = null; + } else { // export { x, y as z } [from '...'] + node.declaration = null; + node.specifiers = this.parseExportSpecifiers(exports); + if (this.eatContextual("from")) { + if (this.type !== types$1.string) { this.unexpected(); } + node.source = this.parseExprAtom(); + } else { + for (var i = 0, list = node.specifiers; i < list.length; i += 1) { + // check for keywords used as local names + var spec = list[i]; + + this.checkUnreserved(spec.local); + // check if export is defined + this.checkLocalExport(spec.local); + + if (spec.local.type === "Literal") { + this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`."); + } + } + + node.source = null; + } + this.semicolon(); + } + return this.finishNode(node, "ExportNamedDeclaration") + }; + + pp$8.checkExport = function(exports, name, pos) { + if (!exports) { return } + if (typeof name !== "string") + { name = name.type === "Identifier" ? name.name : name.value; } + if (hasOwn(exports, name)) + { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } + exports[name] = true; + }; + + pp$8.checkPatternExport = function(exports, pat) { + var type = pat.type; + if (type === "Identifier") + { this.checkExport(exports, pat, pat.start); } + else if (type === "ObjectPattern") + { for (var i = 0, list = pat.properties; i < list.length; i += 1) + { + var prop = list[i]; + + this.checkPatternExport(exports, prop); + } } + else if (type === "ArrayPattern") + { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { + var elt = list$1[i$1]; + + if (elt) { this.checkPatternExport(exports, elt); } + } } + else if (type === "Property") + { this.checkPatternExport(exports, pat.value); } + else if (type === "AssignmentPattern") + { this.checkPatternExport(exports, pat.left); } + else if (type === "RestElement") + { this.checkPatternExport(exports, pat.argument); } + else if (type === "ParenthesizedExpression") + { this.checkPatternExport(exports, pat.expression); } + }; + + pp$8.checkVariableExport = function(exports, decls) { + if (!exports) { return } + for (var i = 0, list = decls; i < list.length; i += 1) + { + var decl = list[i]; + + this.checkPatternExport(exports, decl.id); + } + }; + + pp$8.shouldParseExportStatement = function() { + return this.type.keyword === "var" || + this.type.keyword === "const" || + this.type.keyword === "class" || + this.type.keyword === "function" || + this.isLet() || + this.isAsyncFunction() + }; + + // Parses a comma-separated list of module exports. + + pp$8.parseExportSpecifiers = function(exports) { + var nodes = [], first = true; + // export { x, y as z } [from '...'] + this.expect(types$1.braceL); + while (!this.eat(types$1.braceR)) { + if (!first) { + this.expect(types$1.comma); + if (this.afterTrailingComma(types$1.braceR)) { break } + } else { first = false; } + + var node = this.startNode(); + node.local = this.parseModuleExportName(); + node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local; + this.checkExport( + exports, + node.exported, + node.exported.start + ); + nodes.push(this.finishNode(node, "ExportSpecifier")); + } + return nodes + }; + + // Parses import declaration. + + pp$8.parseImport = function(node) { + this.next(); + // import '...' + if (this.type === types$1.string) { + node.specifiers = empty$1; + node.source = this.parseExprAtom(); + } else { + node.specifiers = this.parseImportSpecifiers(); + this.expectContextual("from"); + node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected(); + } + this.semicolon(); + return this.finishNode(node, "ImportDeclaration") + }; + + // Parses a comma-separated list of module imports. + + pp$8.parseImportSpecifiers = function() { + var nodes = [], first = true; + if (this.type === types$1.name) { + // import defaultObj, { x, y as z } from '...' + var node = this.startNode(); + node.local = this.parseIdent(); + this.checkLValSimple(node.local, BIND_LEXICAL); + nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); + if (!this.eat(types$1.comma)) { return nodes } + } + if (this.type === types$1.star) { + var node$1 = this.startNode(); + this.next(); + this.expectContextual("as"); + node$1.local = this.parseIdent(); + this.checkLValSimple(node$1.local, BIND_LEXICAL); + nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); + return nodes + } + this.expect(types$1.braceL); + while (!this.eat(types$1.braceR)) { + if (!first) { + this.expect(types$1.comma); + if (this.afterTrailingComma(types$1.braceR)) { break } + } else { first = false; } + + var node$2 = this.startNode(); + node$2.imported = this.parseModuleExportName(); + if (this.eatContextual("as")) { + node$2.local = this.parseIdent(); + } else { + this.checkUnreserved(node$2.imported); + node$2.local = node$2.imported; + } + this.checkLValSimple(node$2.local, BIND_LEXICAL); + nodes.push(this.finishNode(node$2, "ImportSpecifier")); + } + return nodes + }; + + pp$8.parseModuleExportName = function() { + if (this.options.ecmaVersion >= 13 && this.type === types$1.string) { + var stringLiteral = this.parseLiteral(this.value); + if (loneSurrogate.test(stringLiteral.value)) { + this.raise(stringLiteral.start, "An export name cannot include a lone surrogate."); + } + return stringLiteral + } + return this.parseIdent(true) + }; + + // Set `ExpressionStatement#directive` property for directive prologues. + pp$8.adaptDirectivePrologue = function(statements) { + for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { + statements[i].directive = statements[i].expression.raw.slice(1, -1); + } + }; + pp$8.isDirectiveCandidate = function(statement) { + return ( + this.options.ecmaVersion >= 5 && + statement.type === "ExpressionStatement" && + statement.expression.type === "Literal" && + typeof statement.expression.value === "string" && + // Reject parenthesized strings. + (this.input[statement.start] === "\"" || this.input[statement.start] === "'") + ) + }; + + var pp$7 = Parser.prototype; + + // Convert existing expression atom to assignable pattern + // if possible. + + pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) { + if (this.options.ecmaVersion >= 6 && node) { + switch (node.type) { + case "Identifier": + if (this.inAsync && node.name === "await") + { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); } + break + + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + case "RestElement": + break + + case "ObjectExpression": + node.type = "ObjectPattern"; + if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + for (var i = 0, list = node.properties; i < list.length; i += 1) { + var prop = list[i]; + + this.toAssignable(prop, isBinding); + // Early error: + // AssignmentRestProperty[Yield, Await] : + // `...` DestructuringAssignmentTarget[Yield, Await] + // + // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|. + if ( + prop.type === "RestElement" && + (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern") + ) { + this.raise(prop.argument.start, "Unexpected token"); + } + } + break + + case "Property": + // AssignmentProperty has type === "Property" + if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); } + this.toAssignable(node.value, isBinding); + break + + case "ArrayExpression": + node.type = "ArrayPattern"; + if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + this.toAssignableList(node.elements, isBinding); + break + + case "SpreadElement": + node.type = "RestElement"; + this.toAssignable(node.argument, isBinding); + if (node.argument.type === "AssignmentPattern") + { this.raise(node.argument.start, "Rest elements cannot have a default value"); } + break + + case "AssignmentExpression": + if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); } + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isBinding); + break + + case "ParenthesizedExpression": + this.toAssignable(node.expression, isBinding, refDestructuringErrors); + break + + case "ChainExpression": + this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side"); + break + + case "MemberExpression": + if (!isBinding) { break } + + default: + this.raise(node.start, "Assigning to rvalue"); + } + } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + return node + }; + + // Convert list of expression atoms to binding list. + + pp$7.toAssignableList = function(exprList, isBinding) { + var end = exprList.length; + for (var i = 0; i < end; i++) { + var elt = exprList[i]; + if (elt) { this.toAssignable(elt, isBinding); } + } + if (end) { + var last = exprList[end - 1]; + if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") + { this.unexpected(last.argument.start); } + } + return exprList + }; + + // Parses spread element. + + pp$7.parseSpread = function(refDestructuringErrors) { + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssign(false, refDestructuringErrors); + return this.finishNode(node, "SpreadElement") + }; + + pp$7.parseRestBinding = function() { + var node = this.startNode(); + this.next(); + + // RestElement inside of a function parameter must be an identifier + if (this.options.ecmaVersion === 6 && this.type !== types$1.name) + { this.unexpected(); } + + node.argument = this.parseBindingAtom(); + + return this.finishNode(node, "RestElement") + }; + + // Parses lvalue (assignable) atom. + + pp$7.parseBindingAtom = function() { + if (this.options.ecmaVersion >= 6) { + switch (this.type) { + case types$1.bracketL: + var node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(types$1.bracketR, true, true); + return this.finishNode(node, "ArrayPattern") + + case types$1.braceL: + return this.parseObj(true) + } + } + return this.parseIdent() + }; + + pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) { + var elts = [], first = true; + while (!this.eat(close)) { + if (first) { first = false; } + else { this.expect(types$1.comma); } + if (allowEmpty && this.type === types$1.comma) { + elts.push(null); + } else if (allowTrailingComma && this.afterTrailingComma(close)) { + break + } else if (this.type === types$1.ellipsis) { + var rest = this.parseRestBinding(); + this.parseBindingListItem(rest); + elts.push(rest); + if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } + this.expect(close); + break + } else { + var elem = this.parseMaybeDefault(this.start, this.startLoc); + this.parseBindingListItem(elem); + elts.push(elem); + } + } + return elts + }; + + pp$7.parseBindingListItem = function(param) { + return param + }; + + // Parses assignment pattern around given atom if possible. + + pp$7.parseMaybeDefault = function(startPos, startLoc, left) { + left = left || this.parseBindingAtom(); + if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { return left } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.right = this.parseMaybeAssign(); + return this.finishNode(node, "AssignmentPattern") + }; + + // The following three functions all verify that a node is an lvalue — + // something that can be bound, or assigned to. In order to do so, they perform + // a variety of checks: + // + // - Check that none of the bound/assigned-to identifiers are reserved words. + // - Record name declarations for bindings in the appropriate scope. + // - Check duplicate argument names, if checkClashes is set. + // + // If a complex binding pattern is encountered (e.g., object and array + // destructuring), the entire pattern is recursively checked. + // + // There are three versions of checkLVal*() appropriate for different + // circumstances: + // + // - checkLValSimple() shall be used if the syntactic construct supports + // nothing other than identifiers and member expressions. Parenthesized + // expressions are also correctly handled. This is generally appropriate for + // constructs for which the spec says + // + // > It is a Syntax Error if AssignmentTargetType of [the production] is not + // > simple. + // + // It is also appropriate for checking if an identifier is valid and not + // defined elsewhere, like import declarations or function/class identifiers. + // + // Examples where this is used include: + // a += …; + // import a from '…'; + // where a is the node to be checked. + // + // - checkLValPattern() shall be used if the syntactic construct supports + // anything checkLValSimple() supports, as well as object and array + // destructuring patterns. This is generally appropriate for constructs for + // which the spec says + // + // > It is a Syntax Error if [the production] is neither an ObjectLiteral nor + // > an ArrayLiteral and AssignmentTargetType of [the production] is not + // > simple. + // + // Examples where this is used include: + // (a = …); + // const a = …; + // try { … } catch (a) { … } + // where a is the node to be checked. + // + // - checkLValInnerPattern() shall be used if the syntactic construct supports + // anything checkLValPattern() supports, as well as default assignment + // patterns, rest elements, and other constructs that may appear within an + // object or array destructuring pattern. + // + // As a special case, function parameters also use checkLValInnerPattern(), + // as they also support defaults and rest constructs. + // + // These functions deliberately support both assignment and binding constructs, + // as the logic for both is exceedingly similar. If the node is the target of + // an assignment, then bindingType should be set to BIND_NONE. Otherwise, it + // should be set to the appropriate BIND_* constant, like BIND_VAR or + // BIND_LEXICAL. + // + // If the function is called with a non-BIND_NONE bindingType, then + // additionally a checkClashes object may be specified to allow checking for + // duplicate argument names. checkClashes is ignored if the provided construct + // is an assignment (i.e., bindingType is BIND_NONE). + + pp$7.checkLValSimple = function(expr, bindingType, checkClashes) { + if ( bindingType === void 0 ) bindingType = BIND_NONE; + + var isBind = bindingType !== BIND_NONE; + + switch (expr.type) { + case "Identifier": + if (this.strict && this.reservedWordsStrictBind.test(expr.name)) + { this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); } + if (isBind) { + if (bindingType === BIND_LEXICAL && expr.name === "let") + { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); } + if (checkClashes) { + if (hasOwn(checkClashes, expr.name)) + { this.raiseRecoverable(expr.start, "Argument name clash"); } + checkClashes[expr.name] = true; + } + if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); } + } + break + + case "ChainExpression": + this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side"); + break + + case "MemberExpression": + if (isBind) { this.raiseRecoverable(expr.start, "Binding member expression"); } + break + + case "ParenthesizedExpression": + if (isBind) { this.raiseRecoverable(expr.start, "Binding parenthesized expression"); } + return this.checkLValSimple(expr.expression, bindingType, checkClashes) + + default: + this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue"); + } + }; + + pp$7.checkLValPattern = function(expr, bindingType, checkClashes) { + if ( bindingType === void 0 ) bindingType = BIND_NONE; + + switch (expr.type) { + case "ObjectPattern": + for (var i = 0, list = expr.properties; i < list.length; i += 1) { + var prop = list[i]; + + this.checkLValInnerPattern(prop, bindingType, checkClashes); + } + break + + case "ArrayPattern": + for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { + var elem = list$1[i$1]; + + if (elem) { this.checkLValInnerPattern(elem, bindingType, checkClashes); } + } + break + + default: + this.checkLValSimple(expr, bindingType, checkClashes); + } + }; + + pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) { + if ( bindingType === void 0 ) bindingType = BIND_NONE; + + switch (expr.type) { + case "Property": + // AssignmentProperty has type === "Property" + this.checkLValInnerPattern(expr.value, bindingType, checkClashes); + break + + case "AssignmentPattern": + this.checkLValPattern(expr.left, bindingType, checkClashes); + break + + case "RestElement": + this.checkLValPattern(expr.argument, bindingType, checkClashes); + break + + default: + this.checkLValPattern(expr, bindingType, checkClashes); + } + }; + + // The algorithm used to determine whether a regexp can appear at a + + var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) { + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; + this.generator = !!generator; + }; + + var types = { + b_stat: new TokContext("{", false), + b_expr: new TokContext("{", true), + b_tmpl: new TokContext("${", false), + p_stat: new TokContext("(", false), + p_expr: new TokContext("(", true), + q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }), + f_stat: new TokContext("function", false), + f_expr: new TokContext("function", true), + f_expr_gen: new TokContext("function", true, false, null, true), + f_gen: new TokContext("function", false, false, null, true) + }; + + var pp$6 = Parser.prototype; + + pp$6.initialContext = function() { + return [types.b_stat] + }; + + pp$6.curContext = function() { + return this.context[this.context.length - 1] + }; + + pp$6.braceIsBlock = function(prevType) { + var parent = this.curContext(); + if (parent === types.f_expr || parent === types.f_stat) + { return true } + if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr)) + { return !parent.isExpr } + + // The check for `tt.name && exprAllowed` detects whether we are + // after a `yield` or `of` construct. See the `updateContext` for + // `tt.name`. + if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed) + { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } + if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow) + { return true } + if (prevType === types$1.braceL) + { return parent === types.b_stat } + if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name) + { return false } + return !this.exprAllowed + }; + + pp$6.inGeneratorContext = function() { + for (var i = this.context.length - 1; i >= 1; i--) { + var context = this.context[i]; + if (context.token === "function") + { return context.generator } + } + return false + }; + + pp$6.updateContext = function(prevType) { + var update, type = this.type; + if (type.keyword && prevType === types$1.dot) + { this.exprAllowed = false; } + else if (update = type.updateContext) + { update.call(this, prevType); } + else + { this.exprAllowed = type.beforeExpr; } + }; + + // Used to handle egde cases when token context could not be inferred correctly during tokenization phase + + pp$6.overrideContext = function(tokenCtx) { + if (this.curContext() !== tokenCtx) { + this.context[this.context.length - 1] = tokenCtx; + } + }; + + // Token-specific context update code + + types$1.parenR.updateContext = types$1.braceR.updateContext = function() { + if (this.context.length === 1) { + this.exprAllowed = true; + return + } + var out = this.context.pop(); + if (out === types.b_stat && this.curContext().token === "function") { + out = this.context.pop(); + } + this.exprAllowed = !out.isExpr; + }; + + types$1.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); + this.exprAllowed = true; + }; + + types$1.dollarBraceL.updateContext = function() { + this.context.push(types.b_tmpl); + this.exprAllowed = true; + }; + + types$1.parenL.updateContext = function(prevType) { + var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while; + this.context.push(statementParens ? types.p_stat : types.p_expr); + this.exprAllowed = true; + }; + + types$1.incDec.updateContext = function() { + // tokExprAllowed stays unchanged + }; + + types$1._function.updateContext = types$1._class.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== types$1._else && + !(prevType === types$1.semi && this.curContext() !== types.p_stat) && + !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && + !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat)) + { this.context.push(types.f_expr); } + else + { this.context.push(types.f_stat); } + this.exprAllowed = false; + }; + + types$1.backQuote.updateContext = function() { + if (this.curContext() === types.q_tmpl) + { this.context.pop(); } + else + { this.context.push(types.q_tmpl); } + this.exprAllowed = false; + }; + + types$1.star.updateContext = function(prevType) { + if (prevType === types$1._function) { + var index = this.context.length - 1; + if (this.context[index] === types.f_expr) + { this.context[index] = types.f_expr_gen; } + else + { this.context[index] = types.f_gen; } + } + this.exprAllowed = true; + }; + + types$1.name.updateContext = function(prevType) { + var allowed = false; + if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) { + if (this.value === "of" && !this.exprAllowed || + this.value === "yield" && this.inGeneratorContext()) + { allowed = true; } + } + this.exprAllowed = allowed; + }; + + // A recursive descent parser operates by defining functions for all + + var pp$5 = Parser.prototype; + + // Check if property name clashes with already added. + // Object/class getters and setters are not allowed to clash — + // either with each other or with an init property — and in + // strict mode, init properties are also not allowed to be repeated. + + pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) { + if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") + { return } + if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) + { return } + var key = prop.key; + var name; + switch (key.type) { + case "Identifier": name = key.name; break + case "Literal": name = String(key.value); break + default: return + } + var kind = prop.kind; + if (this.options.ecmaVersion >= 6) { + if (name === "__proto__" && kind === "init") { + if (propHash.proto) { + if (refDestructuringErrors) { + if (refDestructuringErrors.doubleProto < 0) { + refDestructuringErrors.doubleProto = key.start; + } + } else { + this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); + } + } + propHash.proto = true; + } + return + } + name = "$" + name; + var other = propHash[name]; + if (other) { + var redefinition; + if (kind === "init") { + redefinition = this.strict && other.init || other.get || other.set; + } else { + redefinition = other.init || other[kind]; + } + if (redefinition) + { this.raiseRecoverable(key.start, "Redefinition of property"); } + } else { + other = propHash[name] = { + init: false, + get: false, + set: false + }; + } + other[kind] = true; + }; + + // ### Expression parsing + + // These nest, from the most general expression type at the top to + // 'atomic', nondivisible expression types at the bottom. Most of + // the functions will simply let the function(s) below them parse, + // and, *if* the syntactic construct they handle is present, wrap + // the AST node that the inner parser gave them in another node. + + // Parse a full expression. The optional arguments are used to + // forbid the `in` operator (in for loops initalization expressions) + // and provide reference for storing '=' operator inside shorthand + // property assignment in contexts where both object expression + // and object pattern might appear (so it's possible to raise + // delayed syntax error at correct position). + + pp$5.parseExpression = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); + if (this.type === types$1.comma) { + var node = this.startNodeAt(startPos, startLoc); + node.expressions = [expr]; + while (this.eat(types$1.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); } + return this.finishNode(node, "SequenceExpression") + } + return expr + }; + + // Parse an assignment expression. This includes applications of + // operators like `+=`. + + pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { + if (this.isContextual("yield")) { + if (this.inGenerator) { return this.parseYield(forInit) } + // The tokenizer will assume an expression is allowed after + // `yield`, but this isn't that kind of yield + else { this.exprAllowed = false; } + } + + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1; + if (refDestructuringErrors) { + oldParenAssign = refDestructuringErrors.parenthesizedAssign; + oldTrailingComma = refDestructuringErrors.trailingComma; + oldDoubleProto = refDestructuringErrors.doubleProto; + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; + } else { + refDestructuringErrors = new DestructuringErrors; + ownDestructuringErrors = true; + } + + var startPos = this.start, startLoc = this.startLoc; + if (this.type === types$1.parenL || this.type === types$1.name) { + this.potentialArrowAt = this.start; + this.potentialArrowInForAwait = forInit === "await"; + } + var left = this.parseMaybeConditional(forInit, refDestructuringErrors); + if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); } + if (this.type.isAssign) { + var node = this.startNodeAt(startPos, startLoc); + node.operator = this.value; + if (this.type === types$1.eq) + { left = this.toAssignable(left, false, refDestructuringErrors); } + if (!ownDestructuringErrors) { + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; + } + if (refDestructuringErrors.shorthandAssign >= left.start) + { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly + if (this.type === types$1.eq) + { this.checkLValPattern(left); } + else + { this.checkLValSimple(left); } + node.left = left; + this.next(); + node.right = this.parseMaybeAssign(forInit); + if (oldDoubleProto > -1) { refDestructuringErrors.doubleProto = oldDoubleProto; } + return this.finishNode(node, "AssignmentExpression") + } else { + if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); } + } + if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; } + if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; } + return left + }; + + // Parse a ternary conditional (`?:`) operator. + + pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprOps(forInit, refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + if (this.eat(types$1.question)) { + var node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(types$1.colon); + node.alternate = this.parseMaybeAssign(forInit); + return this.finishNode(node, "ConditionalExpression") + } + return expr + }; + + // Start the precedence parser. + + pp$5.parseExprOps = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit) + }; + + // Parse binary operators with the operator precedence parsing + // algorithm. `left` is the left-hand side of the operator. + // `minPrec` provides context that allows the function to stop and + // defer further parser to one of its callers when it encounters an + // operator that has a lower precedence than the set it is parsing. + + pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) { + var prec = this.type.binop; + if (prec != null && (!forInit || this.type !== types$1._in)) { + if (prec > minPrec) { + var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND; + var coalesce = this.type === types$1.coalesce; + if (coalesce) { + // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions. + // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error. + prec = types$1.logicalAND.binop; + } + var op = this.value; + this.next(); + var startPos = this.start, startLoc = this.startLoc; + var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit); + var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); + if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) { + this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); + } + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit) + } + } + return left + }; + + pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) { + if (right.type === "PrivateIdentifier") { this.raise(right.start, "Private identifier can only be left side of binary expression"); } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.operator = op; + node.right = right; + return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression") + }; + + // Parse unary operators, both prefix and postfix. + + pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) { + var startPos = this.start, startLoc = this.startLoc, expr; + if (this.isContextual("await") && this.canAwait) { + expr = this.parseAwait(forInit); + sawUnary = true; + } else if (this.type.prefix) { + var node = this.startNode(), update = this.type === types$1.incDec; + node.operator = this.value; + node.prefix = true; + this.next(); + node.argument = this.parseMaybeUnary(null, true, update, forInit); + this.checkExpressionErrors(refDestructuringErrors, true); + if (update) { this.checkLValSimple(node.argument); } + else if (this.strict && node.operator === "delete" && + node.argument.type === "Identifier") + { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); } + else if (node.operator === "delete" && isPrivateFieldAccess(node.argument)) + { this.raiseRecoverable(node.start, "Private fields can not be deleted"); } + else { sawUnary = true; } + expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } else if (!sawUnary && this.type === types$1.privateId) { + if (forInit || this.privateNameStack.length === 0) { this.unexpected(); } + expr = this.parsePrivateIdent(); + // only could be private fields in 'in', such as #x in obj + if (this.type !== types$1._in) { this.unexpected(); } + } else { + expr = this.parseExprSubscripts(refDestructuringErrors, forInit); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + while (this.type.postfix && !this.canInsertSemicolon()) { + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.operator = this.value; + node$1.prefix = false; + node$1.argument = expr; + this.checkLValSimple(expr); + this.next(); + expr = this.finishNode(node$1, "UpdateExpression"); + } + } + + if (!incDec && this.eat(types$1.starstar)) { + if (sawUnary) + { this.unexpected(this.lastTokStart); } + else + { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false) } + } else { + return expr + } + }; + + function isPrivateFieldAccess(node) { + return ( + node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || + node.type === "ChainExpression" && isPrivateFieldAccess(node.expression) + ) + } + + // Parse call, dot, and `[]`-subscript expressions. + + pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprAtom(refDestructuringErrors, forInit); + if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") + { return expr } + var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit); + if (refDestructuringErrors && result.type === "MemberExpression") { + if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; } + if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; } + if (refDestructuringErrors.trailingComma >= result.start) { refDestructuringErrors.trailingComma = -1; } + } + return result + }; + + pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) { + var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && + this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && + this.potentialArrowAt === base.start; + var optionalChained = false; + + while (true) { + var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit); + + if (element.optional) { optionalChained = true; } + if (element === base || element.type === "ArrowFunctionExpression") { + if (optionalChained) { + var chainNode = this.startNodeAt(startPos, startLoc); + chainNode.expression = element; + element = this.finishNode(chainNode, "ChainExpression"); + } + return element + } + + base = element; + } + }; + + pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { + var optionalSupported = this.options.ecmaVersion >= 11; + var optional = optionalSupported && this.eat(types$1.questionDot); + if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); } + + var computed = this.eat(types$1.bracketL); + if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) { + var node = this.startNodeAt(startPos, startLoc); + node.object = base; + if (computed) { + node.property = this.parseExpression(); + this.expect(types$1.bracketR); + } else if (this.type === types$1.privateId && base.type !== "Super") { + node.property = this.parsePrivateIdent(); + } else { + node.property = this.parseIdent(this.options.allowReserved !== "never"); + } + node.computed = !!computed; + if (optionalSupported) { + node.optional = optional; + } + base = this.finishNode(node, "MemberExpression"); + } else if (!noCalls && this.eat(types$1.parenL)) { + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); + if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + if (this.awaitIdentPos > 0) + { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); } + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit) + } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.callee = base; + node$1.arguments = exprList; + if (optionalSupported) { + node$1.optional = optional; + } + base = this.finishNode(node$1, "CallExpression"); + } else if (this.type === types$1.backQuote) { + if (optional || optionalChained) { + this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); + } + var node$2 = this.startNodeAt(startPos, startLoc); + node$2.tag = base; + node$2.quasi = this.parseTemplate({isTagged: true}); + base = this.finishNode(node$2, "TaggedTemplateExpression"); + } + return base + }; + + // Parse an atomic expression — either a single token that is an + // expression, an expression started by a keyword like `function` or + // `new`, or an expression wrapped in punctuation like `()`, `[]`, + // or `{}`. + + pp$5.parseExprAtom = function(refDestructuringErrors, forInit) { + // If a division operator appears in an expression position, the + // tokenizer got confused, and we force it to read a regexp instead. + if (this.type === types$1.slash) { this.readRegexp(); } + + var node, canBeArrow = this.potentialArrowAt === this.start; + switch (this.type) { + case types$1._super: + if (!this.allowSuper) + { this.raise(this.start, "'super' keyword outside a method"); } + node = this.startNode(); + this.next(); + if (this.type === types$1.parenL && !this.allowDirectSuper) + { this.raise(node.start, "super() call outside constructor of a subclass"); } + // The `super` keyword can appear at below: + // SuperProperty: + // super [ Expression ] + // super . IdentifierName + // SuperCall: + // super ( Arguments ) + if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) + { this.unexpected(); } + return this.finishNode(node, "Super") + + case types$1._this: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression") + + case types$1.name: + var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; + var id = this.parseIdent(false); + if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) { + this.overrideContext(types.f_expr); + return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit) + } + if (canBeArrow && !this.canInsertSemicolon()) { + if (this.eat(types$1.arrow)) + { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) } + if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc && + (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { + id = this.parseIdent(false); + if (this.canInsertSemicolon() || !this.eat(types$1.arrow)) + { this.unexpected(); } + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit) + } + } + return id + + case types$1.regexp: + var value = this.value; + node = this.parseLiteral(value.value); + node.regex = {pattern: value.pattern, flags: value.flags}; + return node + + case types$1.num: case types$1.string: + return this.parseLiteral(this.value) + + case types$1._null: case types$1._true: case types$1._false: + node = this.startNode(); + node.value = this.type === types$1._null ? null : this.type === types$1._true; + node.raw = this.type.keyword; + this.next(); + return this.finishNode(node, "Literal") + + case types$1.parenL: + var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); + if (refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) + { refDestructuringErrors.parenthesizedAssign = start; } + if (refDestructuringErrors.parenthesizedBind < 0) + { refDestructuringErrors.parenthesizedBind = start; } + } + return expr + + case types$1.bracketL: + node = this.startNode(); + this.next(); + node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors); + return this.finishNode(node, "ArrayExpression") + + case types$1.braceL: + this.overrideContext(types.b_expr); + return this.parseObj(false, refDestructuringErrors) + + case types$1._function: + node = this.startNode(); + this.next(); + return this.parseFunction(node, 0) + + case types$1._class: + return this.parseClass(this.startNode(), false) + + case types$1._new: + return this.parseNew() + + case types$1.backQuote: + return this.parseTemplate() + + case types$1._import: + if (this.options.ecmaVersion >= 11) { + return this.parseExprImport() + } else { + return this.unexpected() + } + + default: + this.unexpected(); + } + }; + + pp$5.parseExprImport = function() { + var node = this.startNode(); + + // Consume `import` as an identifier for `import.meta`. + // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`. + if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); } + var meta = this.parseIdent(true); + + switch (this.type) { + case types$1.parenL: + return this.parseDynamicImport(node) + case types$1.dot: + node.meta = meta; + return this.parseImportMeta(node) + default: + this.unexpected(); + } + }; + + pp$5.parseDynamicImport = function(node) { + this.next(); // skip `(` + + // Parse node.source. + node.source = this.parseMaybeAssign(); + + // Verify ending. + if (!this.eat(types$1.parenR)) { + var errorPos = this.start; + if (this.eat(types$1.comma) && this.eat(types$1.parenR)) { + this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); + } else { + this.unexpected(errorPos); + } + } + + return this.finishNode(node, "ImportExpression") + }; + + pp$5.parseImportMeta = function(node) { + this.next(); // skip `.` + + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + + if (node.property.name !== "meta") + { this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); } + if (containsEsc) + { this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); } + if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere) + { this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); } + + return this.finishNode(node, "MetaProperty") + }; + + pp$5.parseLiteral = function(value) { + var node = this.startNode(); + node.value = value; + node.raw = this.input.slice(this.start, this.end); + if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); } + this.next(); + return this.finishNode(node, "Literal") + }; + + pp$5.parseParenExpression = function() { + this.expect(types$1.parenL); + var val = this.parseExpression(); + this.expect(types$1.parenR); + return val + }; + + pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { + var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; + if (this.options.ecmaVersion >= 6) { + this.next(); + + var innerStartPos = this.start, innerStartLoc = this.startLoc; + var exprList = [], first = true, lastIsComma = false; + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; + this.yieldPos = 0; + this.awaitPos = 0; + // Do not save awaitIdentPos to allow checking awaits nested in parameters + while (this.type !== types$1.parenR) { + first ? first = false : this.expect(types$1.comma); + if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) { + lastIsComma = true; + break + } else if (this.type === types$1.ellipsis) { + spreadStart = this.start; + exprList.push(this.parseParenItem(this.parseRestBinding())); + if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } + break + } else { + exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); + } + } + var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc; + this.expect(types$1.parenR); + + if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + return this.parseParenArrowList(startPos, startLoc, exprList, forInit) + } + + if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); } + if (spreadStart) { this.unexpected(spreadStart); } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); + } else { + val = exprList[0]; + } + } else { + val = this.parseParenExpression(); + } + + if (this.options.preserveParens) { + var par = this.startNodeAt(startPos, startLoc); + par.expression = val; + return this.finishNode(par, "ParenthesizedExpression") + } else { + return val + } + }; + + pp$5.parseParenItem = function(item) { + return item + }; + + pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit) + }; + + // New's precedence is slightly tricky. It must allow its argument to + // be a `[]` or dot subscript expression, but not a call — at least, + // not without wrapping it in parentheses. Thus, it uses the noCalls + // argument to parseSubscripts to prevent it from consuming the + // argument list. + + var empty = []; + + pp$5.parseNew = function() { + if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); } + var node = this.startNode(); + var meta = this.parseIdent(true); + if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) { + node.meta = meta; + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "target") + { this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); } + if (containsEsc) + { this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); } + if (!this.allowNewDotTarget) + { this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); } + return this.finishNode(node, "MetaProperty") + } + var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types$1._import; + node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false); + if (isImport && node.callee.type === "ImportExpression") { + this.raise(startPos, "Cannot use new with import()"); + } + if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); } + else { node.arguments = empty; } + return this.finishNode(node, "NewExpression") + }; + + // Parse template expression. + + pp$5.parseTemplateElement = function(ref) { + var isTagged = ref.isTagged; + + var elem = this.startNode(); + if (this.type === types$1.invalidTemplate) { + if (!isTagged) { + this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); + } + elem.value = { + raw: this.value, + cooked: null + }; + } else { + elem.value = { + raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), + cooked: this.value + }; + } + this.next(); + elem.tail = this.type === types$1.backQuote; + return this.finishNode(elem, "TemplateElement") + }; + + pp$5.parseTemplate = function(ref) { + if ( ref === void 0 ) ref = {}; + var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; + + var node = this.startNode(); + this.next(); + node.expressions = []; + var curElt = this.parseTemplateElement({isTagged: isTagged}); + node.quasis = [curElt]; + while (!curElt.tail) { + if (this.type === types$1.eof) { this.raise(this.pos, "Unterminated template literal"); } + this.expect(types$1.dollarBraceL); + node.expressions.push(this.parseExpression()); + this.expect(types$1.braceR); + node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged})); + } + this.next(); + return this.finishNode(node, "TemplateLiteral") + }; + + pp$5.isAsyncProp = function(prop) { + return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && + (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types$1.star)) && + !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) + }; + + // Parse an object literal or binding pattern. + + pp$5.parseObj = function(isPattern, refDestructuringErrors) { + var node = this.startNode(), first = true, propHash = {}; + node.properties = []; + this.next(); + while (!this.eat(types$1.braceR)) { + if (!first) { + this.expect(types$1.comma); + if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { break } + } else { first = false; } + + var prop = this.parseProperty(isPattern, refDestructuringErrors); + if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); } + node.properties.push(prop); + } + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression") + }; + + pp$5.parseProperty = function(isPattern, refDestructuringErrors) { + var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; + if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) { + if (isPattern) { + prop.argument = this.parseIdent(false); + if (this.type === types$1.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + return this.finishNode(prop, "RestElement") + } + // Parse argument. + prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); + // To disallow trailing comma via `this.toAssignable()`. + if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + // Finish + return this.finishNode(prop, "SpreadElement") + } + if (this.options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; + if (isPattern || refDestructuringErrors) { + startPos = this.start; + startLoc = this.startLoc; + } + if (!isPattern) + { isGenerator = this.eat(types$1.star); } + } + var containsEsc = this.containsEsc; + this.parsePropertyName(prop); + if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star); + this.parsePropertyName(prop, refDestructuringErrors); + } else { + isAsync = false; + } + this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); + return this.finishNode(prop, "Property") + }; + + pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { + if ((isGenerator || isAsync) && this.type === types$1.colon) + { this.unexpected(); } + + if (this.eat(types$1.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); + prop.kind = "init"; + } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) { + if (isPattern) { this.unexpected(); } + prop.kind = "init"; + prop.method = true; + prop.value = this.parseMethod(isGenerator, isAsync); + } else if (!isPattern && !containsEsc && + this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && + (prop.key.name === "get" || prop.key.name === "set") && + (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) { + if (isGenerator || isAsync) { this.unexpected(); } + prop.kind = prop.key.name; + this.parsePropertyName(prop); + prop.value = this.parseMethod(false); + var paramCount = prop.kind === "get" ? 0 : 1; + if (prop.value.params.length !== paramCount) { + var start = prop.value.start; + if (prop.kind === "get") + { this.raiseRecoverable(start, "getter should have no params"); } + else + { this.raiseRecoverable(start, "setter should have exactly one param"); } + } else { + if (prop.kind === "set" && prop.value.params[0].type === "RestElement") + { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); } + } + } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { + if (isGenerator || isAsync) { this.unexpected(); } + this.checkUnreserved(prop.key); + if (prop.key.name === "await" && !this.awaitIdentPos) + { this.awaitIdentPos = startPos; } + prop.kind = "init"; + if (isPattern) { + prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); + } else if (this.type === types$1.eq && refDestructuringErrors) { + if (refDestructuringErrors.shorthandAssign < 0) + { refDestructuringErrors.shorthandAssign = this.start; } + prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); + } else { + prop.value = this.copyNode(prop.key); + } + prop.shorthand = true; + } else { this.unexpected(); } + }; + + pp$5.parsePropertyName = function(prop) { + if (this.options.ecmaVersion >= 6) { + if (this.eat(types$1.bracketL)) { + prop.computed = true; + prop.key = this.parseMaybeAssign(); + this.expect(types$1.bracketR); + return prop.key + } else { + prop.computed = false; + } + } + return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") + }; + + // Initialize empty function node. + + pp$5.initFunction = function(node) { + node.id = null; + if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } + if (this.options.ecmaVersion >= 8) { node.async = false; } + }; + + // Parse object or class method. + + pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { + var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + + this.initFunction(node); + if (this.options.ecmaVersion >= 6) + { node.generator = isGenerator; } + if (this.options.ecmaVersion >= 8) + { node.async = !!isAsync; } + + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); + + this.expect(types$1.parenL); + node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + this.parseFunctionBody(node, false, true, false); + + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "FunctionExpression") + }; + + // Parse arrow function expression with given parameters. + + pp$5.parseArrowExpression = function(node, params, isAsync, forInit) { + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + + this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); + this.initFunction(node); + if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } + + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + + node.params = this.toAssignableList(params, true); + this.parseFunctionBody(node, true, false, forInit); + + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "ArrowFunctionExpression") + }; + + // Parse function body and check parameters. + + pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { + var isExpression = isArrowFunction && this.type !== types$1.braceL; + var oldStrict = this.strict, useStrict = false; + + if (isExpression) { + node.body = this.parseMaybeAssign(forInit); + node.expression = true; + this.checkParams(node, false); + } else { + var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); + if (!oldStrict || nonSimple) { + useStrict = this.strictDirective(this.end); + // If this is a strict mode function, verify that argument names + // are not repeated, and it does not try to bind the words `eval` + // or `arguments`. + if (useStrict && nonSimple) + { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); } + } + // Start a new scope with regard to labels and the `inFunction` + // flag (restore them to their old value afterwards). + var oldLabels = this.labels; + this.labels = []; + if (useStrict) { this.strict = true; } + + // Add the params to varDeclaredNames to ensure that an error is thrown + // if a let/const declaration in the function clashes with one of the params. + this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); + // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' + if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); } + node.body = this.parseBlock(false, undefined, useStrict && !oldStrict); + node.expression = false; + this.adaptDirectivePrologue(node.body.body); + this.labels = oldLabels; + } + this.exitScope(); + }; + + pp$5.isSimpleParamList = function(params) { + for (var i = 0, list = params; i < list.length; i += 1) + { + var param = list[i]; + + if (param.type !== "Identifier") { return false + } } + return true + }; + + // Checks function params for various disallowed patterns such as using "eval" + // or "arguments" and duplicate parameters. + + pp$5.checkParams = function(node, allowDuplicates) { + var nameHash = Object.create(null); + for (var i = 0, list = node.params; i < list.length; i += 1) + { + var param = list[i]; + + this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash); + } + }; + + // Parses a comma-separated list of expressions, and returns them as + // an array. `close` is the token type that ends the list, and + // `allowEmpty` can be turned on to allow subsequent commas with + // nothing in between them to be parsed as `null` (which is needed + // for array literals). + + pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { + var elts = [], first = true; + while (!this.eat(close)) { + if (!first) { + this.expect(types$1.comma); + if (allowTrailingComma && this.afterTrailingComma(close)) { break } + } else { first = false; } + + var elt = (void 0); + if (allowEmpty && this.type === types$1.comma) + { elt = null; } + else if (this.type === types$1.ellipsis) { + elt = this.parseSpread(refDestructuringErrors); + if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0) + { refDestructuringErrors.trailingComma = this.start; } + } else { + elt = this.parseMaybeAssign(false, refDestructuringErrors); + } + elts.push(elt); + } + return elts + }; + + pp$5.checkUnreserved = function(ref) { + var start = ref.start; + var end = ref.end; + var name = ref.name; + + if (this.inGenerator && name === "yield") + { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); } + if (this.inAsync && name === "await") + { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); } + if (this.currentThisScope().inClassFieldInit && name === "arguments") + { this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer"); } + if (this.inClassStaticBlock && (name === "arguments" || name === "await")) + { this.raise(start, ("Cannot use " + name + " in class static initialization block")); } + if (this.keywords.test(name)) + { this.raise(start, ("Unexpected keyword '" + name + "'")); } + if (this.options.ecmaVersion < 6 && + this.input.slice(start, end).indexOf("\\") !== -1) { return } + var re = this.strict ? this.reservedWordsStrict : this.reservedWords; + if (re.test(name)) { + if (!this.inAsync && name === "await") + { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); } + this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved")); + } + }; + + // Parse the next token as an identifier. If `liberal` is true (used + // when parsing properties), it will also convert keywords into + // identifiers. + + pp$5.parseIdent = function(liberal, isBinding) { + var node = this.startNode(); + if (this.type === types$1.name) { + node.name = this.value; + } else if (this.type.keyword) { + node.name = this.type.keyword; + + // To fix https://github.com/acornjs/acorn/issues/575 + // `class` and `function` keywords push new context into this.context. + // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name. + // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword + if ((node.name === "class" || node.name === "function") && + (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { + this.context.pop(); + } + } else { + this.unexpected(); + } + this.next(!!liberal); + this.finishNode(node, "Identifier"); + if (!liberal) { + this.checkUnreserved(node); + if (node.name === "await" && !this.awaitIdentPos) + { this.awaitIdentPos = node.start; } + } + return node + }; + + pp$5.parsePrivateIdent = function() { + var node = this.startNode(); + if (this.type === types$1.privateId) { + node.name = this.value; + } else { + this.unexpected(); + } + this.next(); + this.finishNode(node, "PrivateIdentifier"); + + // For validating existence + if (this.privateNameStack.length === 0) { + this.raise(node.start, ("Private field '#" + (node.name) + "' must be declared in an enclosing class")); + } else { + this.privateNameStack[this.privateNameStack.length - 1].used.push(node); + } + + return node + }; + + // Parses yield expression inside generator. + + pp$5.parseYield = function(forInit) { + if (!this.yieldPos) { this.yieldPos = this.start; } + + var node = this.startNode(); + this.next(); + if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) { + node.delegate = false; + node.argument = null; + } else { + node.delegate = this.eat(types$1.star); + node.argument = this.parseMaybeAssign(forInit); + } + return this.finishNode(node, "YieldExpression") + }; + + pp$5.parseAwait = function(forInit) { + if (!this.awaitPos) { this.awaitPos = this.start; } + + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeUnary(null, true, false, forInit); + return this.finishNode(node, "AwaitExpression") + }; + + var pp$4 = Parser.prototype; + + // This function is used to raise exceptions on parse errors. It + // takes an offset integer (into the current `input`) to indicate + // the location of the error, attaches the position to the end + // of the error message, and then raises a `SyntaxError` with that + // message. + + pp$4.raise = function(pos, message) { + var loc = getLineInfo(this.input, pos); + message += " (" + loc.line + ":" + loc.column + ")"; + var err = new SyntaxError(message); + err.pos = pos; err.loc = loc; err.raisedAt = this.pos; + throw err + }; + + pp$4.raiseRecoverable = pp$4.raise; + + pp$4.curPosition = function() { + if (this.options.locations) { + return new Position(this.curLine, this.pos - this.lineStart) + } + }; + + var pp$3 = Parser.prototype; + + var Scope = function Scope(flags) { + this.flags = flags; + // A list of var-declared names in the current lexical scope + this.var = []; + // A list of lexically-declared names in the current lexical scope + this.lexical = []; + // A list of lexically-declared FunctionDeclaration names in the current lexical scope + this.functions = []; + // A switch to disallow the identifier reference 'arguments' + this.inClassFieldInit = false; + }; + + // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. + + pp$3.enterScope = function(flags) { + this.scopeStack.push(new Scope(flags)); + }; + + pp$3.exitScope = function() { + this.scopeStack.pop(); + }; + + // The spec says: + // > At the top level of a function, or script, function declarations are + // > treated like var declarations rather than like lexical declarations. + pp$3.treatFunctionsAsVarInScope = function(scope) { + return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) + }; + + pp$3.declareName = function(name, bindingType, pos) { + var redeclared = false; + if (bindingType === BIND_LEXICAL) { + var scope = this.currentScope(); + redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; + scope.lexical.push(name); + if (this.inModule && (scope.flags & SCOPE_TOP)) + { delete this.undefinedExports[name]; } + } else if (bindingType === BIND_SIMPLE_CATCH) { + var scope$1 = this.currentScope(); + scope$1.lexical.push(name); + } else if (bindingType === BIND_FUNCTION) { + var scope$2 = this.currentScope(); + if (this.treatFunctionsAsVar) + { redeclared = scope$2.lexical.indexOf(name) > -1; } + else + { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; } + scope$2.functions.push(name); + } else { + for (var i = this.scopeStack.length - 1; i >= 0; --i) { + var scope$3 = this.scopeStack[i]; + if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) || + !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) { + redeclared = true; + break + } + scope$3.var.push(name); + if (this.inModule && (scope$3.flags & SCOPE_TOP)) + { delete this.undefinedExports[name]; } + if (scope$3.flags & SCOPE_VAR) { break } + } + } + if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); } + }; + + pp$3.checkLocalExport = function(id) { + // scope.functions must be empty as Module code is always strict. + if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && + this.scopeStack[0].var.indexOf(id.name) === -1) { + this.undefinedExports[id.name] = id; + } + }; + + pp$3.currentScope = function() { + return this.scopeStack[this.scopeStack.length - 1] + }; + + pp$3.currentVarScope = function() { + for (var i = this.scopeStack.length - 1;; i--) { + var scope = this.scopeStack[i]; + if (scope.flags & SCOPE_VAR) { return scope } + } + }; + + // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. + pp$3.currentThisScope = function() { + for (var i = this.scopeStack.length - 1;; i--) { + var scope = this.scopeStack[i]; + if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope } + } + }; + + var Node = function Node(parser, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + if (parser.options.locations) + { this.loc = new SourceLocation(parser, loc); } + if (parser.options.directSourceFile) + { this.sourceFile = parser.options.directSourceFile; } + if (parser.options.ranges) + { this.range = [pos, 0]; } + }; + + // Start an AST node, attaching a start offset. + + var pp$2 = Parser.prototype; + + pp$2.startNode = function() { + return new Node(this, this.start, this.startLoc) + }; + + pp$2.startNodeAt = function(pos, loc) { + return new Node(this, pos, loc) + }; + + // Finish an AST node, adding `type` and `end` properties. + + function finishNodeAt(node, type, pos, loc) { + node.type = type; + node.end = pos; + if (this.options.locations) + { node.loc.end = loc; } + if (this.options.ranges) + { node.range[1] = pos; } + return node + } + + pp$2.finishNode = function(node, type) { + return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) + }; + + // Finish node at given position + + pp$2.finishNodeAt = function(node, type, pos, loc) { + return finishNodeAt.call(this, node, type, pos, loc) + }; + + pp$2.copyNode = function(node) { + var newNode = new Node(this, node.start, this.startLoc); + for (var prop in node) { newNode[prop] = node[prop]; } + return newNode + }; + + // This file contains Unicode properties extracted from the ECMAScript + // specification. The lists are extracted like so: + // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText) + + // #table-binary-unicode-properties + var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; + var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; + var ecma11BinaryProperties = ecma10BinaryProperties; + var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict"; + var ecma13BinaryProperties = ecma12BinaryProperties; + var unicodeBinaryProperties = { + 9: ecma9BinaryProperties, + 10: ecma10BinaryProperties, + 11: ecma11BinaryProperties, + 12: ecma12BinaryProperties, + 13: ecma13BinaryProperties + }; + + // #table-unicode-general-category-values + var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; + + // #table-unicode-script-values + var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; + var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; + var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; + var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"; + var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"; + var unicodeScriptValues = { + 9: ecma9ScriptValues, + 10: ecma10ScriptValues, + 11: ecma11ScriptValues, + 12: ecma12ScriptValues, + 13: ecma13ScriptValues + }; + + var data = {}; + function buildUnicodeData(ecmaVersion) { + var d = data[ecmaVersion] = { + binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues), + nonBinary: { + General_Category: wordsRegexp(unicodeGeneralCategoryValues), + Script: wordsRegexp(unicodeScriptValues[ecmaVersion]) + } + }; + d.nonBinary.Script_Extensions = d.nonBinary.Script; + + d.nonBinary.gc = d.nonBinary.General_Category; + d.nonBinary.sc = d.nonBinary.Script; + d.nonBinary.scx = d.nonBinary.Script_Extensions; + } + + for (var i = 0, list = [9, 10, 11, 12, 13]; i < list.length; i += 1) { + var ecmaVersion = list[i]; + + buildUnicodeData(ecmaVersion); + } + + var pp$1 = Parser.prototype; + + var RegExpValidationState = function RegExpValidationState(parser) { + this.parser = parser; + this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : ""); + this.unicodeProperties = data[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion]; + this.source = ""; + this.flags = ""; + this.start = 0; + this.switchU = false; + this.switchN = false; + this.pos = 0; + this.lastIntValue = 0; + this.lastStringValue = ""; + this.lastAssertionIsQuantifiable = false; + this.numCapturingParens = 0; + this.maxBackReference = 0; + this.groupNames = []; + this.backReferenceNames = []; + }; + + RegExpValidationState.prototype.reset = function reset (start, pattern, flags) { + var unicode = flags.indexOf("u") !== -1; + this.start = start | 0; + this.source = pattern + ""; + this.flags = flags; + this.switchU = unicode && this.parser.options.ecmaVersion >= 6; + this.switchN = unicode && this.parser.options.ecmaVersion >= 9; + }; + + RegExpValidationState.prototype.raise = function raise (message) { + this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message)); + }; + + // If u flag is given, this returns the code point at the index (it combines a surrogate pair). + // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair). + RegExpValidationState.prototype.at = function at (i, forceU) { + if ( forceU === void 0 ) forceU = false; + + var s = this.source; + var l = s.length; + if (i >= l) { + return -1 + } + var c = s.charCodeAt(i); + if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { + return c + } + var next = s.charCodeAt(i + 1); + return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c + }; + + RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) { + if ( forceU === void 0 ) forceU = false; + + var s = this.source; + var l = s.length; + if (i >= l) { + return l + } + var c = s.charCodeAt(i), next; + if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l || + (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) { + return i + 1 + } + return i + 2 + }; + + RegExpValidationState.prototype.current = function current (forceU) { + if ( forceU === void 0 ) forceU = false; + + return this.at(this.pos, forceU) + }; + + RegExpValidationState.prototype.lookahead = function lookahead (forceU) { + if ( forceU === void 0 ) forceU = false; + + return this.at(this.nextIndex(this.pos, forceU), forceU) + }; + + RegExpValidationState.prototype.advance = function advance (forceU) { + if ( forceU === void 0 ) forceU = false; + + this.pos = this.nextIndex(this.pos, forceU); + }; + + RegExpValidationState.prototype.eat = function eat (ch, forceU) { + if ( forceU === void 0 ) forceU = false; + + if (this.current(forceU) === ch) { + this.advance(forceU); + return true + } + return false + }; + + /** + * Validate the flags part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ + pp$1.validateRegExpFlags = function(state) { + var validFlags = state.validFlags; + var flags = state.flags; + + for (var i = 0; i < flags.length; i++) { + var flag = flags.charAt(i); + if (validFlags.indexOf(flag) === -1) { + this.raise(state.start, "Invalid regular expression flag"); + } + if (flags.indexOf(flag, i + 1) > -1) { + this.raise(state.start, "Duplicate regular expression flag"); + } + } + }; + + /** + * Validate the pattern part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ + pp$1.validateRegExpPattern = function(state) { + this.regexp_pattern(state); + + // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of + // parsing contains a |GroupName|, reparse with the goal symbol + // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError* + // exception if _P_ did not conform to the grammar, if any elements of _P_ + // were not matched by the parse, or if any Early Error conditions exist. + if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { + state.switchN = true; + this.regexp_pattern(state); + } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern + pp$1.regexp_pattern = function(state) { + state.pos = 0; + state.lastIntValue = 0; + state.lastStringValue = ""; + state.lastAssertionIsQuantifiable = false; + state.numCapturingParens = 0; + state.maxBackReference = 0; + state.groupNames.length = 0; + state.backReferenceNames.length = 0; + + this.regexp_disjunction(state); + + if (state.pos !== state.source.length) { + // Make the same messages as V8. + if (state.eat(0x29 /* ) */)) { + state.raise("Unmatched ')'"); + } + if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) { + state.raise("Lone quantifier brackets"); + } + } + if (state.maxBackReference > state.numCapturingParens) { + state.raise("Invalid escape"); + } + for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) { + var name = list[i]; + + if (state.groupNames.indexOf(name) === -1) { + state.raise("Invalid named capture referenced"); + } + } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction + pp$1.regexp_disjunction = function(state) { + this.regexp_alternative(state); + while (state.eat(0x7C /* | */)) { + this.regexp_alternative(state); + } + + // Make the same message as V8. + if (this.regexp_eatQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + if (state.eat(0x7B /* { */)) { + state.raise("Lone quantifier brackets"); + } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative + pp$1.regexp_alternative = function(state) { + while (state.pos < state.source.length && this.regexp_eatTerm(state)) + { } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term + pp$1.regexp_eatTerm = function(state) { + if (this.regexp_eatAssertion(state)) { + // Handle `QuantifiableAssertion Quantifier` alternative. + // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion + // is a QuantifiableAssertion. + if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { + // Make the same message as V8. + if (state.switchU) { + state.raise("Invalid quantifier"); + } + } + return true + } + + if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { + this.regexp_eatQuantifier(state); + return true + } + + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion + pp$1.regexp_eatAssertion = function(state) { + var start = state.pos; + state.lastAssertionIsQuantifiable = false; + + // ^, $ + if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) { + return true + } + + // \b \B + if (state.eat(0x5C /* \ */)) { + if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) { + return true + } + state.pos = start; + } + + // Lookahead / Lookbehind + if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) { + var lookbehind = false; + if (this.options.ecmaVersion >= 9) { + lookbehind = state.eat(0x3C /* < */); + } + if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) { + this.regexp_disjunction(state); + if (!state.eat(0x29 /* ) */)) { + state.raise("Unterminated group"); + } + state.lastAssertionIsQuantifiable = !lookbehind; + return true + } + } + + state.pos = start; + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier + pp$1.regexp_eatQuantifier = function(state, noError) { + if ( noError === void 0 ) noError = false; + + if (this.regexp_eatQuantifierPrefix(state, noError)) { + state.eat(0x3F /* ? */); + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix + pp$1.regexp_eatQuantifierPrefix = function(state, noError) { + return ( + state.eat(0x2A /* * */) || + state.eat(0x2B /* + */) || + state.eat(0x3F /* ? */) || + this.regexp_eatBracedQuantifier(state, noError) + ) + }; + pp$1.regexp_eatBracedQuantifier = function(state, noError) { + var start = state.pos; + if (state.eat(0x7B /* { */)) { + var min = 0, max = -1; + if (this.regexp_eatDecimalDigits(state)) { + min = state.lastIntValue; + if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) { + max = state.lastIntValue; + } + if (state.eat(0x7D /* } */)) { + // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term + if (max !== -1 && max < min && !noError) { + state.raise("numbers out of order in {} quantifier"); + } + return true + } + } + if (state.switchU && !noError) { + state.raise("Incomplete quantifier"); + } + state.pos = start; + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom + pp$1.regexp_eatAtom = function(state) { + return ( + this.regexp_eatPatternCharacters(state) || + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) + ) + }; + pp$1.regexp_eatReverseSolidusAtomEscape = function(state) { + var start = state.pos; + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatAtomEscape(state)) { + return true + } + state.pos = start; + } + return false + }; + pp$1.regexp_eatUncapturingGroup = function(state) { + var start = state.pos; + if (state.eat(0x28 /* ( */)) { + if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) { + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + return true + } + state.raise("Unterminated group"); + } + state.pos = start; + } + return false + }; + pp$1.regexp_eatCapturingGroup = function(state) { + if (state.eat(0x28 /* ( */)) { + if (this.options.ecmaVersion >= 9) { + this.regexp_groupSpecifier(state); + } else if (state.current() === 0x3F /* ? */) { + state.raise("Invalid group"); + } + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + state.numCapturingParens += 1; + return true + } + state.raise("Unterminated group"); + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom + pp$1.regexp_eatExtendedAtom = function(state) { + return ( + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) || + this.regexp_eatInvalidBracedQuantifier(state) || + this.regexp_eatExtendedPatternCharacter(state) + ) + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier + pp$1.regexp_eatInvalidBracedQuantifier = function(state) { + if (this.regexp_eatBracedQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter + pp$1.regexp_eatSyntaxCharacter = function(state) { + var ch = state.current(); + if (isSyntaxCharacter(ch)) { + state.lastIntValue = ch; + state.advance(); + return true + } + return false + }; + function isSyntaxCharacter(ch) { + return ( + ch === 0x24 /* $ */ || + ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ || + ch === 0x2E /* . */ || + ch === 0x3F /* ? */ || + ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ || + ch >= 0x7B /* { */ && ch <= 0x7D /* } */ + ) + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter + // But eat eager. + pp$1.regexp_eatPatternCharacters = function(state) { + var start = state.pos; + var ch = 0; + while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { + state.advance(); + } + return state.pos !== start + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter + pp$1.regexp_eatExtendedPatternCharacter = function(state) { + var ch = state.current(); + if ( + ch !== -1 && + ch !== 0x24 /* $ */ && + !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) && + ch !== 0x2E /* . */ && + ch !== 0x3F /* ? */ && + ch !== 0x5B /* [ */ && + ch !== 0x5E /* ^ */ && + ch !== 0x7C /* | */ + ) { + state.advance(); + return true + } + return false + }; + + // GroupSpecifier :: + // [empty] + // `?` GroupName + pp$1.regexp_groupSpecifier = function(state) { + if (state.eat(0x3F /* ? */)) { + if (this.regexp_eatGroupName(state)) { + if (state.groupNames.indexOf(state.lastStringValue) !== -1) { + state.raise("Duplicate capture group name"); + } + state.groupNames.push(state.lastStringValue); + return + } + state.raise("Invalid group"); + } + }; + + // GroupName :: + // `<` RegExpIdentifierName `>` + // Note: this updates `state.lastStringValue` property with the eaten name. + pp$1.regexp_eatGroupName = function(state) { + state.lastStringValue = ""; + if (state.eat(0x3C /* < */)) { + if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { + return true + } + state.raise("Invalid capture group name"); + } + return false + }; + + // RegExpIdentifierName :: + // RegExpIdentifierStart + // RegExpIdentifierName RegExpIdentifierPart + // Note: this updates `state.lastStringValue` property with the eaten name. + pp$1.regexp_eatRegExpIdentifierName = function(state) { + state.lastStringValue = ""; + if (this.regexp_eatRegExpIdentifierStart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); + while (this.regexp_eatRegExpIdentifierPart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); + } + return true + } + return false + }; + + // RegExpIdentifierStart :: + // UnicodeIDStart + // `$` + // `_` + // `\` RegExpUnicodeEscapeSequence[+U] + pp$1.regexp_eatRegExpIdentifierStart = function(state) { + var start = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); + + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierStart(ch)) { + state.lastIntValue = ch; + return true + } + + state.pos = start; + return false + }; + function isRegExpIdentifierStart(ch) { + return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ + } + + // RegExpIdentifierPart :: + // UnicodeIDContinue + // `$` + // `_` + // `\` RegExpUnicodeEscapeSequence[+U] + // + // + pp$1.regexp_eatRegExpIdentifierPart = function(state) { + var start = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); + + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierPart(ch)) { + state.lastIntValue = ch; + return true + } + + state.pos = start; + return false + }; + function isRegExpIdentifierPart(ch) { + return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape + pp$1.regexp_eatAtomEscape = function(state) { + if ( + this.regexp_eatBackReference(state) || + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) || + (state.switchN && this.regexp_eatKGroupName(state)) + ) { + return true + } + if (state.switchU) { + // Make the same message as V8. + if (state.current() === 0x63 /* c */) { + state.raise("Invalid unicode escape"); + } + state.raise("Invalid escape"); + } + return false + }; + pp$1.regexp_eatBackReference = function(state) { + var start = state.pos; + if (this.regexp_eatDecimalEscape(state)) { + var n = state.lastIntValue; + if (state.switchU) { + // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape + if (n > state.maxBackReference) { + state.maxBackReference = n; + } + return true + } + if (n <= state.numCapturingParens) { + return true + } + state.pos = start; + } + return false + }; + pp$1.regexp_eatKGroupName = function(state) { + if (state.eat(0x6B /* k */)) { + if (this.regexp_eatGroupName(state)) { + state.backReferenceNames.push(state.lastStringValue); + return true + } + state.raise("Invalid named reference"); + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape + pp$1.regexp_eatCharacterEscape = function(state) { + return ( + this.regexp_eatControlEscape(state) || + this.regexp_eatCControlLetter(state) || + this.regexp_eatZero(state) || + this.regexp_eatHexEscapeSequence(state) || + this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || + (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) || + this.regexp_eatIdentityEscape(state) + ) + }; + pp$1.regexp_eatCControlLetter = function(state) { + var start = state.pos; + if (state.eat(0x63 /* c */)) { + if (this.regexp_eatControlLetter(state)) { + return true + } + state.pos = start; + } + return false + }; + pp$1.regexp_eatZero = function(state) { + if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { + state.lastIntValue = 0; + state.advance(); + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape + pp$1.regexp_eatControlEscape = function(state) { + var ch = state.current(); + if (ch === 0x74 /* t */) { + state.lastIntValue = 0x09; /* \t */ + state.advance(); + return true + } + if (ch === 0x6E /* n */) { + state.lastIntValue = 0x0A; /* \n */ + state.advance(); + return true + } + if (ch === 0x76 /* v */) { + state.lastIntValue = 0x0B; /* \v */ + state.advance(); + return true + } + if (ch === 0x66 /* f */) { + state.lastIntValue = 0x0C; /* \f */ + state.advance(); + return true + } + if (ch === 0x72 /* r */) { + state.lastIntValue = 0x0D; /* \r */ + state.advance(); + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter + pp$1.regexp_eatControlLetter = function(state) { + var ch = state.current(); + if (isControlLetter(ch)) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true + } + return false + }; + function isControlLetter(ch) { + return ( + (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) || + (ch >= 0x61 /* a */ && ch <= 0x7A /* z */) + ) + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence + pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { + if ( forceU === void 0 ) forceU = false; + + var start = state.pos; + var switchU = forceU || state.switchU; + + if (state.eat(0x75 /* u */)) { + if (this.regexp_eatFixedHexDigits(state, 4)) { + var lead = state.lastIntValue; + if (switchU && lead >= 0xD800 && lead <= 0xDBFF) { + var leadSurrogateEnd = state.pos; + if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) { + var trail = state.lastIntValue; + if (trail >= 0xDC00 && trail <= 0xDFFF) { + state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; + return true + } + } + state.pos = leadSurrogateEnd; + state.lastIntValue = lead; + } + return true + } + if ( + switchU && + state.eat(0x7B /* { */) && + this.regexp_eatHexDigits(state) && + state.eat(0x7D /* } */) && + isValidUnicode(state.lastIntValue) + ) { + return true + } + if (switchU) { + state.raise("Invalid unicode escape"); + } + state.pos = start; + } + + return false + }; + function isValidUnicode(ch) { + return ch >= 0 && ch <= 0x10FFFF + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape + pp$1.regexp_eatIdentityEscape = function(state) { + if (state.switchU) { + if (this.regexp_eatSyntaxCharacter(state)) { + return true + } + if (state.eat(0x2F /* / */)) { + state.lastIntValue = 0x2F; /* / */ + return true + } + return false + } + + var ch = state.current(); + if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) { + state.lastIntValue = ch; + state.advance(); + return true + } + + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape + pp$1.regexp_eatDecimalEscape = function(state) { + state.lastIntValue = 0; + var ch = state.current(); + if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { + do { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape + pp$1.regexp_eatCharacterClassEscape = function(state) { + var ch = state.current(); + + if (isCharacterClassEscape(ch)) { + state.lastIntValue = -1; + state.advance(); + return true + } + + if ( + state.switchU && + this.options.ecmaVersion >= 9 && + (ch === 0x50 /* P */ || ch === 0x70 /* p */) + ) { + state.lastIntValue = -1; + state.advance(); + if ( + state.eat(0x7B /* { */) && + this.regexp_eatUnicodePropertyValueExpression(state) && + state.eat(0x7D /* } */) + ) { + return true + } + state.raise("Invalid property name"); + } + + return false + }; + function isCharacterClassEscape(ch) { + return ( + ch === 0x64 /* d */ || + ch === 0x44 /* D */ || + ch === 0x73 /* s */ || + ch === 0x53 /* S */ || + ch === 0x77 /* w */ || + ch === 0x57 /* W */ + ) + } + + // UnicodePropertyValueExpression :: + // UnicodePropertyName `=` UnicodePropertyValue + // LoneUnicodePropertyNameOrValue + pp$1.regexp_eatUnicodePropertyValueExpression = function(state) { + var start = state.pos; + + // UnicodePropertyName `=` UnicodePropertyValue + if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) { + var name = state.lastStringValue; + if (this.regexp_eatUnicodePropertyValue(state)) { + var value = state.lastStringValue; + this.regexp_validateUnicodePropertyNameAndValue(state, name, value); + return true + } + } + state.pos = start; + + // LoneUnicodePropertyNameOrValue + if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { + var nameOrValue = state.lastStringValue; + this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); + return true + } + return false + }; + pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { + if (!hasOwn(state.unicodeProperties.nonBinary, name)) + { state.raise("Invalid property name"); } + if (!state.unicodeProperties.nonBinary[name].test(value)) + { state.raise("Invalid property value"); } + }; + pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { + if (!state.unicodeProperties.binary.test(nameOrValue)) + { state.raise("Invalid property name"); } + }; + + // UnicodePropertyName :: + // UnicodePropertyNameCharacters + pp$1.regexp_eatUnicodePropertyName = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyNameCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); + } + return state.lastStringValue !== "" + }; + function isUnicodePropertyNameCharacter(ch) { + return isControlLetter(ch) || ch === 0x5F /* _ */ + } + + // UnicodePropertyValue :: + // UnicodePropertyValueCharacters + pp$1.regexp_eatUnicodePropertyValue = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyValueCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); + } + return state.lastStringValue !== "" + }; + function isUnicodePropertyValueCharacter(ch) { + return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch) + } + + // LoneUnicodePropertyNameOrValue :: + // UnicodePropertyValueCharacters + pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { + return this.regexp_eatUnicodePropertyValue(state) + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass + pp$1.regexp_eatCharacterClass = function(state) { + if (state.eat(0x5B /* [ */)) { + state.eat(0x5E /* ^ */); + this.regexp_classRanges(state); + if (state.eat(0x5D /* ] */)) { + return true + } + // Unreachable since it threw "unterminated regular expression" error before. + state.raise("Unterminated character class"); + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges + // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges + // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash + pp$1.regexp_classRanges = function(state) { + while (this.regexp_eatClassAtom(state)) { + var left = state.lastIntValue; + if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) { + var right = state.lastIntValue; + if (state.switchU && (left === -1 || right === -1)) { + state.raise("Invalid character class"); + } + if (left !== -1 && right !== -1 && left > right) { + state.raise("Range out of order in character class"); + } + } + } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash + pp$1.regexp_eatClassAtom = function(state) { + var start = state.pos; + + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatClassEscape(state)) { + return true + } + if (state.switchU) { + // Make the same message as V8. + var ch$1 = state.current(); + if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) { + state.raise("Invalid class escape"); + } + state.raise("Invalid escape"); + } + state.pos = start; + } + + var ch = state.current(); + if (ch !== 0x5D /* ] */) { + state.lastIntValue = ch; + state.advance(); + return true + } + + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape + pp$1.regexp_eatClassEscape = function(state) { + var start = state.pos; + + if (state.eat(0x62 /* b */)) { + state.lastIntValue = 0x08; /* */ + return true + } + + if (state.switchU && state.eat(0x2D /* - */)) { + state.lastIntValue = 0x2D; /* - */ + return true + } + + if (!state.switchU && state.eat(0x63 /* c */)) { + if (this.regexp_eatClassControlLetter(state)) { + return true + } + state.pos = start; + } + + return ( + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) + ) + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter + pp$1.regexp_eatClassControlLetter = function(state) { + var ch = state.current(); + if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence + pp$1.regexp_eatHexEscapeSequence = function(state) { + var start = state.pos; + if (state.eat(0x78 /* x */)) { + if (this.regexp_eatFixedHexDigits(state, 2)) { + return true + } + if (state.switchU) { + state.raise("Invalid escape"); + } + state.pos = start; + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits + pp$1.regexp_eatDecimalDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isDecimalDigit(ch = state.current())) { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } + return state.pos !== start + }; + function isDecimalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits + pp$1.regexp_eatHexDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isHexDigit(ch = state.current())) { + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return state.pos !== start + }; + function isHexDigit(ch) { + return ( + (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) || + (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) || + (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) + ) + } + function hexToInt(ch) { + if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) { + return 10 + (ch - 0x41 /* A */) + } + if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) { + return 10 + (ch - 0x61 /* a */) + } + return ch - 0x30 /* 0 */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence + // Allows only 0-377(octal) i.e. 0-255(decimal). + pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) { + if (this.regexp_eatOctalDigit(state)) { + var n1 = state.lastIntValue; + if (this.regexp_eatOctalDigit(state)) { + var n2 = state.lastIntValue; + if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { + state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; + } else { + state.lastIntValue = n1 * 8 + n2; + } + } else { + state.lastIntValue = n1; + } + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit + pp$1.regexp_eatOctalDigit = function(state) { + var ch = state.current(); + if (isOctalDigit(ch)) { + state.lastIntValue = ch - 0x30; /* 0 */ + state.advance(); + return true + } + state.lastIntValue = 0; + return false + }; + function isOctalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit + // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence + pp$1.regexp_eatFixedHexDigits = function(state, length) { + var start = state.pos; + state.lastIntValue = 0; + for (var i = 0; i < length; ++i) { + var ch = state.current(); + if (!isHexDigit(ch)) { + state.pos = start; + return false + } + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return true + }; + + // Object type used to represent tokens. Note that normally, tokens + // simply exist as properties on the parser object. This is only + // used for the onToken callback and the external tokenizer. + + var Token = function Token(p) { + this.type = p.type; + this.value = p.value; + this.start = p.start; + this.end = p.end; + if (p.options.locations) + { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); } + if (p.options.ranges) + { this.range = [p.start, p.end]; } + }; + + // ## Tokenizer + + var pp = Parser.prototype; + + // Move to the next token + + pp.next = function(ignoreEscapeSequenceInKeyword) { + if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) + { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); } + if (this.options.onToken) + { this.options.onToken(new Token(this)); } + + this.lastTokEnd = this.end; + this.lastTokStart = this.start; + this.lastTokEndLoc = this.endLoc; + this.lastTokStartLoc = this.startLoc; + this.nextToken(); + }; + + pp.getToken = function() { + this.next(); + return new Token(this) + }; + + // If we're in an ES6 environment, make parsers iterable + if (typeof Symbol !== "undefined") + { pp[Symbol.iterator] = function() { + var this$1$1 = this; + + return { + next: function () { + var token = this$1$1.getToken(); + return { + done: token.type === types$1.eof, + value: token + } + } + } + }; } + + // Toggle strict mode. Re-reads the next number or string to please + // pedantic tests (`"use strict"; 010;` should fail). + + // Read a single token, updating the parser object's token-related + // properties. + + pp.nextToken = function() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } + + this.start = this.pos; + if (this.options.locations) { this.startLoc = this.curPosition(); } + if (this.pos >= this.input.length) { return this.finishToken(types$1.eof) } + + if (curContext.override) { return curContext.override(this) } + else { this.readToken(this.fullCharCodeAtPos()); } + }; + + pp.readToken = function(code) { + // Identifier or keyword. '\uXXXX' sequences are allowed in + // identifiers, so '\' also dispatches to that. + if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) + { return this.readWord() } + + return this.getTokenFromCode(code) + }; + + pp.fullCharCodeAtPos = function() { + var code = this.input.charCodeAt(this.pos); + if (code <= 0xd7ff || code >= 0xdc00) { return code } + var next = this.input.charCodeAt(this.pos + 1); + return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00 + }; + + pp.skipBlockComment = function() { + var startLoc = this.options.onComment && this.curPosition(); + var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); + if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } + this.pos = end + 2; + if (this.options.locations) { + for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) { + ++this.curLine; + pos = this.lineStart = nextBreak; + } + } + if (this.options.onComment) + { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, + startLoc, this.curPosition()); } + }; + + pp.skipLineComment = function(startSkip) { + var start = this.pos; + var startLoc = this.options.onComment && this.curPosition(); + var ch = this.input.charCodeAt(this.pos += startSkip); + while (this.pos < this.input.length && !isNewLine(ch)) { + ch = this.input.charCodeAt(++this.pos); + } + if (this.options.onComment) + { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, + startLoc, this.curPosition()); } + }; + + // Called at the start of the parse and after every token. Skips + // whitespace and comments, and. + + pp.skipSpace = function() { + loop: while (this.pos < this.input.length) { + var ch = this.input.charCodeAt(this.pos); + switch (ch) { + case 32: case 160: // ' ' + ++this.pos; + break + case 13: + if (this.input.charCodeAt(this.pos + 1) === 10) { + ++this.pos; + } + case 10: case 8232: case 8233: + ++this.pos; + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + break + case 47: // '/' + switch (this.input.charCodeAt(this.pos + 1)) { + case 42: // '*' + this.skipBlockComment(); + break + case 47: + this.skipLineComment(2); + break + default: + break loop + } + break + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this.pos; + } else { + break loop + } + } + } + }; + + // Called at the end of every token. Sets `end`, `val`, and + // maintains `context` and `exprAllowed`, and skips the space after + // the token, so that the next one's `start` will point at the + // right position. + + pp.finishToken = function(type, val) { + this.end = this.pos; + if (this.options.locations) { this.endLoc = this.curPosition(); } + var prevType = this.type; + this.type = type; + this.value = val; + + this.updateContext(prevType); + }; + + // ### Token reading + + // This is the function that is called to fetch the next token. It + // is somewhat obscure, because it works in character codes rather + // than characters, and because operator parsing has been inlined + // into it. + // + // All in the name of speed. + // + pp.readToken_dot = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next >= 48 && next <= 57) { return this.readNumber(true) } + var next2 = this.input.charCodeAt(this.pos + 2); + if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' + this.pos += 3; + return this.finishToken(types$1.ellipsis) + } else { + ++this.pos; + return this.finishToken(types$1.dot) + } + }; + + pp.readToken_slash = function() { // '/' + var next = this.input.charCodeAt(this.pos + 1); + if (this.exprAllowed) { ++this.pos; return this.readRegexp() } + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(types$1.slash, 1) + }; + + pp.readToken_mult_modulo_exp = function(code) { // '%*' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + var tokentype = code === 42 ? types$1.star : types$1.modulo; + + // exponentiation operator ** and **= + if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { + ++size; + tokentype = types$1.starstar; + next = this.input.charCodeAt(this.pos + 2); + } + + if (next === 61) { return this.finishOp(types$1.assign, size + 1) } + return this.finishOp(tokentype, size) + }; + + pp.readToken_pipe_amp = function(code) { // '|&' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (this.options.ecmaVersion >= 12) { + var next2 = this.input.charCodeAt(this.pos + 2); + if (next2 === 61) { return this.finishOp(types$1.assign, 3) } + } + return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2) + } + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1) + }; + + pp.readToken_caret = function() { // '^' + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(types$1.bitwiseXOR, 1) + }; + + pp.readToken_plus_min = function(code) { // '+-' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && + (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { + // A `-->` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken() + } + return this.finishOp(types$1.incDec, 2) + } + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(types$1.plusMin, 1) + }; + + pp.readToken_lt_gt = function(code) { // '<>' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) } + return this.finishOp(types$1.bitShift, size) + } + if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && + this.input.charCodeAt(this.pos + 3) === 45) { + // `` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken() + } + return this.finishOp(types$1.incDec, 2) + } + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(types$1.plusMin, 1) +}; + +pp.readToken_lt_gt = function(code) { // '<>' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) } + return this.finishOp(types$1.bitShift, size) + } + if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && + this.input.charCodeAt(this.pos + 3) === 45) { + // ` +| ✔ | 🔧 | 💡 | Rule | Description | +| :---: | :---: | :---: | :--- | :--- | +| | | | [react/boolean-prop-naming](docs/rules/boolean-prop-naming.md) | Enforces consistent naming for boolean props | +| | | | [react/button-has-type](docs/rules/button-has-type.md) | Disallow usage of `button` elements without an explicit `type` attribute | +| | | | [react/default-props-match-prop-types](docs/rules/default-props-match-prop-types.md) | Enforce all defaultProps have a corresponding non-required PropType | +| | 🔧 | | [react/destructuring-assignment](docs/rules/destructuring-assignment.md) | Enforce consistent usage of destructuring assignment of props, state, and context | +| ✔ | | | [react/display-name](docs/rules/display-name.md) | Disallow missing displayName in a React component definition | +| | | | [react/forbid-component-props](docs/rules/forbid-component-props.md) | Disallow certain props on components | +| | | | [react/forbid-dom-props](docs/rules/forbid-dom-props.md) | Disallow certain props on DOM Nodes | +| | | | [react/forbid-elements](docs/rules/forbid-elements.md) | Disallow certain elements | +| | | | [react/forbid-foreign-prop-types](docs/rules/forbid-foreign-prop-types.md) | Disallow using another component's propTypes | +| | | | [react/forbid-prop-types](docs/rules/forbid-prop-types.md) | Disallow certain propTypes | +| | 🔧 | | [react/function-component-definition](docs/rules/function-component-definition.md) | Enforce a specific function type for function components | +| | | 💡 | [react/hook-use-state](docs/rules/hook-use-state.md) | Ensure destructuring and symmetric naming of useState hook value and setter variables | +| | | | [react/iframe-missing-sandbox](docs/rules/iframe-missing-sandbox.md) | Enforce sandbox attribute on iframe elements | +| | | | [react/no-access-state-in-setstate](docs/rules/no-access-state-in-setstate.md) | Disallow when this.state is accessed within setState | +| | | | [react/no-adjacent-inline-elements](docs/rules/no-adjacent-inline-elements.md) | Disallow adjacent inline elements not separated by whitespace. | +| | | | [react/no-array-index-key](docs/rules/no-array-index-key.md) | Disallow usage of Array index in keys | +| | 🔧 | | [react/no-arrow-function-lifecycle](docs/rules/no-arrow-function-lifecycle.md) | Lifecycle methods should be methods on the prototype, not class fields | +| ✔ | | | [react/no-children-prop](docs/rules/no-children-prop.md) | Disallow passing of children as props | +| | | | [react/no-danger](docs/rules/no-danger.md) | Disallow usage of dangerous JSX properties | +| ✔ | | | [react/no-danger-with-children](docs/rules/no-danger-with-children.md) | Disallow when a DOM element is using both children and dangerouslySetInnerHTML | +| ✔ | | | [react/no-deprecated](docs/rules/no-deprecated.md) | Disallow usage of deprecated methods | +| | | | [react/no-did-mount-set-state](docs/rules/no-did-mount-set-state.md) | Disallow usage of setState in componentDidMount | +| | | | [react/no-did-update-set-state](docs/rules/no-did-update-set-state.md) | Disallow usage of setState in componentDidUpdate | +| ✔ | | | [react/no-direct-mutation-state](docs/rules/no-direct-mutation-state.md) | Disallow direct mutation of this.state | +| ✔ | | | [react/no-find-dom-node](docs/rules/no-find-dom-node.md) | Disallow usage of findDOMNode | +| | 🔧 | | [react/no-invalid-html-attribute](docs/rules/no-invalid-html-attribute.md) | Disallow usage of invalid attributes | +| ✔ | | | [react/no-is-mounted](docs/rules/no-is-mounted.md) | Disallow usage of isMounted | +| | | | [react/no-multi-comp](docs/rules/no-multi-comp.md) | Disallow multiple component definition per file | +| | | | [react/no-namespace](docs/rules/no-namespace.md) | Enforce that namespaces are not used in React elements | +| | | | [react/no-redundant-should-component-update](docs/rules/no-redundant-should-component-update.md) | Disallow usage of shouldComponentUpdate when extending React.PureComponent | +| ✔ | | | [react/no-render-return-value](docs/rules/no-render-return-value.md) | Disallow usage of the return value of ReactDOM.render | +| | | | [react/no-set-state](docs/rules/no-set-state.md) | Disallow usage of setState | +| ✔ | | | [react/no-string-refs](docs/rules/no-string-refs.md) | Disallow using string references | +| | | | [react/no-this-in-sfc](docs/rules/no-this-in-sfc.md) | Disallow `this` from being used in stateless functional components | +| | | | [react/no-typos](docs/rules/no-typos.md) | Disallow common typos | +| ✔ | | | [react/no-unescaped-entities](docs/rules/no-unescaped-entities.md) | Disallow unescaped HTML entities from appearing in markup | +| ✔ | 🔧 | | [react/no-unknown-property](docs/rules/no-unknown-property.md) | Disallow usage of unknown DOM property | +| | | | [react/no-unsafe](docs/rules/no-unsafe.md) | Disallow usage of unsafe lifecycle methods | +| | | | [react/no-unstable-nested-components](docs/rules/no-unstable-nested-components.md) | Disallow creating unstable components inside components | +| | | | [react/no-unused-class-component-methods](docs/rules/no-unused-class-component-methods.md) | Disallow declaring unused methods of component class | +| | | | [react/no-unused-prop-types](docs/rules/no-unused-prop-types.md) | Disallow definitions of unused propTypes | +| | | | [react/no-unused-state](docs/rules/no-unused-state.md) | Disallow definitions of unused state | +| | | | [react/no-will-update-set-state](docs/rules/no-will-update-set-state.md) | Disallow usage of setState in componentWillUpdate | +| | | | [react/prefer-es6-class](docs/rules/prefer-es6-class.md) | Enforce ES5 or ES6 class for React Components | +| | | | [react/prefer-exact-props](docs/rules/prefer-exact-props.md) | Prefer exact proptype definitions | +| | 🔧 | | [react/prefer-read-only-props](docs/rules/prefer-read-only-props.md) | Enforce that props are read-only | +| | | | [react/prefer-stateless-function](docs/rules/prefer-stateless-function.md) | Enforce stateless components to be written as a pure function | +| ✔ | | | [react/prop-types](docs/rules/prop-types.md) | Disallow missing props validation in a React component definition | +| ✔ | | | [react/react-in-jsx-scope](docs/rules/react-in-jsx-scope.md) | Disallow missing React when using JSX | +| | | | [react/require-default-props](docs/rules/require-default-props.md) | Enforce a defaultProps definition for every prop that is not a required prop | +| | | | [react/require-optimization](docs/rules/require-optimization.md) | Enforce React components to have a shouldComponentUpdate method | +| ✔ | | | [react/require-render-return](docs/rules/require-render-return.md) | Enforce ES5 or ES6 class for returning value in render function | +| | 🔧 | | [react/self-closing-comp](docs/rules/self-closing-comp.md) | Disallow extra closing tags for components without children | +| | | | [react/sort-comp](docs/rules/sort-comp.md) | Enforce component methods order | +| | | | [react/sort-prop-types](docs/rules/sort-prop-types.md) | Enforce propTypes declarations alphabetical sorting | +| | | | [react/state-in-constructor](docs/rules/state-in-constructor.md) | Enforce class component state initialization style | +| | | | [react/static-property-placement](docs/rules/static-property-placement.md) | Enforces where React component static properties should be positioned. | +| | | | [react/style-prop-object](docs/rules/style-prop-object.md) | Enforce style prop value is an object | +| | | | [react/void-dom-elements-no-children](docs/rules/void-dom-elements-no-children.md) | Disallow void DOM elements (e.g. ``, `
`) from receiving children | + + +### JSX-specific rules + + +| ✔ | 🔧 | 💡 | Rule | Description | +| :---: | :---: | :---: | :--- | :--- | +| | 🔧 | | [react/jsx-boolean-value](docs/rules/jsx-boolean-value.md) | Enforce boolean attributes notation in JSX | +| | | | [react/jsx-child-element-spacing](docs/rules/jsx-child-element-spacing.md) | Enforce or disallow spaces inside of curly braces in JSX attributes and expressions | +| | 🔧 | | [react/jsx-closing-bracket-location](docs/rules/jsx-closing-bracket-location.md) | Enforce closing bracket location in JSX | +| | 🔧 | | [react/jsx-closing-tag-location](docs/rules/jsx-closing-tag-location.md) | Enforce closing tag location for multiline JSX | +| | 🔧 | | [react/jsx-curly-brace-presence](docs/rules/jsx-curly-brace-presence.md) | Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes | +| | 🔧 | | [react/jsx-curly-newline](docs/rules/jsx-curly-newline.md) | Enforce consistent linebreaks in curly braces in JSX attributes and expressions | +| | 🔧 | | [react/jsx-curly-spacing](docs/rules/jsx-curly-spacing.md) | Enforce or disallow spaces inside of curly braces in JSX attributes and expressions | +| | 🔧 | | [react/jsx-equals-spacing](docs/rules/jsx-equals-spacing.md) | Enforce or disallow spaces around equal signs in JSX attributes | +| | | | [react/jsx-filename-extension](docs/rules/jsx-filename-extension.md) | Disallow file extensions that may contain JSX | +| | 🔧 | | [react/jsx-first-prop-new-line](docs/rules/jsx-first-prop-new-line.md) | Enforce proper position of the first property in JSX | +| | 🔧 | | [react/jsx-fragments](docs/rules/jsx-fragments.md) | Enforce shorthand or standard form for React fragments | +| | | | [react/jsx-handler-names](docs/rules/jsx-handler-names.md) | Enforce event handler naming conventions in JSX | +| | 🔧 | | [react/jsx-indent](docs/rules/jsx-indent.md) | Enforce JSX indentation | +| | 🔧 | | [react/jsx-indent-props](docs/rules/jsx-indent-props.md) | Enforce props indentation in JSX | +| ✔ | | | [react/jsx-key](docs/rules/jsx-key.md) | Disallow missing `key` props in iterators/collection literals | +| | | | [react/jsx-max-depth](docs/rules/jsx-max-depth.md) | Enforce JSX maximum depth | +| | 🔧 | | [react/jsx-max-props-per-line](docs/rules/jsx-max-props-per-line.md) | Enforce maximum of props on a single line in JSX | +| | 🔧 | | [react/jsx-newline](docs/rules/jsx-newline.md) | Require or prevent a new line after jsx elements and expressions. | +| | | | [react/jsx-no-bind](docs/rules/jsx-no-bind.md) | Disallow `.bind()` or arrow functions in JSX props | +| ✔ | | | [react/jsx-no-comment-textnodes](docs/rules/jsx-no-comment-textnodes.md) | Disallow comments from being inserted as text nodes | +| | | | [react/jsx-no-constructed-context-values](docs/rules/jsx-no-constructed-context-values.md) | Disallows JSX context provider values from taking values that will cause needless rerenders | +| ✔ | | | [react/jsx-no-duplicate-props](docs/rules/jsx-no-duplicate-props.md) | Disallow duplicate properties in JSX | +| | 🔧 | | [react/jsx-no-leaked-render](docs/rules/jsx-no-leaked-render.md) | Disallow problematic leaked values from being rendered | +| | | | [react/jsx-no-literals](docs/rules/jsx-no-literals.md) | Disallow usage of string literals in JSX | +| | | | [react/jsx-no-script-url](docs/rules/jsx-no-script-url.md) | Disallow usage of `javascript:` URLs | +| ✔ | 🔧 | | [react/jsx-no-target-blank](docs/rules/jsx-no-target-blank.md) | Disallow `target="_blank"` attribute without `rel="noreferrer"` | +| ✔ | | | [react/jsx-no-undef](docs/rules/jsx-no-undef.md) | Disallow undeclared variables in JSX | +| | 🔧 | | [react/jsx-no-useless-fragment](docs/rules/jsx-no-useless-fragment.md) | Disallow unnecessary fragments | +| | 🔧 | | [react/jsx-one-expression-per-line](docs/rules/jsx-one-expression-per-line.md) | Require one JSX element per line | +| | | | [react/jsx-pascal-case](docs/rules/jsx-pascal-case.md) | Enforce PascalCase for user-defined JSX components | +| | 🔧 | | [react/jsx-props-no-multi-spaces](docs/rules/jsx-props-no-multi-spaces.md) | Disallow multiple spaces between inline JSX props | +| | | | [react/jsx-props-no-spreading](docs/rules/jsx-props-no-spreading.md) | Disallow JSX prop spreading | +| | | | [react/jsx-sort-default-props](docs/rules/jsx-sort-default-props.md) | Enforce defaultProps declarations alphabetical sorting | +| | 🔧 | | [react/jsx-sort-props](docs/rules/jsx-sort-props.md) | Enforce props alphabetical sorting | +| | 🔧 | | [react/jsx-space-before-closing](docs/rules/jsx-space-before-closing.md) | Enforce spacing before closing bracket in JSX. ❌ This rule is deprecated. | +| | 🔧 | | [react/jsx-tag-spacing](docs/rules/jsx-tag-spacing.md) | Enforce whitespace in and around the JSX opening and closing brackets | +| ✔ | | | [react/jsx-uses-react](docs/rules/jsx-uses-react.md) | Disallow React to be incorrectly marked as unused | +| ✔ | | | [react/jsx-uses-vars](docs/rules/jsx-uses-vars.md) | Disallow variables used in JSX to be incorrectly marked as unused | +| | 🔧 | | [react/jsx-wrap-multilines](docs/rules/jsx-wrap-multilines.md) | Disallow missing parentheses around multiline JSX | + + +### Other useful plugins + +- Rules of Hooks: [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/master/packages/eslint-plugin-react-hooks) +- JSX accessibility: [eslint-plugin-jsx-a11y](https://github.com/evcohen/eslint-plugin-jsx-a11y) +- React Native: [eslint-plugin-react-native](https://github.com/Intellicode/eslint-plugin-react-native) + +## Shareable configurations + +### Recommended + +This plugin exports a `recommended` configuration that enforces React good practices. + +To enable this configuration use the `extends` property in your `.eslintrc` config file: + +```json +{ + "extends": ["eslint:recommended", "plugin:react/recommended"] +} +``` + +See [`eslint` documentation](https://eslint.org/docs/user-guide/configuring/configuration-files#extending-configuration-files) for more information about extending configuration files. + +### All + +This plugin also exports an `all` configuration that includes every available rule. +This pairs well with the `eslint:all` rule. + +```json +{ + "plugins": [ + "react" + ], + "extends": ["eslint:all", "plugin:react/all"] +} +``` + +**Note**: These configurations will import `eslint-plugin-react` and enable JSX in [parser options](https://eslint.org/docs/user-guide/configuring/language-options#specifying-parser-options). + +## License + +`eslint-plugin-react` is licensed under the [MIT License](https://opensource.org/licenses/mit-license.php). + +[npm-url]: https://npmjs.org/package/eslint-plugin-react +[npm-image]: https://img.shields.io/npm/v/eslint-plugin-react.svg + +[status-url]: https://github.com/jsx-eslint/eslint-plugin-react/pulse +[status-image]: https://img.shields.io/github/last-commit/jsx-eslint/eslint-plugin-react.svg + +[tidelift-url]: https://tidelift.com/subscription/pkg/npm-eslint-plugin-react?utm_source=npm-eslint-plugin-react&utm_medium=referral&utm_campaign=readme +[tidelift-image]: https://tidelift.com/badges/package/npm/eslint-plugin-react?style=flat + +[package-url]: https://npmjs.org/package/eslint-plugin-react +[npm-version-svg]: https://versionbadg.es/jsx-eslint/eslint-plugin-react.svg + +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/jsx-eslint/eslint-plugin-react +[actions-url]: https://github.com/jsx-eslint/eslint-plugin-react/actions diff --git a/node_modules/eslint-plugin-react/index.js b/node_modules/eslint-plugin-react/index.js new file mode 100644 index 000000000..be3c94a99 --- /dev/null +++ b/node_modules/eslint-plugin-react/index.js @@ -0,0 +1,187 @@ +'use strict'; + +const fromEntries = require('object.fromentries'); +const entries = require('object.entries'); + +/* eslint-disable global-require */ +const allRules = { + 'boolean-prop-naming': require('./lib/rules/boolean-prop-naming'), + 'button-has-type': require('./lib/rules/button-has-type'), + 'default-props-match-prop-types': require('./lib/rules/default-props-match-prop-types'), + 'destructuring-assignment': require('./lib/rules/destructuring-assignment'), + 'display-name': require('./lib/rules/display-name'), + 'forbid-component-props': require('./lib/rules/forbid-component-props'), + 'forbid-dom-props': require('./lib/rules/forbid-dom-props'), + 'forbid-elements': require('./lib/rules/forbid-elements'), + 'forbid-foreign-prop-types': require('./lib/rules/forbid-foreign-prop-types'), + 'forbid-prop-types': require('./lib/rules/forbid-prop-types'), + 'function-component-definition': require('./lib/rules/function-component-definition'), + 'hook-use-state': require('./lib/rules/hook-use-state'), + 'iframe-missing-sandbox': require('./lib/rules/iframe-missing-sandbox'), + 'jsx-boolean-value': require('./lib/rules/jsx-boolean-value'), + 'jsx-child-element-spacing': require('./lib/rules/jsx-child-element-spacing'), + 'jsx-closing-bracket-location': require('./lib/rules/jsx-closing-bracket-location'), + 'jsx-closing-tag-location': require('./lib/rules/jsx-closing-tag-location'), + 'jsx-curly-spacing': require('./lib/rules/jsx-curly-spacing'), + 'jsx-curly-newline': require('./lib/rules/jsx-curly-newline'), + 'jsx-equals-spacing': require('./lib/rules/jsx-equals-spacing'), + 'jsx-filename-extension': require('./lib/rules/jsx-filename-extension'), + 'jsx-first-prop-new-line': require('./lib/rules/jsx-first-prop-new-line'), + 'jsx-handler-names': require('./lib/rules/jsx-handler-names'), + 'jsx-indent': require('./lib/rules/jsx-indent'), + 'jsx-indent-props': require('./lib/rules/jsx-indent-props'), + 'jsx-key': require('./lib/rules/jsx-key'), + 'jsx-max-depth': require('./lib/rules/jsx-max-depth'), + 'jsx-max-props-per-line': require('./lib/rules/jsx-max-props-per-line'), + 'jsx-newline': require('./lib/rules/jsx-newline'), + 'jsx-no-bind': require('./lib/rules/jsx-no-bind'), + 'jsx-no-comment-textnodes': require('./lib/rules/jsx-no-comment-textnodes'), + 'jsx-no-constructed-context-values': require('./lib/rules/jsx-no-constructed-context-values'), + 'jsx-no-duplicate-props': require('./lib/rules/jsx-no-duplicate-props'), + 'jsx-no-leaked-render': require('./lib/rules/jsx-no-leaked-render'), + 'jsx-no-literals': require('./lib/rules/jsx-no-literals'), + 'jsx-no-script-url': require('./lib/rules/jsx-no-script-url'), + 'jsx-no-target-blank': require('./lib/rules/jsx-no-target-blank'), + 'jsx-no-useless-fragment': require('./lib/rules/jsx-no-useless-fragment'), + 'jsx-one-expression-per-line': require('./lib/rules/jsx-one-expression-per-line'), + 'jsx-no-undef': require('./lib/rules/jsx-no-undef'), + 'jsx-curly-brace-presence': require('./lib/rules/jsx-curly-brace-presence'), + 'jsx-pascal-case': require('./lib/rules/jsx-pascal-case'), + 'jsx-fragments': require('./lib/rules/jsx-fragments'), + 'jsx-props-no-multi-spaces': require('./lib/rules/jsx-props-no-multi-spaces'), + 'jsx-props-no-spreading': require('./lib/rules/jsx-props-no-spreading'), + 'jsx-sort-default-props': require('./lib/rules/jsx-sort-default-props'), + 'jsx-sort-props': require('./lib/rules/jsx-sort-props'), + 'jsx-space-before-closing': require('./lib/rules/jsx-space-before-closing'), + 'jsx-tag-spacing': require('./lib/rules/jsx-tag-spacing'), + 'jsx-uses-react': require('./lib/rules/jsx-uses-react'), + 'jsx-uses-vars': require('./lib/rules/jsx-uses-vars'), + 'jsx-wrap-multilines': require('./lib/rules/jsx-wrap-multilines'), + 'no-invalid-html-attribute': require('./lib/rules/no-invalid-html-attribute'), + 'no-access-state-in-setstate': require('./lib/rules/no-access-state-in-setstate'), + 'no-adjacent-inline-elements': require('./lib/rules/no-adjacent-inline-elements'), + 'no-array-index-key': require('./lib/rules/no-array-index-key'), + 'no-arrow-function-lifecycle': require('./lib/rules/no-arrow-function-lifecycle'), + 'no-children-prop': require('./lib/rules/no-children-prop'), + 'no-danger': require('./lib/rules/no-danger'), + 'no-danger-with-children': require('./lib/rules/no-danger-with-children'), + 'no-deprecated': require('./lib/rules/no-deprecated'), + 'no-did-mount-set-state': require('./lib/rules/no-did-mount-set-state'), + 'no-did-update-set-state': require('./lib/rules/no-did-update-set-state'), + 'no-direct-mutation-state': require('./lib/rules/no-direct-mutation-state'), + 'no-find-dom-node': require('./lib/rules/no-find-dom-node'), + 'no-is-mounted': require('./lib/rules/no-is-mounted'), + 'no-multi-comp': require('./lib/rules/no-multi-comp'), + 'no-namespace': require('./lib/rules/no-namespace'), + 'no-set-state': require('./lib/rules/no-set-state'), + 'no-string-refs': require('./lib/rules/no-string-refs'), + 'no-redundant-should-component-update': require('./lib/rules/no-redundant-should-component-update'), + 'no-render-return-value': require('./lib/rules/no-render-return-value'), + 'no-this-in-sfc': require('./lib/rules/no-this-in-sfc'), + 'no-typos': require('./lib/rules/no-typos'), + 'no-unescaped-entities': require('./lib/rules/no-unescaped-entities'), + 'no-unknown-property': require('./lib/rules/no-unknown-property'), + 'no-unsafe': require('./lib/rules/no-unsafe'), + 'no-unstable-nested-components': require('./lib/rules/no-unstable-nested-components'), + 'no-unused-class-component-methods': require('./lib/rules/no-unused-class-component-methods'), + 'no-unused-prop-types': require('./lib/rules/no-unused-prop-types'), + 'no-unused-state': require('./lib/rules/no-unused-state'), + 'no-will-update-set-state': require('./lib/rules/no-will-update-set-state'), + 'prefer-es6-class': require('./lib/rules/prefer-es6-class'), + 'prefer-exact-props': require('./lib/rules/prefer-exact-props'), + 'prefer-read-only-props': require('./lib/rules/prefer-read-only-props'), + 'prefer-stateless-function': require('./lib/rules/prefer-stateless-function'), + 'prop-types': require('./lib/rules/prop-types'), + 'react-in-jsx-scope': require('./lib/rules/react-in-jsx-scope'), + 'require-default-props': require('./lib/rules/require-default-props'), + 'require-optimization': require('./lib/rules/require-optimization'), + 'require-render-return': require('./lib/rules/require-render-return'), + 'self-closing-comp': require('./lib/rules/self-closing-comp'), + 'sort-comp': require('./lib/rules/sort-comp'), + 'sort-prop-types': require('./lib/rules/sort-prop-types'), + 'state-in-constructor': require('./lib/rules/state-in-constructor'), + 'static-property-placement': require('./lib/rules/static-property-placement'), + 'style-prop-object': require('./lib/rules/style-prop-object'), + 'void-dom-elements-no-children': require('./lib/rules/void-dom-elements-no-children'), +}; +/* eslint-enable */ + +function filterRules(rules, predicate) { + return fromEntries(entries(rules).filter((entry) => predicate(entry[1]))); +} + +function configureAsError(rules) { + return fromEntries(Object.keys(rules).map((key) => [`react/${key}`, 2])); +} + +const activeRules = filterRules(allRules, (rule) => !rule.meta.deprecated); +const activeRulesConfig = configureAsError(activeRules); + +const deprecatedRules = filterRules(allRules, (rule) => rule.meta.deprecated); + +module.exports = { + deprecatedRules, + rules: allRules, + configs: { + recommended: { + plugins: [ + 'react', + ], + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + rules: { + 'react/display-name': 2, + 'react/jsx-key': 2, + 'react/jsx-no-comment-textnodes': 2, + 'react/jsx-no-duplicate-props': 2, + 'react/jsx-no-target-blank': 2, + 'react/jsx-no-undef': 2, + 'react/jsx-uses-react': 2, + 'react/jsx-uses-vars': 2, + 'react/no-children-prop': 2, + 'react/no-danger-with-children': 2, + 'react/no-deprecated': 2, + 'react/no-direct-mutation-state': 2, + 'react/no-find-dom-node': 2, + 'react/no-is-mounted': 2, + 'react/no-render-return-value': 2, + 'react/no-string-refs': 2, + 'react/no-unescaped-entities': 2, + 'react/no-unknown-property': 2, + 'react/no-unsafe': 0, + 'react/prop-types': 2, + 'react/react-in-jsx-scope': 2, + 'react/require-render-return': 2, + }, + }, + all: { + plugins: [ + 'react', + ], + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + rules: activeRulesConfig, + }, + 'jsx-runtime': { + plugins: [ + 'react', + ], + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + jsxPragma: null, // for @typescript/eslint-parser + }, + rules: { + 'react/react-in-jsx-scope': 0, + 'react/jsx-uses-react': 0, + }, + }, + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/boolean-prop-naming.js b/node_modules/eslint-plugin-react/lib/rules/boolean-prop-naming.js new file mode 100644 index 000000000..0d00c051e --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/boolean-prop-naming.js @@ -0,0 +1,400 @@ +/** + * @fileoverview Enforces consistent naming for boolean props + * @author Ev Haus + */ + +'use strict'; + +const Components = require('../util/Components'); +const propsUtil = require('../util/props'); +const docsUrl = require('../util/docsUrl'); +const propWrapperUtil = require('../util/propWrapper'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + patternMismatch: 'Prop name ({{propName}}) doesn\'t match rule ({{pattern}})', +}; + +module.exports = { + meta: { + docs: { + category: 'Stylistic Issues', + description: 'Enforces consistent naming for boolean props', + recommended: false, + url: docsUrl('boolean-prop-naming'), + }, + + messages, + + schema: [{ + additionalProperties: false, + properties: { + propTypeNames: { + items: { + type: 'string', + }, + minItems: 1, + type: 'array', + uniqueItems: true, + }, + rule: { + default: '^(is|has)[A-Z]([A-Za-z0-9]?)+', + minLength: 1, + type: 'string', + }, + message: { + minLength: 1, + type: 'string', + }, + validateNested: { + default: false, + type: 'boolean', + }, + }, + type: 'object', + }], + }, + + create: Components.detect((context, components, utils) => { + const config = context.options[0] || {}; + const rule = config.rule ? new RegExp(config.rule) : null; + const propTypeNames = config.propTypeNames || ['bool']; + + // Remembers all Flowtype object definitions + const objectTypeAnnotations = new Map(); + + /** + * Returns the prop key to ensure we handle the following cases: + * propTypes: { + * full: React.PropTypes.bool, + * short: PropTypes.bool, + * direct: bool, + * required: PropTypes.bool.isRequired + * } + * @param {Object} node The node we're getting the name of + * @returns {string | null} + */ + function getPropKey(node) { + // Check for `ExperimentalSpreadProperty` (eslint 3/4) and `SpreadElement` (eslint 5) + // so we can skip validation of those fields. + // Otherwise it will look for `node.value.property` which doesn't exist and breaks eslint. + if (node.type === 'ExperimentalSpreadProperty' || node.type === 'SpreadElement') { + return null; + } + if (node.value && node.value.property) { + const name = node.value.property.name; + if (name === 'isRequired') { + if (node.value.object && node.value.object.property) { + return node.value.object.property.name; + } + return null; + } + return name; + } + if (node.value && node.value.type === 'Identifier') { + return node.value.name; + } + return null; + } + + /** + * Returns the name of the given node (prop) + * @param {Object} node The node we're getting the name of + * @returns {string} + */ + function getPropName(node) { + // Due to this bug https://github.com/babel/babel-eslint/issues/307 + // we can't get the name of the Flow object key name. So we have + // to hack around it for now. + if (node.type === 'ObjectTypeProperty') { + return context.getSourceCode().getFirstToken(node).value; + } + + return node.key.name; + } + + /** + * Checks if prop is declared in flow way + * @param {Object} prop Property object, single prop type declaration + * @returns {Boolean} + */ + function flowCheck(prop) { + return ( + prop.type === 'ObjectTypeProperty' + && prop.value.type === 'BooleanTypeAnnotation' + && rule.test(getPropName(prop)) === false + ); + } + + /** + * Checks if prop is declared in regular way + * @param {Object} prop Property object, single prop type declaration + * @returns {Boolean} + */ + function regularCheck(prop) { + const propKey = getPropKey(prop); + return ( + propKey + && propTypeNames.indexOf(propKey) >= 0 + && rule.test(getPropName(prop)) === false + ); + } + + function tsCheck(prop) { + if (prop.type !== 'TSPropertySignature') return false; + const typeAnnotation = (prop.typeAnnotation || {}).typeAnnotation; + return ( + typeAnnotation + && typeAnnotation.type === 'TSBooleanKeyword' + && rule.test(getPropName(prop)) === false + ); + } + + /** + * Checks if prop is nested + * @param {Object} prop Property object, single prop type declaration + * @returns {Boolean} + */ + function nestedPropTypes(prop) { + return ( + prop.type === 'Property' + && prop.value.type === 'CallExpression' + ); + } + + /** + * Runs recursive check on all proptypes + * @param {Array} proptypes A list of Property object (for each proptype defined) + * @param {Function} addInvalidProp callback to run for each error + */ + function runCheck(proptypes, addInvalidProp) { + (proptypes || []).forEach((prop) => { + if (config.validateNested && nestedPropTypes(prop)) { + runCheck(prop.value.arguments[0].properties, addInvalidProp); + return; + } + if (flowCheck(prop) || regularCheck(prop) || tsCheck(prop)) { + addInvalidProp(prop); + } + }); + } + + /** + * Checks and mark props with invalid naming + * @param {Object} node The component node we're testing + * @param {Array} proptypes A list of Property object (for each proptype defined) + */ + function validatePropNaming(node, proptypes) { + const component = components.get(node) || node; + const invalidProps = component.invalidProps || []; + + runCheck(proptypes, (prop) => { + invalidProps.push(prop); + }); + + components.set(node, { + invalidProps, + }); + } + + /** + * Reports invalid prop naming + * @param {Object} component The component to process + */ + function reportInvalidNaming(component) { + component.invalidProps.forEach((propNode) => { + const propName = getPropName(propNode); + report(context, config.message || messages.patternMismatch, !config.message && 'patternMismatch', { + node: propNode, + data: { + component: propName, + propName, + pattern: config.rule, + }, + }); + }); + } + + function checkPropWrapperArguments(node, args) { + if (!node || !Array.isArray(args)) { + return; + } + args.filter((arg) => arg.type === 'ObjectExpression').forEach((object) => validatePropNaming(node, object.properties)); + } + + function getComponentTypeAnnotation(component) { + // If this is a functional component that uses a global type, check it + if ( + (component.node.type === 'FunctionDeclaration' || component.node.type === 'ArrowFunctionExpression') + && component.node.params + && component.node.params.length > 0 + && component.node.params[0].typeAnnotation + ) { + return component.node.params[0].typeAnnotation.typeAnnotation; + } + + if ( + component.node.parent + && component.node.parent.type === 'VariableDeclarator' + && component.node.parent.id + && component.node.parent.id.type === 'Identifier' + && component.node.parent.id.typeAnnotation + && component.node.parent.id.typeAnnotation.typeAnnotation + && component.node.parent.id.typeAnnotation.typeAnnotation.typeParameters + && ( + component.node.parent.id.typeAnnotation.typeAnnotation.typeParameters.type === 'TSTypeParameterInstantiation' + || component.node.parent.id.typeAnnotation.typeAnnotation.typeParameters.type === 'TypeParameterInstantiation' + ) + ) { + return component.node.parent.id.typeAnnotation.typeAnnotation.typeParameters.params.find( + (param) => param.type === 'TSTypeReference' || param.type === 'GenericTypeAnnotation' + ); + } + } + + function findAllTypeAnnotations(identifier, node) { + if (node.type === 'TSTypeLiteral' || node.type === 'ObjectTypeAnnotation') { + const currentNode = [].concat( + objectTypeAnnotations.get(identifier.name) || [], + node + ); + objectTypeAnnotations.set(identifier.name, currentNode); + } else if ( + node.type === 'TSParenthesizedType' + && ( + node.typeAnnotation.type === 'TSIntersectionType' + || node.typeAnnotation.type === 'TSUnionType' + ) + ) { + node.typeAnnotation.types.forEach((type) => { + findAllTypeAnnotations(identifier, type); + }); + } else if ( + node.type === 'TSIntersectionType' + || node.type === 'TSUnionType' + || node.type === 'IntersectionTypeAnnotation' + || node.type === 'UnionTypeAnnotation' + ) { + node.types.forEach((type) => { + findAllTypeAnnotations(identifier, type); + }); + } + } + + // -------------------------------------------------------------------------- + // Public + // -------------------------------------------------------------------------- + + return { + 'ClassProperty, PropertyDefinition'(node) { + if (!rule || !propsUtil.isPropTypesDeclaration(node)) { + return; + } + if ( + node.value + && node.value.type === 'CallExpression' + && propWrapperUtil.isPropWrapperFunction( + context, + context.getSourceCode().getText(node.value.callee) + ) + ) { + checkPropWrapperArguments(node, node.value.arguments); + } + if (node.value && node.value.properties) { + validatePropNaming(node, node.value.properties); + } + if (node.typeAnnotation && node.typeAnnotation.typeAnnotation) { + validatePropNaming(node, node.typeAnnotation.typeAnnotation.properties); + } + }, + + MemberExpression(node) { + if (!rule || !propsUtil.isPropTypesDeclaration(node)) { + return; + } + const component = utils.getRelatedComponent(node); + if (!component || !node.parent.right) { + return; + } + const right = node.parent.right; + if ( + right.type === 'CallExpression' + && propWrapperUtil.isPropWrapperFunction( + context, + context.getSourceCode().getText(right.callee) + ) + ) { + checkPropWrapperArguments(component.node, right.arguments); + return; + } + validatePropNaming(component.node, node.parent.right.properties); + }, + + ObjectExpression(node) { + if (!rule) { + return; + } + + // Search for the proptypes declaration + node.properties.forEach((property) => { + if (!propsUtil.isPropTypesDeclaration(property)) { + return; + } + validatePropNaming(node, property.value.properties); + }); + }, + + TypeAlias(node) { + findAllTypeAnnotations(node.id, node.right); + }, + + TSTypeAliasDeclaration(node) { + findAllTypeAnnotations(node.id, node.typeAnnotation); + }, + + // eslint-disable-next-line object-shorthand + 'Program:exit'() { + if (!rule) { + return; + } + + const list = components.list(); + + Object.keys(list).forEach((component) => { + const annotation = getComponentTypeAnnotation(list[component]); + + if (annotation) { + let propType; + if (annotation.type === 'GenericTypeAnnotation') { + propType = objectTypeAnnotations.get(annotation.id.name); + } else if (annotation.type === 'ObjectTypeAnnotation') { + propType = annotation; + } else if (annotation.type === 'TSTypeReference') { + propType = objectTypeAnnotations.get(annotation.typeName.name); + } + + if (propType) { + [].concat(propType).forEach((prop) => { + validatePropNaming( + list[component].node, + prop.properties || prop.members + ); + }); + } + } + + if (list[component].invalidProps && list[component].invalidProps.length > 0) { + reportInvalidNaming(list[component]); + } + }); + + // Reset cache + objectTypeAnnotations.clear(); + }, + }; + }), +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/button-has-type.js b/node_modules/eslint-plugin-react/lib/rules/button-has-type.js new file mode 100644 index 000000000..204a33c43 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/button-has-type.js @@ -0,0 +1,163 @@ +/** + * @fileoverview Forbid "button" element without an explicit "type" attribute + * @author Filipp Riabchun + */ + +'use strict'; + +const getProp = require('jsx-ast-utils/getProp'); +const getLiteralPropValue = require('jsx-ast-utils/getLiteralPropValue'); +const docsUrl = require('../util/docsUrl'); +const isCreateElement = require('../util/isCreateElement'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const optionDefaults = { + button: true, + submit: true, + reset: true, +}; + +const messages = { + missingType: 'Missing an explicit type attribute for button', + complexType: 'The button type attribute must be specified by a static string or a trivial ternary expression', + invalidValue: '"{{value}}" is an invalid value for button type attribute', + forbiddenValue: '"{{value}}" is an invalid value for button type attribute', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow usage of `button` elements without an explicit `type` attribute', + category: 'Possible Errors', + recommended: false, + url: docsUrl('button-has-type'), + }, + + messages, + + schema: [{ + type: 'object', + properties: { + button: { + default: optionDefaults.button, + type: 'boolean', + }, + submit: { + default: optionDefaults.submit, + type: 'boolean', + }, + reset: { + default: optionDefaults.reset, + type: 'boolean', + }, + }, + additionalProperties: false, + }], + }, + + create(context) { + const configuration = Object.assign({}, optionDefaults, context.options[0]); + + function reportMissing(node) { + report(context, messages.missingType, 'missingType', { + node, + }); + } + + function reportComplex(node) { + report(context, messages.complexType, 'complexType', { + node, + }); + } + + function checkValue(node, value) { + if (!(value in configuration)) { + report(context, messages.invalidValue, 'invalidValue', { + node, + data: { + value, + }, + }); + } else if (!configuration[value]) { + report(context, messages.forbiddenValue, 'forbiddenValue', { + node, + data: { + value, + }, + }); + } + } + + function checkExpression(node, expression) { + switch (expression.type) { + case 'Literal': + checkValue(node, expression.value); + return; + case 'TemplateLiteral': + if (expression.expressions.length === 0) { + checkValue(node, expression.quasis[0].value.raw); + } else { + reportComplex(expression); + } + return; + case 'ConditionalExpression': + checkExpression(node, expression.consequent); + checkExpression(node, expression.alternate); + return; + default: + reportComplex(expression); + } + } + + return { + JSXElement(node) { + if (node.openingElement.name.name !== 'button') { + return; + } + + const typeProp = getProp(node.openingElement.attributes, 'type'); + + if (!typeProp) { + reportMissing(node); + return; + } + + if (typeProp.value && typeProp.value.type === 'JSXExpressionContainer') { + checkExpression(node, typeProp.value.expression); + return; + } + + const propValue = getLiteralPropValue(typeProp); + checkValue(node, propValue); + }, + CallExpression(node) { + if (!isCreateElement(node, context) || node.arguments.length < 1) { + return; + } + + if (node.arguments[0].type !== 'Literal' || node.arguments[0].value !== 'button') { + return; + } + + if (!node.arguments[1] || node.arguments[1].type !== 'ObjectExpression') { + reportMissing(node); + return; + } + + const props = node.arguments[1].properties; + const typeProp = props.find((prop) => prop.key && prop.key.name === 'type'); + + if (!typeProp) { + reportMissing(node); + return; + } + + checkExpression(node, typeProp.value); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/default-props-match-prop-types.js b/node_modules/eslint-plugin-react/lib/rules/default-props-match-prop-types.js new file mode 100644 index 000000000..85e1632d6 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/default-props-match-prop-types.js @@ -0,0 +1,106 @@ +/** + * @fileOverview Enforce all defaultProps are defined in propTypes + * @author Vitor Balocco + * @author Roy Sutton + */ + +'use strict'; + +const Components = require('../util/Components'); +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + requiredHasDefault: 'defaultProp "{{name}}" defined for isRequired propType.', + defaultHasNoType: 'defaultProp "{{name}}" has no corresponding propTypes declaration.', +}; + +module.exports = { + meta: { + docs: { + description: 'Enforce all defaultProps have a corresponding non-required PropType', + category: 'Best Practices', + url: docsUrl('default-props-match-prop-types'), + }, + + messages, + + schema: [{ + type: 'object', + properties: { + allowRequiredDefaults: { + default: false, + type: 'boolean', + }, + }, + additionalProperties: false, + }], + }, + + create: Components.detect((context, components) => { + const configuration = context.options[0] || {}; + const allowRequiredDefaults = configuration.allowRequiredDefaults || false; + + /** + * Reports all defaultProps passed in that don't have an appropriate propTypes counterpart. + * @param {Object[]} propTypes Array of propTypes to check. + * @param {Object} defaultProps Object of defaultProps to check. Keys are the props names. + * @return {void} + */ + function reportInvalidDefaultProps(propTypes, defaultProps) { + // If this defaultProps is "unresolved" or the propTypes is undefined, then we should ignore + // this component and not report any errors for it, to avoid false-positives with e.g. + // external defaultProps/propTypes declarations or spread operators. + if (defaultProps === 'unresolved' || !propTypes || Object.keys(propTypes).length === 0) { + return; + } + + Object.keys(defaultProps).forEach((defaultPropName) => { + const defaultProp = defaultProps[defaultPropName]; + const prop = propTypes[defaultPropName]; + + if (prop && (allowRequiredDefaults || !prop.isRequired)) { + return; + } + + if (prop) { + report(context, messages.requiredHasDefault, 'requiredHasDefault', { + node: defaultProp.node, + data: { + name: defaultPropName, + }, + }); + } else { + report(context, messages.defaultHasNoType, 'defaultHasNoType', { + node: defaultProp.node, + data: { + name: defaultPropName, + }, + }); + } + }); + } + + // -------------------------------------------------------------------------- + // Public API + // -------------------------------------------------------------------------- + + return { + 'Program:exit'() { + const list = components.list(); + + // If no defaultProps could be found, we don't report anything. + Object.keys(list).filter((component) => list[component].defaultProps).forEach((component) => { + reportInvalidDefaultProps( + list[component].declaredPropTypes, + list[component].defaultProps || {} + ); + }); + }, + }; + }), +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/destructuring-assignment.js b/node_modules/eslint-plugin-react/lib/rules/destructuring-assignment.js new file mode 100644 index 000000000..2536bd671 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/destructuring-assignment.js @@ -0,0 +1,280 @@ +/** + * @fileoverview Enforce consistent usage of destructuring assignment of props, state, and context. + */ + +'use strict'; + +const Components = require('../util/Components'); +const docsUrl = require('../util/docsUrl'); +const isAssignmentLHS = require('../util/ast').isAssignmentLHS; +const report = require('../util/report'); + +const DEFAULT_OPTION = 'always'; + +function createSFCParams() { + const queue = []; + + return { + push(params) { + queue.unshift(params); + }, + pop() { + queue.shift(); + }, + propsName() { + const found = queue.find((params) => { + const props = params[0]; + return props && !props.destructuring && props.name; + }); + return found && found[0] && found[0].name; + }, + contextName() { + const found = queue.find((params) => { + const context = params[1]; + return context && !context.destructuring && context.name; + }); + return found && found[1] && found[1].name; + }, + }; +} + +function evalParams(params) { + return params.map((param) => ({ + destructuring: param.type === 'ObjectPattern', + name: param.type === 'Identifier' && param.name, + })); +} + +const messages = { + noDestructPropsInSFCArg: 'Must never use destructuring props assignment in SFC argument', + noDestructContextInSFCArg: 'Must never use destructuring context assignment in SFC argument', + noDestructAssignment: 'Must never use destructuring {{type}} assignment', + useDestructAssignment: 'Must use destructuring {{type}} assignment', + destructureInSignature: 'Must destructure props in the function signature.', +}; + +module.exports = { + meta: { + docs: { + description: 'Enforce consistent usage of destructuring assignment of props, state, and context', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('destructuring-assignment'), + }, + fixable: 'code', + messages, + + schema: [{ + type: 'string', + enum: [ + 'always', + 'never', + ], + }, { + type: 'object', + properties: { + ignoreClassFields: { + type: 'boolean', + }, + destructureInSignature: { + type: 'string', + enum: [ + 'always', + 'ignore', + ], + }, + }, + additionalProperties: false, + }], + }, + + create: Components.detect((context, components, utils) => { + const configuration = context.options[0] || DEFAULT_OPTION; + const ignoreClassFields = (context.options[1] && (context.options[1].ignoreClassFields === true)) || false; + const destructureInSignature = (context.options[1] && context.options[1].destructureInSignature) || 'ignore'; + const sfcParams = createSFCParams(); + + /** + * @param {ASTNode} node We expect either an ArrowFunctionExpression, + * FunctionDeclaration, or FunctionExpression + */ + function handleStatelessComponent(node) { + const params = evalParams(node.params); + + const SFCComponent = components.get(context.getScope(node).block); + if (!SFCComponent) { + return; + } + sfcParams.push(params); + + if (params[0] && params[0].destructuring && components.get(node) && configuration === 'never') { + report(context, messages.noDestructPropsInSFCArg, 'noDestructPropsInSFCArg', { + node, + }); + } else if (params[1] && params[1].destructuring && components.get(node) && configuration === 'never') { + report(context, messages.noDestructContextInSFCArg, 'noDestructContextInSFCArg', { + node, + }); + } + } + + function handleStatelessComponentExit(node) { + const SFCComponent = components.get(context.getScope(node).block); + if (SFCComponent) { + sfcParams.pop(); + } + } + + function handleSFCUsage(node) { + const propsName = sfcParams.propsName(); + const contextName = sfcParams.contextName(); + // props.aProp || context.aProp + const isPropUsed = ( + (propsName && node.object.name === propsName) + || (contextName && node.object.name === contextName) + ) + && !isAssignmentLHS(node); + if (isPropUsed && configuration === 'always') { + report(context, messages.useDestructAssignment, 'useDestructAssignment', { + node, + data: { + type: node.object.name, + }, + }); + } + } + + function isInClassProperty(node) { + let curNode = node.parent; + while (curNode) { + if (curNode.type === 'ClassProperty' || curNode.type === 'PropertyDefinition') { + return true; + } + curNode = curNode.parent; + } + return false; + } + + function handleClassUsage(node) { + // this.props.Aprop || this.context.aProp || this.state.aState + const isPropUsed = ( + node.object.type === 'MemberExpression' && node.object.object.type === 'ThisExpression' + && (node.object.property.name === 'props' || node.object.property.name === 'context' || node.object.property.name === 'state') + && !isAssignmentLHS(node) + ); + + if ( + isPropUsed && configuration === 'always' + && !(ignoreClassFields && isInClassProperty(node)) + ) { + report(context, messages.useDestructAssignment, 'useDestructAssignment', { + node, + data: { + type: node.object.property.name, + }, + }); + } + } + + return { + + FunctionDeclaration: handleStatelessComponent, + + ArrowFunctionExpression: handleStatelessComponent, + + FunctionExpression: handleStatelessComponent, + + 'FunctionDeclaration:exit': handleStatelessComponentExit, + + 'ArrowFunctionExpression:exit': handleStatelessComponentExit, + + 'FunctionExpression:exit': handleStatelessComponentExit, + + MemberExpression(node) { + let scope = context.getScope(node); + let SFCComponent = components.get(scope.block); + while (!SFCComponent && scope.upper && scope.upper !== scope) { + SFCComponent = components.get(scope.upper.block); + scope = scope.upper; + } + if (SFCComponent) { + handleSFCUsage(node); + } + + const classComponent = utils.getParentComponent(node); + if (classComponent) { + handleClassUsage(node); + } + }, + + VariableDeclarator(node) { + const classComponent = utils.getParentComponent(node); + const SFCComponent = components.get(context.getScope(node).block); + + const destructuring = (node.init && node.id && node.id.type === 'ObjectPattern'); + // let {foo} = props; + const destructuringSFC = destructuring && (node.init.name === 'props' || node.init.name === 'context'); + // let {foo} = this.props; + const destructuringClass = destructuring && node.init.object && node.init.object.type === 'ThisExpression' && ( + node.init.property.name === 'props' || node.init.property.name === 'context' || node.init.property.name === 'state' + ); + + if (SFCComponent && destructuringSFC && configuration === 'never') { + report(context, messages.noDestructAssignment, 'noDestructAssignment', { + node, + data: { + type: node.init.name, + }, + }); + } + + if ( + classComponent && destructuringClass && configuration === 'never' + && !(ignoreClassFields && (node.parent.type === 'ClassProperty' || node.parent.type === 'PropertyDefinition')) + ) { + report(context, messages.noDestructAssignment, 'noDestructAssignment', { + node, + data: { + type: node.init.property.name, + }, + }); + } + + if ( + SFCComponent + && destructuringSFC + && configuration === 'always' + && destructureInSignature === 'always' + && node.init.name === 'props' + ) { + const scopeSetProps = context.getScope().set.get('props'); + const propsRefs = scopeSetProps && scopeSetProps.references; + if (!propsRefs) { + return; + } + // Skip if props is used elsewhere + if (propsRefs.length > 1) { + return; + } + report(context, messages.destructureInSignature, 'destructureInSignature', { + node, + fix(fixer) { + const param = SFCComponent.node.params[0]; + if (!param) { + return; + } + const replaceRange = [ + param.range[0], + param.typeAnnotation ? param.typeAnnotation.range[0] : param.range[1], + ]; + return [ + fixer.replaceTextRange(replaceRange, context.getSourceCode().getText(node.id)), + fixer.remove(node.parent), + ]; + }, + }); + } + }, + }; + }), +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/display-name.js b/node_modules/eslint-plugin-react/lib/rules/display-name.js new file mode 100644 index 000000000..b25dbb014 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/display-name.js @@ -0,0 +1,264 @@ +/** + * @fileoverview Prevent missing displayName in a React component definition + * @author Yannick Croissant + */ + +'use strict'; + +const values = require('object.values'); + +const Components = require('../util/Components'); +const astUtil = require('../util/ast'); +const componentUtil = require('../util/componentUtil'); +const docsUrl = require('../util/docsUrl'); +const testReactVersion = require('../util/version').testReactVersion; +const propsUtil = require('../util/props'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + noDisplayName: 'Component definition is missing display name', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow missing displayName in a React component definition', + category: 'Best Practices', + recommended: true, + url: docsUrl('display-name'), + }, + + messages, + + schema: [{ + type: 'object', + properties: { + ignoreTranspilerName: { + type: 'boolean', + }, + }, + additionalProperties: false, + }], + }, + + create: Components.detect((context, components, utils) => { + const config = context.options[0] || {}; + const ignoreTranspilerName = config.ignoreTranspilerName || false; + + /** + * Mark a prop type as declared + * @param {ASTNode} node The AST node being checked. + */ + function markDisplayNameAsDeclared(node) { + components.set(node, { + hasDisplayName: true, + }); + } + + /** + * Checks if React.forwardRef is nested inside React.memo + * @param {ASTNode} node The AST node being checked. + * @returns {Boolean} True if React.forwardRef is nested inside React.memo, false if not. + */ + function isNestedMemo(node) { + const argumentIsCallExpression = node.arguments && node.arguments[0] && node.arguments[0].type === 'CallExpression'; + + return node.type === 'CallExpression' && argumentIsCallExpression && utils.isPragmaComponentWrapper(node); + } + + /** + * Reports missing display name for a given component + * @param {Object} component The component to process + */ + function reportMissingDisplayName(component) { + if ( + testReactVersion(context, '^0.14.10 || ^15.7.0 || >= 16.12.0') + && isNestedMemo(component.node) + ) { + return; + } + + report(context, messages.noDisplayName, 'noDisplayName', { + node: component.node, + }); + } + + /** + * Checks if the component have a name set by the transpiler + * @param {ASTNode} node The AST node being checked. + * @returns {Boolean} True if component has a name, false if not. + */ + function hasTranspilerName(node) { + const namedObjectAssignment = ( + node.type === 'ObjectExpression' + && node.parent + && node.parent.parent + && node.parent.parent.type === 'AssignmentExpression' + && ( + !node.parent.parent.left.object + || node.parent.parent.left.object.name !== 'module' + || node.parent.parent.left.property.name !== 'exports' + ) + ); + const namedObjectDeclaration = ( + node.type === 'ObjectExpression' + && node.parent + && node.parent.parent + && node.parent.parent.type === 'VariableDeclarator' + ); + const namedClass = ( + (node.type === 'ClassDeclaration' || node.type === 'ClassExpression') + && node.id + && !!node.id.name + ); + + const namedFunctionDeclaration = ( + (node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression') + && node.id + && !!node.id.name + ); + + const namedFunctionExpression = ( + astUtil.isFunctionLikeExpression(node) + && node.parent + && (node.parent.type === 'VariableDeclarator' || node.parent.type === 'Property' || node.parent.method === true) + && (!node.parent.parent || !componentUtil.isES5Component(node.parent.parent, context)) + ); + + if ( + namedObjectAssignment || namedObjectDeclaration + || namedClass + || namedFunctionDeclaration || namedFunctionExpression + ) { + return true; + } + return false; + } + + // -------------------------------------------------------------------------- + // Public + // -------------------------------------------------------------------------- + + return { + 'ClassProperty, PropertyDefinition'(node) { + if (!propsUtil.isDisplayNameDeclaration(node)) { + return; + } + markDisplayNameAsDeclared(node); + }, + + MemberExpression(node) { + if (!propsUtil.isDisplayNameDeclaration(node.property)) { + return; + } + const component = utils.getRelatedComponent(node); + if (!component) { + return; + } + markDisplayNameAsDeclared(component.node.type === 'TSAsExpression' ? component.node.expression : component.node); + }, + + FunctionExpression(node) { + if (ignoreTranspilerName || !hasTranspilerName(node)) { + return; + } + if (components.get(node)) { + markDisplayNameAsDeclared(node); + } + }, + + FunctionDeclaration(node) { + if (ignoreTranspilerName || !hasTranspilerName(node)) { + return; + } + if (components.get(node)) { + markDisplayNameAsDeclared(node); + } + }, + + ArrowFunctionExpression(node) { + if (ignoreTranspilerName || !hasTranspilerName(node)) { + return; + } + + if (components.get(node)) { + markDisplayNameAsDeclared(node); + } + }, + + MethodDefinition(node) { + if (!propsUtil.isDisplayNameDeclaration(node.key)) { + return; + } + markDisplayNameAsDeclared(node); + }, + + ClassExpression(node) { + if (ignoreTranspilerName || !hasTranspilerName(node)) { + return; + } + markDisplayNameAsDeclared(node); + }, + + ClassDeclaration(node) { + if (ignoreTranspilerName || !hasTranspilerName(node)) { + return; + } + markDisplayNameAsDeclared(node); + }, + + ObjectExpression(node) { + if (!componentUtil.isES5Component(node, context)) { + return; + } + if (ignoreTranspilerName || !hasTranspilerName(node)) { + // Search for the displayName declaration + node.properties.forEach((property) => { + if (!property.key || !propsUtil.isDisplayNameDeclaration(property.key)) { + return; + } + markDisplayNameAsDeclared(node); + }); + return; + } + markDisplayNameAsDeclared(node); + }, + + CallExpression(node) { + if (!utils.isPragmaComponentWrapper(node)) { + return; + } + + if (node.arguments.length > 0 && astUtil.isFunctionLikeExpression(node.arguments[0])) { + // Skip over React.forwardRef declarations that are embeded within + // a React.memo i.e. React.memo(React.forwardRef(/* ... */)) + // This means that we raise a single error for the call to React.memo + // instead of one for React.memo and one for React.forwardRef + const isWrappedInAnotherPragma = utils.getPragmaComponentWrapper(node); + if ( + !isWrappedInAnotherPragma + && (ignoreTranspilerName || !hasTranspilerName(node.arguments[0])) + ) { + return; + } + + if (components.get(node)) { + markDisplayNameAsDeclared(node); + } + } + }, + + 'Program:exit'() { + const list = components.list(); + // Report missing display name for all components + values(list).filter((component) => !component.hasDisplayName).forEach((component) => { + reportMissingDisplayName(component); + }); + }, + }; + }), +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/forbid-component-props.js b/node_modules/eslint-plugin-react/lib/rules/forbid-component-props.js new file mode 100644 index 000000000..a155cf180 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/forbid-component-props.js @@ -0,0 +1,114 @@ +/** + * @fileoverview Forbid certain props on components + * @author Joe Lencioni + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Constants +// ------------------------------------------------------------------------------ + +const DEFAULTS = ['className', 'style']; + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + propIsForbidden: 'Prop "{{prop}}" is forbidden on Components', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow certain props on components', + category: 'Best Practices', + recommended: false, + url: docsUrl('forbid-component-props'), + }, + + messages, + + schema: [{ + type: 'object', + properties: { + forbid: { + type: 'array', + items: { + oneOf: [{ + type: 'string', + }, { + type: 'object', + properties: { + propName: { + type: 'string', + }, + allowedFor: { + type: 'array', + uniqueItems: true, + items: { + type: 'string', + }, + }, + message: { + type: 'string', + }, + }, + }], + }, + }, + }, + }], + }, + + create(context) { + const configuration = context.options[0] || {}; + const forbid = new Map((configuration.forbid || DEFAULTS).map((value) => { + const propName = typeof value === 'string' ? value : value.propName; + const options = { + allowList: typeof value === 'string' ? [] : (value.allowedFor || []), + message: typeof value === 'string' ? null : value.message, + }; + return [propName, options]; + })); + + function isForbidden(prop, tagName) { + const options = forbid.get(prop); + const allowList = options ? options.allowList : undefined; + // if the tagName is undefined (``), we assume it's a forbidden element + return typeof allowList !== 'undefined' && (typeof tagName === 'undefined' || allowList.indexOf(tagName) === -1); + } + + return { + JSXAttribute(node) { + const parentName = node.parent.name; + // Extract a component name when using a "namespace", e.g. ``. + const tag = parentName.name || `${parentName.object.name}.${parentName.property.name}`; + const componentName = parentName.name || parentName.property.name; + if (componentName && typeof componentName[0] === 'string' && componentName[0] !== componentName[0].toUpperCase()) { + // This is a DOM node, not a Component, so exit. + return; + } + + const prop = node.name.name; + + if (!isForbidden(prop, tag)) { + return; + } + + const customMessage = forbid.get(prop).message; + + report(context, customMessage || messages.propIsForbidden, !customMessage && 'propIsForbidden', { + node, + data: { + prop, + }, + }); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/forbid-dom-props.js b/node_modules/eslint-plugin-react/lib/rules/forbid-dom-props.js new file mode 100644 index 000000000..378801861 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/forbid-dom-props.js @@ -0,0 +1,121 @@ +/** + * @fileoverview Forbid certain props on DOM Nodes + * @author David Vázquez + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Constants +// ------------------------------------------------------------------------------ + +const DEFAULTS = []; + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +/** + * @param {Map} forbidMap // { disallowList: null | string[], message: null | string } + * @param {string} prop + * @param {string} tagName + * @returns {boolean} + */ +function isForbidden(forbidMap, prop, tagName) { + const options = forbidMap.get(prop); + return options && ( + typeof tagName === 'undefined' + || !options.disallowList + || options.disallowList.indexOf(tagName) !== -1 + ); +} + +const messages = { + propIsForbidden: 'Prop "{{prop}}" is forbidden on DOM Nodes', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow certain props on DOM Nodes', + category: 'Best Practices', + recommended: false, + url: docsUrl('forbid-dom-props'), + }, + + messages, + + schema: [{ + type: 'object', + properties: { + forbid: { + type: 'array', + items: { + oneOf: [{ + type: 'string', + }, { + type: 'object', + properties: { + propName: { + type: 'string', + }, + disallowedFor: { + type: 'array', + uniqueItems: true, + items: { + type: 'string', + }, + }, + message: { + type: 'string', + }, + }, + }], + minLength: 1, + }, + uniqueItems: true, + }, + }, + additionalProperties: false, + }], + }, + + create(context) { + const configuration = context.options[0] || {}; + const forbid = new Map((configuration.forbid || DEFAULTS).map((value) => { + const propName = typeof value === 'string' ? value : value.propName; + return [propName, { + disallowList: typeof value === 'string' ? null : (value.disallowedFor || null), + message: typeof value === 'string' ? null : value.message, + }]; + })); + + return { + JSXAttribute(node) { + const tag = node.parent.name.name; + if (!(tag && typeof tag === 'string' && tag[0] !== tag[0].toUpperCase())) { + // This is a Component, not a DOM node, so exit. + return; + } + + const prop = node.name.name; + + if (!isForbidden(forbid, prop, tag)) { + return; + } + + const customMessage = forbid.get(prop).message; + + report(context, customMessage || messages.propIsForbidden, !customMessage && 'propIsForbidden', { + node, + data: { + prop, + }, + }); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/forbid-elements.js b/node_modules/eslint-plugin-react/lib/rules/forbid-elements.js new file mode 100644 index 000000000..7da8f89f4 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/forbid-elements.js @@ -0,0 +1,114 @@ +/** + * @fileoverview Forbid certain elements + * @author Kenneth Chung + */ + +'use strict'; + +const has = require('object.hasown/polyfill')(); +const docsUrl = require('../util/docsUrl'); +const isCreateElement = require('../util/isCreateElement'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + forbiddenElement: '<{{element}}> is forbidden', + forbiddenElement_message: '<{{element}}> is forbidden, {{message}}', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow certain elements', + category: 'Best Practices', + recommended: false, + url: docsUrl('forbid-elements'), + }, + + messages, + + schema: [{ + type: 'object', + properties: { + forbid: { + type: 'array', + items: { + anyOf: [ + { type: 'string' }, + { + type: 'object', + properties: { + element: { type: 'string' }, + message: { type: 'string' }, + }, + required: ['element'], + additionalProperties: false, + }, + ], + }, + }, + }, + additionalProperties: false, + }], + }, + + create(context) { + const configuration = context.options[0] || {}; + const forbidConfiguration = configuration.forbid || []; + + const indexedForbidConfigs = {}; + + forbidConfiguration.forEach((item) => { + if (typeof item === 'string') { + indexedForbidConfigs[item] = { element: item }; + } else { + indexedForbidConfigs[item.element] = item; + } + }); + + function reportIfForbidden(element, node) { + if (has(indexedForbidConfigs, element)) { + const message = indexedForbidConfigs[element].message; + + report( + context, + message ? messages.forbiddenElement_message : messages.forbiddenElement, + message ? 'forbiddenElement_message' : 'forbiddenElement', + { + node, + data: { + element, + message, + }, + } + ); + } + } + + return { + JSXOpeningElement(node) { + reportIfForbidden(context.getSourceCode().getText(node.name), node.name); + }, + + CallExpression(node) { + if (!isCreateElement(node, context)) { + return; + } + + const argument = node.arguments[0]; + const argType = argument.type; + + if (argType === 'Identifier' && /^[A-Z_]/.test(argument.name)) { + reportIfForbidden(argument.name, argument); + } else if (argType === 'Literal' && /^[a-z][^.]*$/.test(argument.value)) { + reportIfForbidden(argument.value, argument); + } else if (argType === 'MemberExpression') { + reportIfForbidden(context.getSourceCode().getText(argument), argument); + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/forbid-foreign-prop-types.js b/node_modules/eslint-plugin-react/lib/rules/forbid-foreign-prop-types.js new file mode 100644 index 000000000..5d91bf07e --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/forbid-foreign-prop-types.js @@ -0,0 +1,134 @@ +/** + * @fileoverview Forbid using another component's propTypes + * @author Ian Christian Myers + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const ast = require('../util/ast'); +const report = require('../util/report'); + +const messages = { + forbiddenPropType: 'Using propTypes from another component is not safe because they may be removed in production builds', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow using another component\'s propTypes', + category: 'Best Practices', + recommended: false, + url: docsUrl('forbid-foreign-prop-types'), + }, + + messages, + + schema: [ + { + type: 'object', + properties: { + allowInPropTypes: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + }, + + create(context) { + const config = context.options[0] || {}; + const allowInPropTypes = config.allowInPropTypes || false; + + // -------------------------------------------------------------------------- + // Helpers + // -------------------------------------------------------------------------- + + function findParentAssignmentExpression(node) { + let parent = node.parent; + + while (parent && parent.type !== 'Program') { + if (parent.type === 'AssignmentExpression') { + return parent; + } + parent = parent.parent; + } + return null; + } + + function findParentClassProperty(node) { + let parent = node.parent; + + while (parent && parent.type !== 'Program') { + if (parent.type === 'ClassProperty' || parent.type === 'PropertyDefinition') { + return parent; + } + parent = parent.parent; + } + return null; + } + + function isAllowedAssignment(node) { + if (!allowInPropTypes) { + return false; + } + + const assignmentExpression = findParentAssignmentExpression(node); + + if ( + assignmentExpression + && assignmentExpression.left + && assignmentExpression.left.property + && assignmentExpression.left.property.name === 'propTypes' + ) { + return true; + } + + const classProperty = findParentClassProperty(node); + + if ( + classProperty + && classProperty.key + && classProperty.key.name === 'propTypes' + ) { + return true; + } + return false; + } + + return { + MemberExpression(node) { + if ( + (node.property + && ( + !node.computed + && node.property.type === 'Identifier' + && node.property.name === 'propTypes' + && !ast.isAssignmentLHS(node) + && !isAllowedAssignment(node) + )) || ( + (node.property.type === 'Literal' || node.property.type === 'JSXText') + && node.property.value === 'propTypes' + && !ast.isAssignmentLHS(node) + && !isAllowedAssignment(node) + ) + ) { + report(context, messages.forbiddenPropType, 'forbiddenPropType', { + node: node.property, + }); + } + }, + + ObjectPattern(node) { + const propTypesNode = node.properties.find((property) => property.type === 'Property' && property.key.name === 'propTypes'); + + if (propTypesNode) { + report(context, messages.forbiddenPropType, 'forbiddenPropType', { + node: propTypesNode, + }); + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/forbid-prop-types.js b/node_modules/eslint-plugin-react/lib/rules/forbid-prop-types.js new file mode 100644 index 000000000..92f0f0f51 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/forbid-prop-types.js @@ -0,0 +1,293 @@ +/** + * @fileoverview Forbid certain propTypes + */ + +'use strict'; + +const variableUtil = require('../util/variable'); +const propsUtil = require('../util/props'); +const astUtil = require('../util/ast'); +const docsUrl = require('../util/docsUrl'); +const propWrapperUtil = require('../util/propWrapper'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Constants +// ------------------------------------------------------------------------------ + +const DEFAULTS = ['any', 'array', 'object']; + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + forbiddenPropType: 'Prop type "{{target}}" is forbidden', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow certain propTypes', + category: 'Best Practices', + recommended: false, + url: docsUrl('forbid-prop-types'), + }, + + messages, + + schema: [{ + type: 'object', + properties: { + forbid: { + type: 'array', + items: { + type: 'string', + }, + }, + checkContextTypes: { + type: 'boolean', + }, + checkChildContextTypes: { + type: 'boolean', + }, + }, + additionalProperties: true, + }], + }, + + create(context) { + const configuration = context.options[0] || {}; + const checkContextTypes = configuration.checkContextTypes || false; + const checkChildContextTypes = configuration.checkChildContextTypes || false; + let propTypesPackageName = null; + let reactPackageName = null; + let isForeignPropTypesPackage = false; + + function isPropTypesPackage(node) { + return ( + node.type === 'Identifier' + && ( + node.name === null + || node.name === propTypesPackageName + || !isForeignPropTypesPackage + ) + ) || ( + node.type === 'MemberExpression' + && ( + node.object.name === null + || node.object.name === reactPackageName + || !isForeignPropTypesPackage + ) + ); + } + + function isForbidden(type) { + const forbid = configuration.forbid || DEFAULTS; + return forbid.indexOf(type) >= 0; + } + + function reportIfForbidden(type, declaration, target) { + if (isForbidden(type)) { + report(context, messages.forbiddenPropType, 'forbiddenPropType', { + node: declaration, + data: { + target, + }, + }); + } + } + + function shouldCheckContextTypes(node) { + if (checkContextTypes && propsUtil.isContextTypesDeclaration(node)) { + return true; + } + return false; + } + + function shouldCheckChildContextTypes(node) { + if (checkChildContextTypes && propsUtil.isChildContextTypesDeclaration(node)) { + return true; + } + return false; + } + + /** + * Checks if propTypes declarations are forbidden + * @param {Array} declarations The array of AST nodes being checked. + * @returns {void} + */ + function checkProperties(declarations) { + if (declarations) { + declarations.forEach((declaration) => { + if (declaration.type !== 'Property') { + return; + } + let target; + let value = declaration.value; + if ( + value.type === 'MemberExpression' + && value.property + && value.property.name + && value.property.name === 'isRequired' + ) { + value = value.object; + } + if (value.type === 'CallExpression') { + if (!isPropTypesPackage(value.callee)) { + return; + } + value.arguments.forEach((arg) => { + const name = arg.type === 'MemberExpression' ? arg.property.name : arg.name; + reportIfForbidden(name, declaration, name); + }); + value = value.callee; + } + if (!isPropTypesPackage(value)) { + return; + } + if (value.property) { + target = value.property.name; + } else if (value.type === 'Identifier') { + target = value.name; + } + reportIfForbidden(target, declaration, target); + }); + } + } + + function checkNode(node) { + switch (node && node.type) { + case 'ObjectExpression': + checkProperties(node.properties); + break; + case 'Identifier': { + const propTypesObject = variableUtil.findVariableByName(context, node.name); + if (propTypesObject && propTypesObject.properties) { + checkProperties(propTypesObject.properties); + } + break; + } + case 'CallExpression': { + const innerNode = node.arguments && node.arguments[0]; + if ( + propWrapperUtil.isPropWrapperFunction(context, context.getSourceCode().getText(node.callee)) + && innerNode + ) { + checkNode(innerNode); + } + break; + } + default: + break; + } + } + + return { + ImportDeclaration(node) { + if (node.source && node.source.value === 'prop-types') { // import PropType from "prop-types" + if (node.specifiers.length > 0) { + propTypesPackageName = node.specifiers[0].local.name; + } + } else if (node.source && node.source.value === 'react') { // import { PropTypes } from "react" + if (node.specifiers.length > 0) { + reactPackageName = node.specifiers[0].local.name; // guard against accidental anonymous `import "react"` + } + if (node.specifiers.length >= 1) { + const propTypesSpecifier = node.specifiers.find((specifier) => ( + specifier.imported && specifier.imported.name === 'PropTypes' + )); + if (propTypesSpecifier) { + propTypesPackageName = propTypesSpecifier.local.name; + } + } + } else { // package is not imported from "react" or "prop-types" + // eslint-disable-next-line no-lonely-if + if (node.specifiers.some((x) => x.local.name === 'PropTypes')) { // assert: node.specifiers.length > 1 + isForeignPropTypesPackage = true; + } + } + }, + + 'ClassProperty, PropertyDefinition'(node) { + if ( + !propsUtil.isPropTypesDeclaration(node) + && !isPropTypesPackage(node) + && !shouldCheckContextTypes(node) + && !shouldCheckChildContextTypes(node) + ) { + return; + } + checkNode(node.value); + }, + + MemberExpression(node) { + if ( + !propsUtil.isPropTypesDeclaration(node) + && !isPropTypesPackage(node) + && !shouldCheckContextTypes(node) + && !shouldCheckChildContextTypes(node) + ) { + return; + } + + checkNode(node.parent.right); + }, + + CallExpression(node) { + if ( + node.callee.object + && !isPropTypesPackage(node.callee.object) + && !propsUtil.isPropTypesDeclaration(node.callee) + ) { + return; + } + + if ( + node.arguments.length > 0 + && (node.callee.name === 'shape' || astUtil.getPropertyName(node.callee) === 'shape') + ) { + checkProperties(node.arguments[0].properties); + } + }, + + MethodDefinition(node) { + if ( + !propsUtil.isPropTypesDeclaration(node) + && !isPropTypesPackage(node) + && !shouldCheckContextTypes(node) + && !shouldCheckChildContextTypes(node) + ) { + return; + } + + const returnStatement = astUtil.findReturnStatement(node); + + if (returnStatement && returnStatement.argument) { + checkNode(returnStatement.argument); + } + }, + + ObjectExpression(node) { + node.properties.forEach((property) => { + if (!property.key) { + return; + } + + if ( + !propsUtil.isPropTypesDeclaration(property) + && !isPropTypesPackage(property) + && !shouldCheckContextTypes(property) + && !shouldCheckChildContextTypes(property) + ) { + return; + } + if (property.value.type === 'ObjectExpression') { + checkProperties(property.value.properties); + } + }); + }, + + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/function-component-definition.js b/node_modules/eslint-plugin-react/lib/rules/function-component-definition.js new file mode 100644 index 000000000..8e6103ae8 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/function-component-definition.js @@ -0,0 +1,284 @@ +/** + * @fileoverview Standardize the way function component get defined + * @author Stefan Wullems + */ + +'use strict'; + +const arrayIncludes = require('array-includes'); +const Components = require('../util/Components'); +const docsUrl = require('../util/docsUrl'); +const reportC = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +function buildFunction(template, parts) { + return Object.keys(parts).reduce( + (acc, key) => acc.replace(`{${key}}`, () => parts[key] || ''), + template + ); +} + +const NAMED_FUNCTION_TEMPLATES = { + 'function-declaration': 'function {name}{typeParams}({params}){returnType} {body}', + 'arrow-function': '{varType} {name}{typeAnnotation} = {typeParams}({params}){returnType} => {body}', + 'function-expression': '{varType} {name}{typeAnnotation} = function{typeParams}({params}){returnType} {body}', +}; + +const UNNAMED_FUNCTION_TEMPLATES = { + 'function-expression': 'function{typeParams}({params}){returnType} {body}', + 'arrow-function': '{typeParams}({params}){returnType} => {body}', +}; + +function hasOneUnconstrainedTypeParam(node) { + if (node.typeParameters) { + return ( + node.typeParameters.params.length === 1 + && !node.typeParameters.params[0].constraint + ); + } + + return false; +} + +function hasName(node) { + return ( + node.type === 'FunctionDeclaration' + || node.parent.type === 'VariableDeclarator' + ); +} + +function getNodeText(prop, source) { + if (!prop) return null; + return source.slice(prop.range[0], prop.range[1]); +} + +function getName(node) { + if (node.type === 'FunctionDeclaration') { + return node.id.name; + } + + if ( + node.type === 'ArrowFunctionExpression' + || node.type === 'FunctionExpression' + ) { + return hasName(node) && node.parent.id.name; + } +} + +function getParams(node, source) { + if (node.params.length === 0) return null; + return source.slice( + node.params[0].range[0], + node.params[node.params.length - 1].range[1] + ); +} + +function getBody(node, source) { + const range = node.body.range; + + if (node.body.type !== 'BlockStatement') { + return ['{', ` return ${source.slice(range[0], range[1])}`, '}'].join('\n'); + } + + return source.slice(range[0], range[1]); +} + +function getTypeAnnotation(node, source) { + if (!hasName(node) || node.type === 'FunctionDeclaration') return; + + if ( + node.type === 'ArrowFunctionExpression' + || node.type === 'FunctionExpression' + ) { + return getNodeText(node.parent.id.typeAnnotation, source); + } +} + +function isUnfixableBecauseOfExport(node) { + return ( + node.type === 'FunctionDeclaration' + && node.parent + && node.parent.type === 'ExportDefaultDeclaration' + ); +} + +function isFunctionExpressionWithName(node) { + return node.type === 'FunctionExpression' && node.id && node.id.name; +} + +const messages = { + 'function-declaration': 'Function component is not a function declaration', + 'function-expression': 'Function component is not a function expression', + 'arrow-function': 'Function component is not an arrow function', +}; + +module.exports = { + meta: { + docs: { + description: 'Enforce a specific function type for function components', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('function-component-definition'), + }, + fixable: 'code', + + messages, + + schema: [ + { + type: 'object', + properties: { + namedComponents: { + oneOf: [ + { + enum: [ + 'function-declaration', + 'arrow-function', + 'function-expression', + ], + }, + { + type: 'array', + items: { + type: 'string', + enum: [ + 'function-declaration', + 'arrow-function', + 'function-expression', + ], + }, + }, + ], + }, + unnamedComponents: { + oneOf: [ + { enum: ['arrow-function', 'function-expression'] }, + { + type: 'array', + items: { + type: 'string', + enum: ['arrow-function', 'function-expression'], + }, + }, + ], + }, + }, + }, + ], + }, + + create: Components.detect((context, components) => { + const configuration = context.options[0] || {}; + let fileVarType = 'var'; + + const namedConfig = [].concat( + configuration.namedComponents || 'function-declaration' + ); + const unnamedConfig = [].concat( + configuration.unnamedComponents || 'function-expression' + ); + + function getFixer(node, options) { + const sourceCode = context.getSourceCode(); + const source = sourceCode.getText(); + + const typeAnnotation = getTypeAnnotation(node, source); + + if (options.type === 'function-declaration' && typeAnnotation) { + return; + } + if (options.type === 'arrow-function' && hasOneUnconstrainedTypeParam(node)) { + return; + } + if (isUnfixableBecauseOfExport(node)) return; + if (isFunctionExpressionWithName(node)) return; + let varType = fileVarType; + if ( + (node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression') + && node.parent.type === 'VariableDeclarator' + ) { + varType = node.parent.parent.kind; + } + + return (fixer) => fixer.replaceTextRange( + options.range, + buildFunction(options.template, { + typeAnnotation, + typeParams: getNodeText(node.typeParameters, source), + params: getParams(node, source), + returnType: getNodeText(node.returnType, source), + body: getBody(node, source), + name: getName(node), + varType, + }) + ); + } + + function report(node, options) { + reportC(context, messages[options.messageId], options.messageId, { + node, + fix: getFixer(node, options.fixerOptions), + }); + } + + function validate(node, functionType) { + if (!components.get(node)) return; + + if (node.parent && node.parent.type === 'Property') return; + + if (hasName(node) && !arrayIncludes(namedConfig, functionType)) { + report(node, { + messageId: namedConfig[0], + fixerOptions: { + type: namedConfig[0], + template: NAMED_FUNCTION_TEMPLATES[namedConfig[0]], + range: + node.type === 'FunctionDeclaration' + ? node.range + : node.parent.parent.range, + }, + }); + } + if (!hasName(node) && !arrayIncludes(unnamedConfig, functionType)) { + report(node, { + messageId: unnamedConfig[0], + fixerOptions: { + type: unnamedConfig[0], + template: UNNAMED_FUNCTION_TEMPLATES[unnamedConfig[0]], + range: node.range, + }, + }); + } + } + + // -------------------------------------------------------------------------- + // Public + // -------------------------------------------------------------------------- + const validatePairs = []; + let hasES6OrJsx = false; + return { + FunctionDeclaration(node) { + validatePairs.push([node, 'function-declaration']); + }, + ArrowFunctionExpression(node) { + validatePairs.push([node, 'arrow-function']); + }, + FunctionExpression(node) { + validatePairs.push([node, 'function-expression']); + }, + VariableDeclaration(node) { + hasES6OrJsx = hasES6OrJsx || node.kind === 'const' || node.kind === 'let'; + }, + 'Program:exit'() { + if (hasES6OrJsx) fileVarType = 'const'; + validatePairs.forEach((pair) => validate(pair[0], pair[1])); + }, + 'ImportDeclaration, ExportNamedDeclaration, ExportDefaultDeclaration, ExportAllDeclaration, ExportSpecifier, ExportDefaultSpecifier, JSXElement, TSExportAssignment, TSImportEqualsDeclaration'() { + hasES6OrJsx = true; + }, + }; + }), +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/hook-use-state.js b/node_modules/eslint-plugin-react/lib/rules/hook-use-state.js new file mode 100644 index 000000000..254997212 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/hook-use-state.js @@ -0,0 +1,160 @@ +/** + * @fileoverview Ensure symmetric naming of useState hook value and setter variables + * @author Duncan Beevers + */ + +'use strict'; + +const Components = require('../util/Components'); +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + useStateErrorMessage: 'useState call is not destructured into value + setter pair', +}; + +module.exports = { + meta: { + docs: { + description: 'Ensure destructuring and symmetric naming of useState hook value and setter variables', + category: 'Best Practices', + recommended: false, + url: docsUrl('hook-use-state'), + }, + messages, + schema: [], + type: 'suggestion', + hasSuggestions: true, + }, + + create: Components.detect((context, components, util) => ({ + CallExpression(node) { + const isImmediateReturn = node.parent + && node.parent.type === 'ReturnStatement'; + + if (isImmediateReturn || !util.isReactHookCall(node, ['useState'])) { + return; + } + + const isDestructuringDeclarator = node.parent + && node.parent.type === 'VariableDeclarator' + && node.parent.id.type === 'ArrayPattern'; + + if (!isDestructuringDeclarator) { + report( + context, + messages.useStateErrorMessage, + 'useStateErrorMessage', + { node } + ); + return; + } + + const variableNodes = node.parent.id.elements; + const valueVariable = variableNodes[0]; + const setterVariable = variableNodes[1]; + + const valueVariableName = valueVariable + ? valueVariable.name + : undefined; + + const setterVariableName = setterVariable + ? setterVariable.name + : undefined; + + const caseCandidateMatch = valueVariableName ? valueVariableName.match(/(^[a-z]+)(.*)/) : undefined; + const upperCaseCandidatePrefix = caseCandidateMatch ? caseCandidateMatch[1] : undefined; + const caseCandidateSuffix = caseCandidateMatch ? caseCandidateMatch[2] : undefined; + const expectedSetterVariableNames = upperCaseCandidatePrefix ? [ + `set${upperCaseCandidatePrefix.charAt(0).toUpperCase()}${upperCaseCandidatePrefix.slice(1)}${caseCandidateSuffix}`, + `set${upperCaseCandidatePrefix.toUpperCase()}${caseCandidateSuffix}`, + ] : []; + + const isSymmetricGetterSetterPair = valueVariable + && setterVariable + && expectedSetterVariableNames.indexOf(setterVariableName) !== -1 + && variableNodes.length === 2; + + if (!isSymmetricGetterSetterPair) { + const suggestions = [ + { + desc: 'Destructure useState call into value + setter pair', + fix: (fixer) => { + if (expectedSetterVariableNames.length === 0) { + return; + } + + const fix = fixer.replaceTextRange( + node.parent.id.range, + `[${valueVariableName}, ${expectedSetterVariableNames[0]}]` + ); + + return fix; + }, + }, + ]; + + const defaultReactImports = components.getDefaultReactImports(); + const defaultReactImportSpecifier = defaultReactImports + ? defaultReactImports[0] + : undefined; + + const defaultReactImportName = defaultReactImportSpecifier + ? defaultReactImportSpecifier.local.name + : undefined; + + const namedReactImports = components.getNamedReactImports(); + const useStateReactImportSpecifier = namedReactImports + ? namedReactImports.find((specifier) => specifier.imported.name === 'useState') + : undefined; + + const isSingleGetter = valueVariable && variableNodes.length === 1; + const isUseStateCalledWithSingleArgument = node.arguments.length === 1; + if (isSingleGetter && isUseStateCalledWithSingleArgument) { + const useMemoReactImportSpecifier = namedReactImports + && namedReactImports.find((specifier) => specifier.imported.name === 'useMemo'); + + let useMemoCode; + if (useMemoReactImportSpecifier) { + useMemoCode = useMemoReactImportSpecifier.local.name; + } else if (defaultReactImportName) { + useMemoCode = `${defaultReactImportName}.useMemo`; + } else { + useMemoCode = 'useMemo'; + } + + suggestions.unshift({ + desc: 'Replace useState call with useMemo', + fix: (fixer) => [ + // Add useMemo import, if necessary + useStateReactImportSpecifier + && (!useMemoReactImportSpecifier || defaultReactImportName) + && fixer.insertTextAfter(useStateReactImportSpecifier, ', useMemo'), + // Convert single-value destructure to simple assignment + fixer.replaceTextRange(node.parent.id.range, valueVariableName), + // Convert useState call to useMemo + arrow function + dependency array + fixer.replaceTextRange( + node.range, + `${useMemoCode}(() => ${context.getSourceCode().getText(node.arguments[0])}, [])` + ), + ].filter(Boolean), + }); + } + + report( + context, + messages.useStateErrorMessage, + 'useStateErrorMessage', + { + node: node.parent.id, + suggest: suggestions, + } + ); + } + }, + })), +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/iframe-missing-sandbox.js b/node_modules/eslint-plugin-react/lib/rules/iframe-missing-sandbox.js new file mode 100644 index 000000000..9a8bd4774 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/iframe-missing-sandbox.js @@ -0,0 +1,142 @@ +/** + * @fileoverview TBD + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const isCreateElement = require('../util/isCreateElement'); +const report = require('../util/report'); + +const messages = { + attributeMissing: 'An iframe element is missing a sandbox attribute', + invalidValue: 'An iframe element defines a sandbox attribute with invalid value "{{ value }}"', + invalidCombination: 'An iframe element defines a sandbox attribute with both allow-scripts and allow-same-origin which is invalid', +}; + +const ALLOWED_VALUES = [ + // From https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox + '', + 'allow-downloads-without-user-activation', + 'allow-downloads', + 'allow-forms', + 'allow-modals', + 'allow-orientation-lock', + 'allow-pointer-lock', + 'allow-popups', + 'allow-popups-to-escape-sandbox', + 'allow-presentation', + 'allow-same-origin', + 'allow-scripts', + 'allow-storage-access-by-user-activation', + 'allow-top-navigation', + 'allow-top-navigation-by-user-activation', +]; + +function validateSandboxAttribute(context, node, attribute) { + if (typeof attribute !== 'string') { + // Only string literals are supported for now + return; + } + const values = attribute.split(' '); + let allowScripts = false; + let allowSameOrigin = false; + values.forEach((attributeValue) => { + const trimmedAttributeValue = attributeValue.trim(); + if (ALLOWED_VALUES.indexOf(trimmedAttributeValue) === -1) { + report(context, messages.invalidValue, 'invalidValue', { + node, + data: { + value: trimmedAttributeValue, + }, + }); + } + if (trimmedAttributeValue === 'allow-scripts') { + allowScripts = true; + } + if (trimmedAttributeValue === 'allow-same-origin') { + allowSameOrigin = true; + } + }); + if (allowScripts && allowSameOrigin) { + report(context, messages.invalidCombination, 'invalidCombination', { + node, + }); + } +} + +function checkAttributes(context, node) { + let sandboxAttributeFound = false; + node.attributes.forEach((attribute) => { + if (attribute.type === 'JSXAttribute' + && attribute.name + && attribute.name.type === 'JSXIdentifier' + && attribute.name.name === 'sandbox' + ) { + sandboxAttributeFound = true; + if ( + attribute.value + && attribute.value.type === 'Literal' + && attribute.value.value + ) { + validateSandboxAttribute(context, node, attribute.value.value); + } + } + }); + if (!sandboxAttributeFound) { + report(context, messages.attributeMissing, 'attributeMissing', { + node, + }); + } +} + +function checkProps(context, node) { + let sandboxAttributeFound = false; + if (node.arguments.length > 1) { + const props = node.arguments[1]; + const sandboxProp = props.properties && props.properties.find((x) => x.type === 'Property' && x.key.name === 'sandbox'); + if (sandboxProp) { + sandboxAttributeFound = true; + if (sandboxProp.value && sandboxProp.value.type === 'Literal' && sandboxProp.value.value) { + validateSandboxAttribute(context, node, sandboxProp.value.value); + } + } + } + if (!sandboxAttributeFound) { + report(context, messages.attributeMissing, 'attributeMissing', { + node, + }); + } +} + +module.exports = { + meta: { + docs: { + description: 'Enforce sandbox attribute on iframe elements', + category: 'Best Practices', + recommended: false, + url: docsUrl('iframe-missing-sandbox'), + }, + + schema: [], + + messages, + }, + + create(context) { + return { + 'JSXOpeningElement[name.name="iframe"]'(node) { + checkAttributes(context, node); + }, + + CallExpression(node) { + if (isCreateElement(node, context) && node.arguments && node.arguments.length > 0) { + const tag = node.arguments[0]; + if (tag.type === 'Literal' && tag.value === 'iframe') { + checkProps(context, node); + } + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-boolean-value.js b/node_modules/eslint-plugin-react/lib/rules/jsx-boolean-value.js new file mode 100644 index 000000000..43395e249 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-boolean-value.js @@ -0,0 +1,159 @@ +/** + * @fileoverview Enforce boolean attributes notation in JSX + * @author Yannick Croissant + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const exceptionsSchema = { + type: 'array', + items: { type: 'string', minLength: 1 }, + uniqueItems: true, +}; + +const ALWAYS = 'always'; +const NEVER = 'never'; + +const errorData = new WeakMap(); +/** + * @param {object} exceptions + * @returns {object} + */ +function getErrorData(exceptions) { + if (!errorData.has(exceptions)) { + const exceptionProps = Array.from(exceptions, (name) => `\`${name}\``).join(', '); + const exceptionsMessage = exceptions.size > 0 ? ` for the following props: ${exceptionProps}` : ''; + errorData.set(exceptions, { exceptionsMessage }); + } + return errorData.get(exceptions); +} +/** + * @param {string} configuration + * @param {Set} exceptions + * @param {string} propName + * @returns {boolean} propName +*/ +function isAlways(configuration, exceptions, propName) { + const isException = exceptions.has(propName); + if (configuration === ALWAYS) { + return !isException; + } + return isException; +} +/** + * @param {string} configuration + * @param {Set} exceptions + * @param {string} propName + * @returns {boolean} propName + */ +function isNever(configuration, exceptions, propName) { + const isException = exceptions.has(propName); + if (configuration === NEVER) { + return !isException; + } + return isException; +} + +const messages = { + omitBoolean: 'Value must be omitted for boolean attributes{{exceptionsMessage}}', + omitBoolean_noMessage: 'Value must be omitted for boolean attributes', + setBoolean: 'Value must be set for boolean attributes{{exceptionsMessage}}', + setBoolean_noMessage: 'Value must be set for boolean attributes', +}; + +module.exports = { + meta: { + docs: { + description: 'Enforce boolean attributes notation in JSX', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-boolean-value'), + }, + fixable: 'code', + + messages, + + schema: { + anyOf: [{ + type: 'array', + items: [{ enum: [ALWAYS, NEVER] }], + additionalItems: false, + }, { + type: 'array', + items: [{ + enum: [ALWAYS], + }, { + type: 'object', + additionalProperties: false, + properties: { + [NEVER]: exceptionsSchema, + }, + }], + additionalItems: false, + }, { + type: 'array', + items: [{ + enum: [NEVER], + }, { + type: 'object', + additionalProperties: false, + properties: { + [ALWAYS]: exceptionsSchema, + }, + }], + additionalItems: false, + }], + }, + }, + + create(context) { + const configuration = context.options[0] || NEVER; + const configObject = context.options[1] || {}; + const exceptions = new Set((configuration === ALWAYS ? configObject[NEVER] : configObject[ALWAYS]) || []); + + return { + JSXAttribute(node) { + const propName = node.name && node.name.name; + const value = node.value; + + if ( + isAlways(configuration, exceptions, propName) + && value === null + ) { + const data = getErrorData(exceptions); + const messageId = data.exceptionsMessage ? 'setBoolean' : 'setBoolean_noMessage'; + report(context, messages[messageId], messageId, { + node, + data, + fix(fixer) { + return fixer.insertTextAfter(node, '={true}'); + }, + }); + } + if ( + isNever(configuration, exceptions, propName) + && value + && value.type === 'JSXExpressionContainer' + && value.expression.value === true + ) { + const data = getErrorData(exceptions); + const messageId = data.exceptionsMessage ? 'omitBoolean' : 'omitBoolean_noMessage'; + report(context, messages[messageId], messageId, { + node, + data, + fix(fixer) { + return fixer.removeRange([node.name.range[1], value.range[1]]); + }, + }); + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-child-element-spacing.js b/node_modules/eslint-plugin-react/lib/rules/jsx-child-element-spacing.js new file mode 100644 index 000000000..d8d2af67a --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-child-element-spacing.js @@ -0,0 +1,116 @@ +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// This list is taken from https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements + +// Note: 'br' is not included because whitespace around br tags is inconsequential to the rendered output +const INLINE_ELEMENTS = new Set([ + 'a', + 'abbr', + 'acronym', + 'b', + 'bdo', + 'big', + 'button', + 'cite', + 'code', + 'dfn', + 'em', + 'i', + 'img', + 'input', + 'kbd', + 'label', + 'map', + 'object', + 'q', + 'samp', + 'script', + 'select', + 'small', + 'span', + 'strong', + 'sub', + 'sup', + 'textarea', + 'tt', + 'var', +]); + +const messages = { + spacingAfterPrev: 'Ambiguous spacing after previous element {{element}}', + spacingBeforeNext: 'Ambiguous spacing before next element {{element}}', +}; + +module.exports = { + meta: { + docs: { + description: 'Enforce or disallow spaces inside of curly braces in JSX attributes and expressions', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-child-element-spacing'), + }, + fixable: null, + + messages, + + schema: [], + }, + create(context) { + const TEXT_FOLLOWING_ELEMENT_PATTERN = /^\s*\n\s*\S/; + const TEXT_PRECEDING_ELEMENT_PATTERN = /\S\s*\n\s*$/; + + const elementName = (node) => ( + node.openingElement + && node.openingElement.name + && node.openingElement.name.type === 'JSXIdentifier' + && node.openingElement.name.name + ); + + const isInlineElement = (node) => ( + node.type === 'JSXElement' + && INLINE_ELEMENTS.has(elementName(node)) + ); + + const handleJSX = (node) => { + let lastChild = null; + let child = null; + (node.children.concat([null])).forEach((nextChild) => { + if ( + (lastChild || nextChild) + && (!lastChild || isInlineElement(lastChild)) + && (child && (child.type === 'Literal' || child.type === 'JSXText')) + && (!nextChild || isInlineElement(nextChild)) + && true + ) { + if (lastChild && child.value.match(TEXT_FOLLOWING_ELEMENT_PATTERN)) { + report(context, messages.spacingAfterPrev, 'spacingAfterPrev', { + node: lastChild, + loc: lastChild.loc.end, + data: { + element: elementName(lastChild), + }, + }); + } else if (nextChild && child.value.match(TEXT_PRECEDING_ELEMENT_PATTERN)) { + report(context, messages.spacingBeforeNext, 'spacingBeforeNext', { + node: nextChild, + loc: nextChild.loc.start, + data: { + element: elementName(nextChild), + }, + }); + } + } + lastChild = child; + child = nextChild; + }); + }; + + return { + JSXElement: handleJSX, + JSXFragment: handleJSX, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-closing-bracket-location.js b/node_modules/eslint-plugin-react/lib/rules/jsx-closing-bracket-location.js new file mode 100644 index 000000000..7e578051d --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-closing-bracket-location.js @@ -0,0 +1,308 @@ +/** + * @fileoverview Validate closing bracket location in JSX + * @author Yannick Croissant + */ + +'use strict'; + +const has = require('object.hasown/polyfill')(); +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + bracketLocation: 'The closing bracket must be {{location}}{{details}}', +}; + +module.exports = { + meta: { + docs: { + description: 'Enforce closing bracket location in JSX', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-closing-bracket-location'), + }, + fixable: 'code', + + messages, + + schema: [{ + oneOf: [ + { + enum: ['after-props', 'props-aligned', 'tag-aligned', 'line-aligned'], + }, + { + type: 'object', + properties: { + location: { + enum: ['after-props', 'props-aligned', 'tag-aligned', 'line-aligned'], + }, + }, + additionalProperties: false, + }, { + type: 'object', + properties: { + nonEmpty: { + enum: ['after-props', 'props-aligned', 'tag-aligned', 'line-aligned', false], + }, + selfClosing: { + enum: ['after-props', 'props-aligned', 'tag-aligned', 'line-aligned', false], + }, + }, + additionalProperties: false, + }, + ], + }], + }, + + create(context) { + const MESSAGE_LOCATION = { + 'after-props': 'placed after the last prop', + 'after-tag': 'placed after the opening tag', + 'props-aligned': 'aligned with the last prop', + 'tag-aligned': 'aligned with the opening tag', + 'line-aligned': 'aligned with the line containing the opening tag', + }; + const DEFAULT_LOCATION = 'tag-aligned'; + + const config = context.options[0]; + const options = { + nonEmpty: DEFAULT_LOCATION, + selfClosing: DEFAULT_LOCATION, + }; + + if (typeof config === 'string') { + // simple shorthand [1, 'something'] + options.nonEmpty = config; + options.selfClosing = config; + } else if (typeof config === 'object') { + // [1, {location: 'something'}] (back-compat) + if (has(config, 'location')) { + options.nonEmpty = config.location; + options.selfClosing = config.location; + } + // [1, {nonEmpty: 'something'}] + if (has(config, 'nonEmpty')) { + options.nonEmpty = config.nonEmpty; + } + // [1, {selfClosing: 'something'}] + if (has(config, 'selfClosing')) { + options.selfClosing = config.selfClosing; + } + } + + /** + * Get expected location for the closing bracket + * @param {Object} tokens Locations of the opening bracket, closing bracket and last prop + * @return {String} Expected location for the closing bracket + */ + function getExpectedLocation(tokens) { + let location; + // Is always after the opening tag if there is no props + if (typeof tokens.lastProp === 'undefined') { + location = 'after-tag'; + // Is always after the last prop if this one is on the same line as the opening bracket + } else if (tokens.opening.line === tokens.lastProp.lastLine) { + location = 'after-props'; + // Else use configuration dependent on selfClosing property + } else { + location = tokens.selfClosing ? options.selfClosing : options.nonEmpty; + } + return location; + } + + /** + * Get the correct 0-indexed column for the closing bracket, given the + * expected location. + * @param {Object} tokens Locations of the opening bracket, closing bracket and last prop + * @param {String} expectedLocation Expected location for the closing bracket + * @return {?Number} The correct column for the closing bracket, or null + */ + function getCorrectColumn(tokens, expectedLocation) { + switch (expectedLocation) { + case 'props-aligned': + return tokens.lastProp.column; + case 'tag-aligned': + return tokens.opening.column; + case 'line-aligned': + return tokens.openingStartOfLine.column; + default: + return null; + } + } + + /** + * Check if the closing bracket is correctly located + * @param {Object} tokens Locations of the opening bracket, closing bracket and last prop + * @param {String} expectedLocation Expected location for the closing bracket + * @return {Boolean} True if the closing bracket is correctly located, false if not + */ + function hasCorrectLocation(tokens, expectedLocation) { + switch (expectedLocation) { + case 'after-tag': + return tokens.tag.line === tokens.closing.line; + case 'after-props': + return tokens.lastProp.lastLine === tokens.closing.line; + case 'props-aligned': + case 'tag-aligned': + case 'line-aligned': { + const correctColumn = getCorrectColumn(tokens, expectedLocation); + return correctColumn === tokens.closing.column; + } + default: + return true; + } + } + + /** + * Get the characters used for indentation on the line to be matched + * @param {Object} tokens Locations of the opening bracket, closing bracket and last prop + * @param {String} expectedLocation Expected location for the closing bracket + * @param {Number} [correctColumn] Expected column for the closing bracket. Default to 0 + * @return {String} The characters used for indentation + */ + function getIndentation(tokens, expectedLocation, correctColumn) { + const newColumn = correctColumn || 0; + let indentation; + let spaces = []; + switch (expectedLocation) { + case 'props-aligned': + indentation = /^\s*/.exec(context.getSourceCode().lines[tokens.lastProp.firstLine - 1])[0]; + break; + case 'tag-aligned': + case 'line-aligned': + indentation = /^\s*/.exec(context.getSourceCode().lines[tokens.opening.line - 1])[0]; + break; + default: + indentation = ''; + } + if (indentation.length + 1 < newColumn) { + // Non-whitespace characters were included in the column offset + spaces = new Array(+correctColumn + 1 - indentation.length); + } + return indentation + spaces.join(' '); + } + + /** + * Get the locations of the opening bracket, closing bracket, last prop, and + * start of opening line. + * @param {ASTNode} node The node to check + * @return {Object} Locations of the opening bracket, closing bracket, last + * prop and start of opening line. + */ + function getTokensLocations(node) { + const sourceCode = context.getSourceCode(); + const opening = sourceCode.getFirstToken(node).loc.start; + const closing = sourceCode.getLastTokens(node, node.selfClosing ? 2 : 1)[0].loc.start; + const tag = sourceCode.getFirstToken(node.name).loc.start; + let lastProp; + if (node.attributes.length) { + lastProp = node.attributes[node.attributes.length - 1]; + lastProp = { + column: sourceCode.getFirstToken(lastProp).loc.start.column, + firstLine: sourceCode.getFirstToken(lastProp).loc.start.line, + lastLine: sourceCode.getLastToken(lastProp).loc.end.line, + }; + } + const openingLine = sourceCode.lines[opening.line - 1]; + const closingLine = sourceCode.lines[closing.line - 1]; + const isTab = { + openTab: /^\t/.test(openingLine), + closeTab: /^\t/.test(closingLine), + }; + const openingStartOfLine = { + column: /^\s*/.exec(openingLine)[0].length, + line: opening.line, + }; + return { + isTab, + tag, + opening, + closing, + lastProp, + selfClosing: node.selfClosing, + openingStartOfLine, + }; + } + + /** + * Get an unique ID for a given JSXOpeningElement + * + * @param {ASTNode} node The AST node being checked. + * @returns {String} Unique ID (based on its range) + */ + function getOpeningElementId(node) { + return node.range.join(':'); + } + + const lastAttributeNode = {}; + + return { + JSXAttribute(node) { + lastAttributeNode[getOpeningElementId(node.parent)] = node; + }, + + JSXSpreadAttribute(node) { + lastAttributeNode[getOpeningElementId(node.parent)] = node; + }, + + 'JSXOpeningElement:exit'(node) { + const attributeNode = lastAttributeNode[getOpeningElementId(node)]; + const cachedLastAttributeEndPos = attributeNode ? attributeNode.range[1] : null; + + let expectedNextLine; + const tokens = getTokensLocations(node); + const expectedLocation = getExpectedLocation(tokens); + let usingSameIndentation = true; + + if (expectedLocation === 'tag-aligned') { + usingSameIndentation = tokens.isTab.openTab === tokens.isTab.closeTab; + } + + if (hasCorrectLocation(tokens, expectedLocation) && usingSameIndentation) { + return; + } + + const data = { location: MESSAGE_LOCATION[expectedLocation] }; + const correctColumn = getCorrectColumn(tokens, expectedLocation); + + if (correctColumn !== null) { + expectedNextLine = tokens.lastProp + && (tokens.lastProp.lastLine === tokens.closing.line); + data.details = ` (expected column ${correctColumn + 1}${expectedNextLine ? ' on the next line)' : ')'}`; + } + + report(context, messages.bracketLocation, 'bracketLocation', { + node, + loc: tokens.closing, + data, + fix(fixer) { + const closingTag = tokens.selfClosing ? '/>' : '>'; + switch (expectedLocation) { + case 'after-tag': + if (cachedLastAttributeEndPos) { + return fixer.replaceTextRange([cachedLastAttributeEndPos, node.range[1]], + (expectedNextLine ? '\n' : '') + closingTag); + } + return fixer.replaceTextRange([node.name.range[1], node.range[1]], + (expectedNextLine ? '\n' : ' ') + closingTag); + case 'after-props': + return fixer.replaceTextRange([cachedLastAttributeEndPos, node.range[1]], + (expectedNextLine ? '\n' : '') + closingTag); + case 'props-aligned': + case 'tag-aligned': + case 'line-aligned': + return fixer.replaceTextRange([cachedLastAttributeEndPos, node.range[1]], + `\n${getIndentation(tokens, expectedLocation, correctColumn)}${closingTag}`); + default: + return true; + } + }, + }); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-closing-tag-location.js b/node_modules/eslint-plugin-react/lib/rules/jsx-closing-tag-location.js new file mode 100644 index 000000000..ef6828551 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-closing-tag-location.js @@ -0,0 +1,73 @@ +/** + * @fileoverview Validate closing tag location in JSX + * @author Ross Solomon + */ + +'use strict'; + +const astUtil = require('../util/ast'); +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + onOwnLine: 'Closing tag of a multiline JSX expression must be on its own line.', + matchIndent: 'Expected closing tag to match indentation of opening.', +}; + +module.exports = { + meta: { + docs: { + description: 'Enforce closing tag location for multiline JSX', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-closing-tag-location'), + }, + fixable: 'whitespace', + messages, + }, + + create(context) { + function handleClosingElement(node) { + if (!node.parent) { + return; + } + + const opening = node.parent.openingElement || node.parent.openingFragment; + if (opening.loc.start.line === node.loc.start.line) { + return; + } + + if (opening.loc.start.column === node.loc.start.column) { + return; + } + + const messageId = astUtil.isNodeFirstInLine(context, node) + ? 'matchIndent' + : 'onOwnLine'; + report(context, messages[messageId], messageId, { + node, + loc: node.loc, + fix(fixer) { + const indent = Array(opening.loc.start.column + 1).join(' '); + if (astUtil.isNodeFirstInLine(context, node)) { + return fixer.replaceTextRange( + [node.range[0] - node.loc.start.column, node.range[0]], + indent + ); + } + + return fixer.insertTextBefore(node, `\n${indent}`); + }, + }); + } + + return { + JSXClosingElement: handleClosingElement, + JSXClosingFragment: handleClosingElement, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-curly-brace-presence.js b/node_modules/eslint-plugin-react/lib/rules/jsx-curly-brace-presence.js new file mode 100755 index 000000000..996aecc3d --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-curly-brace-presence.js @@ -0,0 +1,414 @@ +/** + * @fileoverview Enforce curly braces or disallow unnecessary curly brace in JSX + * @author Jacky Ho + * @author Simon Lydell + */ + +'use strict'; + +const arrayIncludes = require('array-includes'); + +const docsUrl = require('../util/docsUrl'); +const jsxUtil = require('../util/jsx'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Constants +// ------------------------------------------------------------------------------ + +const OPTION_ALWAYS = 'always'; +const OPTION_NEVER = 'never'; +const OPTION_IGNORE = 'ignore'; + +const OPTION_VALUES = [ + OPTION_ALWAYS, + OPTION_NEVER, + OPTION_IGNORE, +]; +const DEFAULT_CONFIG = { props: OPTION_NEVER, children: OPTION_NEVER, propElementValues: OPTION_IGNORE }; + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + unnecessaryCurly: 'Curly braces are unnecessary here.', + missingCurly: 'Need to wrap this literal in a JSX expression.', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-curly-brace-presence'), + }, + fixable: 'code', + + messages, + + schema: [ + { + oneOf: [ + { + type: 'object', + properties: { + props: { enum: OPTION_VALUES }, + children: { enum: OPTION_VALUES }, + propElementValues: { enum: OPTION_VALUES }, + }, + additionalProperties: false, + }, + { + enum: OPTION_VALUES, + }, + ], + }, + ], + }, + + create(context) { + const HTML_ENTITY_REGEX = () => /&[A-Za-z\d#]+;/g; + const ruleOptions = context.options[0]; + const userConfig = typeof ruleOptions === 'string' + ? { props: ruleOptions, children: ruleOptions, propElementValues: OPTION_IGNORE } + : Object.assign({}, DEFAULT_CONFIG, ruleOptions); + + function containsLineTerminators(rawStringValue) { + return /[\n\r\u2028\u2029]/.test(rawStringValue); + } + + function containsBackslash(rawStringValue) { + return arrayIncludes(rawStringValue, '\\'); + } + + function containsHTMLEntity(rawStringValue) { + return HTML_ENTITY_REGEX().test(rawStringValue); + } + + function containsOnlyHtmlEntities(rawStringValue) { + return rawStringValue.replace(HTML_ENTITY_REGEX(), '').trim() === ''; + } + + function containsDisallowedJSXTextChars(rawStringValue) { + return /[{<>}]/.test(rawStringValue); + } + + function containsQuoteCharacters(value) { + return /['"]/.test(value); + } + + function containsMultilineComment(value) { + return /\/\*/.test(value); + } + + function escapeDoubleQuotes(rawStringValue) { + return rawStringValue.replace(/\\"/g, '"').replace(/"/g, '\\"'); + } + + function escapeBackslashes(rawStringValue) { + return rawStringValue.replace(/\\/g, '\\\\'); + } + + function needToEscapeCharacterForJSX(raw, node) { + return ( + containsBackslash(raw) + || containsHTMLEntity(raw) + || (node.parent.type !== 'JSXAttribute' && containsDisallowedJSXTextChars(raw)) + ); + } + + function containsWhitespaceExpression(child) { + if (child.type === 'JSXExpressionContainer') { + const value = child.expression.value; + return value ? jsxUtil.isWhiteSpaces(value) : false; + } + return false; + } + + function isLineBreak(text) { + return containsLineTerminators(text) && text.trim() === ''; + } + + function wrapNonHTMLEntities(text) { + const HTML_ENTITY = ''; + const withCurlyBraces = text.split(HTML_ENTITY_REGEX()).map((word) => ( + word === '' ? '' : `{${JSON.stringify(word)}}` + )).join(HTML_ENTITY); + + const htmlEntities = text.match(HTML_ENTITY_REGEX()); + return htmlEntities.reduce((acc, htmlEntity) => ( + acc.replace(HTML_ENTITY, htmlEntity) + ), withCurlyBraces); + } + + function wrapWithCurlyBraces(rawText) { + if (!containsLineTerminators(rawText)) { + return `{${JSON.stringify(rawText)}}`; + } + + return rawText.split('\n').map((line) => { + if (line.trim() === '') { + return line; + } + const firstCharIndex = line.search(/[^\s]/); + const leftWhitespace = line.slice(0, firstCharIndex); + const text = line.slice(firstCharIndex); + + if (containsHTMLEntity(line)) { + return `${leftWhitespace}${wrapNonHTMLEntities(text)}`; + } + return `${leftWhitespace}{${JSON.stringify(text)}}`; + }).join('\n'); + } + + /** + * Report and fix an unnecessary curly brace violation on a node + * @param {ASTNode} JSXExpressionNode - The AST node with an unnecessary JSX expression + */ + function reportUnnecessaryCurly(JSXExpressionNode) { + report(context, messages.unnecessaryCurly, 'unnecessaryCurly', { + node: JSXExpressionNode, + fix(fixer) { + const expression = JSXExpressionNode.expression; + + let textToReplace; + if (jsxUtil.isJSX(expression)) { + const sourceCode = context.getSourceCode(); + textToReplace = sourceCode.getText(expression); + } else { + const expressionType = expression && expression.type; + const parentType = JSXExpressionNode.parent.type; + + if (parentType === 'JSXAttribute') { + textToReplace = `"${expressionType === 'TemplateLiteral' + ? expression.quasis[0].value.raw + : expression.raw.substring(1, expression.raw.length - 1) + }"`; + } else if (jsxUtil.isJSX(expression)) { + const sourceCode = context.getSourceCode(); + + textToReplace = sourceCode.getText(expression); + } else { + textToReplace = expressionType === 'TemplateLiteral' + ? expression.quasis[0].value.cooked : expression.value; + } + } + + return fixer.replaceText(JSXExpressionNode, textToReplace); + }, + }); + } + + function reportMissingCurly(literalNode) { + report(context, messages.missingCurly, 'missingCurly', { + node: literalNode, + fix(fixer) { + if (jsxUtil.isJSX(literalNode)) { + return fixer.replaceText(literalNode, `{${context.getSourceCode().getText(literalNode)}}`); + } + + // If a HTML entity name is found, bail out because it can be fixed + // by either using the real character or the unicode equivalent. + // If it contains any line terminator character, bail out as well. + if ( + containsOnlyHtmlEntities(literalNode.raw) + || (literalNode.parent.type === 'JSXAttribute' && containsLineTerminators(literalNode.raw)) + || isLineBreak(literalNode.raw) + ) { + return null; + } + + const expression = literalNode.parent.type === 'JSXAttribute' + ? `{"${escapeDoubleQuotes(escapeBackslashes( + literalNode.raw.substring(1, literalNode.raw.length - 1) + ))}"}` + : wrapWithCurlyBraces(literalNode.raw); + + return fixer.replaceText(literalNode, expression); + }, + }); + } + + function isWhiteSpaceLiteral(node) { + return node.type && node.type === 'Literal' && node.value && jsxUtil.isWhiteSpaces(node.value); + } + + function isStringWithTrailingWhiteSpaces(value) { + return /^\s|\s$/.test(value); + } + + function isLiteralWithTrailingWhiteSpaces(node) { + return node.type && node.type === 'Literal' && node.value && isStringWithTrailingWhiteSpaces(node.value); + } + + // Bail out if there is any character that needs to be escaped in JSX + // because escaping decreases readability and the original code may be more + // readable anyway or intentional for other specific reasons + function lintUnnecessaryCurly(JSXExpressionNode) { + const expression = JSXExpressionNode.expression; + const expressionType = expression.type; + + const sourceCode = context.getSourceCode(); + // Curly braces containing comments are necessary + if (sourceCode.getCommentsInside && sourceCode.getCommentsInside(JSXExpressionNode).length > 0) { + return; + } + + if ( + (expressionType === 'Literal' || expressionType === 'JSXText') + && typeof expression.value === 'string' + && ( + (JSXExpressionNode.parent.type === 'JSXAttribute' && !isWhiteSpaceLiteral(expression)) + || !isLiteralWithTrailingWhiteSpaces(expression) + ) + && !containsMultilineComment(expression.value) + && !needToEscapeCharacterForJSX(expression.raw, JSXExpressionNode) && ( + jsxUtil.isJSX(JSXExpressionNode.parent) + || !containsQuoteCharacters(expression.value) + ) + ) { + reportUnnecessaryCurly(JSXExpressionNode); + } else if ( + expressionType === 'TemplateLiteral' + && expression.expressions.length === 0 + && expression.quasis[0].value.raw.indexOf('\n') === -1 + && !isStringWithTrailingWhiteSpaces(expression.quasis[0].value.raw) + && !needToEscapeCharacterForJSX(expression.quasis[0].value.raw, JSXExpressionNode) + && !containsQuoteCharacters(expression.quasis[0].value.cooked) + ) { + reportUnnecessaryCurly(JSXExpressionNode); + } else if (jsxUtil.isJSX(expression)) { + reportUnnecessaryCurly(JSXExpressionNode); + } + } + + function areRuleConditionsSatisfied(parent, config, ruleCondition) { + return ( + parent.type === 'JSXAttribute' + && typeof config.props === 'string' + && config.props === ruleCondition + ) || ( + jsxUtil.isJSX(parent) + && typeof config.children === 'string' + && config.children === ruleCondition + ); + } + + function getAdjacentSiblings(node, children) { + for (let i = 1; i < children.length - 1; i++) { + const child = children[i]; + if (node === child) { + return [children[i - 1], children[i + 1]]; + } + } + if (node === children[0] && children[1]) { + return [children[1]]; + } + if (node === children[children.length - 1] && children[children.length - 2]) { + return [children[children.length - 2]]; + } + return []; + } + + function hasAdjacentJsxExpressionContainers(node, children) { + if (!children) { + return false; + } + const childrenExcludingWhitespaceLiteral = children.filter((child) => !isWhiteSpaceLiteral(child)); + const adjSiblings = getAdjacentSiblings(node, childrenExcludingWhitespaceLiteral); + + return adjSiblings.some((x) => x.type && x.type === 'JSXExpressionContainer'); + } + function hasAdjacentJsx(node, children) { + if (!children) { + return false; + } + const childrenExcludingWhitespaceLiteral = children.filter((child) => !isWhiteSpaceLiteral(child)); + const adjSiblings = getAdjacentSiblings(node, childrenExcludingWhitespaceLiteral); + + return adjSiblings.some((x) => x.type && arrayIncludes(['JSXExpressionContainer', 'JSXElement'], x.type)); + } + function shouldCheckForUnnecessaryCurly(node, config) { + const parent = node.parent; + // Bail out if the parent is a JSXAttribute & its contents aren't + // StringLiteral or TemplateLiteral since e.g + // } prop2={...} /> + + if ( + parent.type && parent.type === 'JSXAttribute' + && (node.expression && node.expression.type + && node.expression.type !== 'Literal' + && node.expression.type !== 'StringLiteral' + && node.expression.type !== 'TemplateLiteral') + ) { + return false; + } + + // If there are adjacent `JsxExpressionContainer` then there is no need, + // to check for unnecessary curly braces. + if (jsxUtil.isJSX(parent) && hasAdjacentJsxExpressionContainers(node, parent.children)) { + return false; + } + if (containsWhitespaceExpression(node) && hasAdjacentJsx(node, parent.children)) { + return false; + } + if ( + parent.children + && parent.children.length === 1 + && containsWhitespaceExpression(node) + ) { + return false; + } + + return areRuleConditionsSatisfied(parent, config, OPTION_NEVER); + } + + function shouldCheckForMissingCurly(node, config) { + if (jsxUtil.isJSX(node)) { + return config.propElementValues !== OPTION_IGNORE; + } + if ( + isLineBreak(node.raw) + || containsOnlyHtmlEntities(node.raw) + ) { + return false; + } + const parent = node.parent; + if ( + parent.children + && parent.children.length === 1 + && containsWhitespaceExpression(parent.children[0]) + ) { + return false; + } + + return areRuleConditionsSatisfied(parent, config, OPTION_ALWAYS); + } + + // -------------------------------------------------------------------------- + // Public + // -------------------------------------------------------------------------- + + return { + 'JSXAttribute > JSXExpressionContainer > JSXElement'(node) { + if (userConfig.propElementValues === OPTION_NEVER) { + reportUnnecessaryCurly(node.parent); + } + }, + + JSXExpressionContainer(node) { + if (shouldCheckForUnnecessaryCurly(node, userConfig)) { + lintUnnecessaryCurly(node); + } + }, + + 'JSXAttribute > JSXElement, Literal, JSXText'(node) { + if (shouldCheckForMissingCurly(node, userConfig)) { + reportMissingCurly(node); + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-curly-newline.js b/node_modules/eslint-plugin-react/lib/rules/jsx-curly-newline.js new file mode 100644 index 000000000..d9208e10c --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-curly-newline.js @@ -0,0 +1,184 @@ +/** + * @fileoverview enforce consistent line breaks inside jsx curly + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +function getNormalizedOption(context) { + const rawOption = context.options[0] || 'consistent'; + + if (rawOption === 'consistent') { + return { + multiline: 'consistent', + singleline: 'consistent', + }; + } + + if (rawOption === 'never') { + return { + multiline: 'forbid', + singleline: 'forbid', + }; + } + + return { + multiline: rawOption.multiline || 'consistent', + singleline: rawOption.singleline || 'consistent', + }; +} + +const messages = { + expectedBefore: 'Expected newline before \'}\'.', + expectedAfter: 'Expected newline after \'{\'.', + unexpectedBefore: 'Unexpected newline before \'}\'.', + unexpectedAfter: 'Unexpected newline after \'{\'.', +}; + +module.exports = { + meta: { + type: 'layout', + + docs: { + description: 'Enforce consistent linebreaks in curly braces in JSX attributes and expressions', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-curly-newline'), + }, + + fixable: 'whitespace', + + schema: [ + { + oneOf: [ + { + enum: ['consistent', 'never'], + }, + { + type: 'object', + properties: { + singleline: { enum: ['consistent', 'require', 'forbid'] }, + multiline: { enum: ['consistent', 'require', 'forbid'] }, + }, + additionalProperties: false, + }, + ], + }, + ], + + messages, + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const option = getNormalizedOption(context); + + // ---------------------------------------------------------------------- + // Helpers + // ---------------------------------------------------------------------- + + /** + * Determines whether two adjacent tokens are on the same line. + * @param {Object} left - The left token object. + * @param {Object} right - The right token object. + * @returns {boolean} Whether or not the tokens are on the same line. + */ + function isTokenOnSameLine(left, right) { + return left.loc.end.line === right.loc.start.line; + } + + /** + * Determines whether there should be newlines inside curlys + * @param {ASTNode} expression The expression contained in the curlys + * @param {boolean} hasLeftNewline `true` if the left curly has a newline in the current code. + * @returns {boolean} `true` if there should be newlines inside the function curlys + */ + function shouldHaveNewlines(expression, hasLeftNewline) { + const isMultiline = expression.loc.start.line !== expression.loc.end.line; + + switch (isMultiline ? option.multiline : option.singleline) { + case 'forbid': return false; + case 'require': return true; + case 'consistent': + default: return hasLeftNewline; + } + } + + /** + * Validates curlys + * @param {Object} curlys An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token + * @param {ASTNode} expression The expression inside the curly + * @returns {void} + */ + function validateCurlys(curlys, expression) { + const leftCurly = curlys.leftCurly; + const rightCurly = curlys.rightCurly; + const tokenAfterLeftCurly = sourceCode.getTokenAfter(leftCurly); + const tokenBeforeRightCurly = sourceCode.getTokenBefore(rightCurly); + const hasLeftNewline = !isTokenOnSameLine(leftCurly, tokenAfterLeftCurly); + const hasRightNewline = !isTokenOnSameLine(tokenBeforeRightCurly, rightCurly); + const needsNewlines = shouldHaveNewlines(expression, hasLeftNewline); + + if (hasLeftNewline && !needsNewlines) { + report(context, messages.unexpectedAfter, 'unexpectedAfter', { + node: leftCurly, + fix(fixer) { + return sourceCode + .getText() + .slice(leftCurly.range[1], tokenAfterLeftCurly.range[0]) + .trim() + ? null // If there is a comment between the { and the first element, don't do a fix. + : fixer.removeRange([leftCurly.range[1], tokenAfterLeftCurly.range[0]]); + }, + }); + } else if (!hasLeftNewline && needsNewlines) { + report(context, messages.expectedAfter, 'expectedAfter', { + node: leftCurly, + fix: (fixer) => fixer.insertTextAfter(leftCurly, '\n'), + }); + } + + if (hasRightNewline && !needsNewlines) { + report(context, messages.unexpectedBefore, 'unexpectedBefore', { + node: rightCurly, + fix(fixer) { + return sourceCode + .getText() + .slice(tokenBeforeRightCurly.range[1], rightCurly.range[0]) + .trim() + ? null // If there is a comment between the last element and the }, don't do a fix. + : fixer.removeRange([ + tokenBeforeRightCurly.range[1], + rightCurly.range[0], + ]); + }, + }); + } else if (!hasRightNewline && needsNewlines) { + report(context, messages.expectedBefore, 'expectedBefore', { + node: rightCurly, + fix: (fixer) => fixer.insertTextBefore(rightCurly, '\n'), + }); + } + } + + // ---------------------------------------------------------------------- + // Public + // ---------------------------------------------------------------------- + + return { + JSXExpressionContainer(node) { + const curlyTokens = { + leftCurly: sourceCode.getFirstToken(node), + rightCurly: sourceCode.getLastToken(node), + }; + validateCurlys(curlyTokens, node.expression); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-curly-spacing.js b/node_modules/eslint-plugin-react/lib/rules/jsx-curly-spacing.js new file mode 100644 index 000000000..e888b1083 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-curly-spacing.js @@ -0,0 +1,430 @@ +/** + * @fileoverview Enforce or disallow spaces inside of curly braces in JSX attributes. + * @author Jamund Ferguson + * @author Brandyn Bennett + * @author Michael Ficarra + * @author Vignesh Anand + * @author Jamund Ferguson + * @author Yannick Croissant + * @author Erik Wendel + */ + +'use strict'; + +const has = require('object.hasown/polyfill')(); +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const SPACING = { + always: 'always', + never: 'never', +}; +const SPACING_VALUES = [SPACING.always, SPACING.never]; + +const messages = { + noNewlineAfter: 'There should be no newline after \'{{token}}\'', + noNewlineBefore: 'There should be no newline before \'{{token}}\'', + noSpaceAfter: 'There should be no space after \'{{token}}\'', + noSpaceBefore: 'There should be no space before \'{{token}}\'', + spaceNeededAfter: 'A space is required after \'{{token}}\'', + spaceNeededBefore: 'A space is required before \'{{token}}\'', +}; + +module.exports = { + meta: { + docs: { + description: 'Enforce or disallow spaces inside of curly braces in JSX attributes and expressions', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-curly-spacing'), + }, + fixable: 'code', + + messages, + + schema: { + definitions: { + basicConfig: { + type: 'object', + properties: { + when: { + enum: SPACING_VALUES, + }, + allowMultiline: { + type: 'boolean', + }, + spacing: { + type: 'object', + properties: { + objectLiterals: { + enum: SPACING_VALUES, + }, + }, + }, + }, + }, + basicConfigOrBoolean: { + oneOf: [{ + $ref: '#/definitions/basicConfig', + }, { + type: 'boolean', + }], + }, + }, + type: 'array', + items: [{ + oneOf: [{ + allOf: [{ + $ref: '#/definitions/basicConfig', + }, { + type: 'object', + properties: { + attributes: { + $ref: '#/definitions/basicConfigOrBoolean', + }, + children: { + $ref: '#/definitions/basicConfigOrBoolean', + }, + }, + }], + }, { + enum: SPACING_VALUES, + }], + }, { + type: 'object', + properties: { + allowMultiline: { + type: 'boolean', + }, + spacing: { + type: 'object', + properties: { + objectLiterals: { + enum: SPACING_VALUES, + }, + }, + }, + }, + additionalProperties: false, + }], + }, + }, + + create(context) { + function normalizeConfig(configOrTrue, defaults, lastPass) { + const config = configOrTrue === true ? {} : configOrTrue; + const when = config.when || defaults.when; + const allowMultiline = has(config, 'allowMultiline') ? config.allowMultiline : defaults.allowMultiline; + const spacing = config.spacing || {}; + let objectLiteralSpaces = spacing.objectLiterals || defaults.objectLiteralSpaces; + if (lastPass) { + // On the final pass assign the values that should be derived from others if they are still undefined + objectLiteralSpaces = objectLiteralSpaces || when; + } + + return { + when, + allowMultiline, + objectLiteralSpaces, + }; + } + + const DEFAULT_WHEN = SPACING.never; + const DEFAULT_ALLOW_MULTILINE = true; + const DEFAULT_ATTRIBUTES = true; + const DEFAULT_CHILDREN = false; + + let originalConfig = context.options[0] || {}; + if (SPACING_VALUES.indexOf(originalConfig) !== -1) { + originalConfig = Object.assign({ when: context.options[0] }, context.options[1]); + } + const defaultConfig = normalizeConfig(originalConfig, { + when: DEFAULT_WHEN, + allowMultiline: DEFAULT_ALLOW_MULTILINE, + }); + const attributes = has(originalConfig, 'attributes') ? originalConfig.attributes : DEFAULT_ATTRIBUTES; + const attributesConfig = attributes ? normalizeConfig(attributes, defaultConfig, true) : null; + const children = has(originalConfig, 'children') ? originalConfig.children : DEFAULT_CHILDREN; + const childrenConfig = children ? normalizeConfig(children, defaultConfig, true) : null; + + // -------------------------------------------------------------------------- + // Helpers + // -------------------------------------------------------------------------- + + /** + * Determines whether two adjacent tokens have a newline between them. + * @param {Object} left - The left token object. + * @param {Object} right - The right token object. + * @returns {boolean} Whether or not there is a newline between the tokens. + */ + function isMultiline(left, right) { + return left.loc.end.line !== right.loc.start.line; + } + + /** + * Trims text of whitespace between two ranges + * @param {Fixer} fixer - the eslint fixer object + * @param {number} fromLoc - the start location + * @param {number} toLoc - the end location + * @param {string} mode - either 'start' or 'end' + * @param {string=} spacing - a spacing value that will optionally add a space to the removed text + * @returns {Object|*|{range, text}} + */ + function fixByTrimmingWhitespace(fixer, fromLoc, toLoc, mode, spacing) { + let replacementText = context.getSourceCode().text.slice(fromLoc, toLoc); + if (mode === 'start') { + replacementText = replacementText.replace(/^\s+/gm, ''); + } else { + replacementText = replacementText.replace(/\s+$/gm, ''); + } + if (spacing === SPACING.always) { + if (mode === 'start') { + replacementText += ' '; + } else { + replacementText = ` ${replacementText}`; + } + } + return fixer.replaceTextRange([fromLoc, toLoc], replacementText); + } + + /** + * Reports that there shouldn't be a newline after the first token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @param {string} spacing + * @returns {void} + */ + function reportNoBeginningNewline(node, token, spacing) { + report(context, messages.noNewlineAfter, 'noNewlineAfter', { + node, + loc: token.loc.start, + data: { + token: token.value, + }, + fix(fixer) { + const nextToken = context.getSourceCode().getTokenAfter(token); + return fixByTrimmingWhitespace(fixer, token.range[1], nextToken.range[0], 'start', spacing); + }, + }); + } + + /** + * Reports that there shouldn't be a newline before the last token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @param {string} spacing + * @returns {void} + */ + function reportNoEndingNewline(node, token, spacing) { + report(context, messages.noNewlineBefore, 'noNewlineBefore', { + node, + loc: token.loc.start, + data: { + token: token.value, + }, + fix(fixer) { + const previousToken = context.getSourceCode().getTokenBefore(token); + return fixByTrimmingWhitespace(fixer, previousToken.range[1], token.range[0], 'end', spacing); + }, + }); + } + + /** + * Reports that there shouldn't be a space after the first token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportNoBeginningSpace(node, token) { + report(context, messages.noSpaceAfter, 'noSpaceAfter', { + node, + loc: token.loc.start, + data: { + token: token.value, + }, + fix(fixer) { + const sourceCode = context.getSourceCode(); + const nextToken = sourceCode.getTokenAfter(token); + let nextComment; + + // eslint >=4.x + if (sourceCode.getCommentsAfter) { + nextComment = sourceCode.getCommentsAfter(token); + // eslint 3.x + } else { + const potentialComment = sourceCode.getTokenAfter(token, { includeComments: true }); + nextComment = nextToken === potentialComment ? [] : [potentialComment]; + } + + // Take comments into consideration to narrow the fix range to what is actually affected. (See #1414) + if (nextComment.length > 0) { + return fixByTrimmingWhitespace(fixer, token.range[1], Math.min(nextToken.range[0], nextComment[0].range[0]), 'start'); + } + + return fixByTrimmingWhitespace(fixer, token.range[1], nextToken.range[0], 'start'); + }, + }); + } + + /** + * Reports that there shouldn't be a space before the last token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportNoEndingSpace(node, token) { + report(context, messages.noSpaceBefore, 'noSpaceBefore', { + node, + loc: token.loc.start, + data: { + token: token.value, + }, + fix(fixer) { + const sourceCode = context.getSourceCode(); + const previousToken = sourceCode.getTokenBefore(token); + let previousComment; + + // eslint >=4.x + if (sourceCode.getCommentsBefore) { + previousComment = sourceCode.getCommentsBefore(token); + // eslint 3.x + } else { + const potentialComment = sourceCode.getTokenBefore(token, { includeComments: true }); + previousComment = previousToken === potentialComment ? [] : [potentialComment]; + } + + // Take comments into consideration to narrow the fix range to what is actually affected. (See #1414) + if (previousComment.length > 0) { + return fixByTrimmingWhitespace(fixer, Math.max(previousToken.range[1], previousComment[0].range[1]), token.range[0], 'end'); + } + + return fixByTrimmingWhitespace(fixer, previousToken.range[1], token.range[0], 'end'); + }, + }); + } + + /** + * Reports that there should be a space after the first token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningSpace(node, token) { + report(context, messages.spaceNeededAfter, 'spaceNeededAfter', { + node, + loc: token.loc.start, + data: { + token: token.value, + }, + fix(fixer) { + return fixer.insertTextAfter(token, ' '); + }, + }); + } + + /** + * Reports that there should be a space before the last token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingSpace(node, token) { + report(context, messages.spaceNeededBefore, 'spaceNeededBefore', { + node, + loc: token.loc.start, + data: { + token: token.value, + }, + fix(fixer) { + return fixer.insertTextBefore(token, ' '); + }, + }); + } + + /** + * Determines if spacing in curly braces is valid. + * @param {ASTNode} node The AST node to check. + * @returns {void} + */ + function validateBraceSpacing(node) { + let config; + switch (node.parent.type) { + case 'JSXAttribute': + case 'JSXOpeningElement': + config = attributesConfig; + break; + + case 'JSXElement': + case 'JSXFragment': + config = childrenConfig; + break; + + default: + return; + } + if (config === null) { + return; + } + + const sourceCode = context.getSourceCode(); + const first = sourceCode.getFirstToken(node); + const last = sourceCode.getLastToken(node); + let second = sourceCode.getTokenAfter(first, { includeComments: true }); + let penultimate = sourceCode.getTokenBefore(last, { includeComments: true }); + + if (!second) { + second = sourceCode.getTokenAfter(first); + const leadingComments = sourceCode.getNodeByRangeIndex(second.range[0]).leadingComments; + second = leadingComments ? leadingComments[0] : second; + } + if (!penultimate) { + penultimate = sourceCode.getTokenBefore(last); + const trailingComments = sourceCode.getNodeByRangeIndex(penultimate.range[0]).trailingComments; + penultimate = trailingComments ? trailingComments[trailingComments.length - 1] : penultimate; + } + + const isObjectLiteral = first.value === second.value; + const spacing = isObjectLiteral ? config.objectLiteralSpaces : config.when; + if (spacing === SPACING.always) { + if (!sourceCode.isSpaceBetweenTokens(first, second)) { + reportRequiredBeginningSpace(node, first); + } else if (!config.allowMultiline && isMultiline(first, second)) { + reportNoBeginningNewline(node, first, spacing); + } + if (!sourceCode.isSpaceBetweenTokens(penultimate, last)) { + reportRequiredEndingSpace(node, last); + } else if (!config.allowMultiline && isMultiline(penultimate, last)) { + reportNoEndingNewline(node, last, spacing); + } + } else if (spacing === SPACING.never) { + if (isMultiline(first, second)) { + if (!config.allowMultiline) { + reportNoBeginningNewline(node, first, spacing); + } + } else if (sourceCode.isSpaceBetweenTokens(first, second)) { + reportNoBeginningSpace(node, first); + } + if (isMultiline(penultimate, last)) { + if (!config.allowMultiline) { + reportNoEndingNewline(node, last, spacing); + } + } else if (sourceCode.isSpaceBetweenTokens(penultimate, last)) { + reportNoEndingSpace(node, last); + } + } + } + + // -------------------------------------------------------------------------- + // Public + // -------------------------------------------------------------------------- + + return { + JSXExpressionContainer: validateBraceSpacing, + JSXSpreadAttribute: validateBraceSpacing, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-equals-spacing.js b/node_modules/eslint-plugin-react/lib/rules/jsx-equals-spacing.js new file mode 100644 index 000000000..e5eefd2bb --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-equals-spacing.js @@ -0,0 +1,110 @@ +/** + * @fileoverview Disallow or enforce spaces around equal signs in JSX attributes. + * @author ryym + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + noSpaceBefore: 'There should be no space before \'=\'', + noSpaceAfter: 'There should be no space after \'=\'', + needSpaceBefore: 'A space is required before \'=\'', + needSpaceAfter: 'A space is required after \'=\'', +}; + +module.exports = { + meta: { + docs: { + description: 'Enforce or disallow spaces around equal signs in JSX attributes', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-equals-spacing'), + }, + fixable: 'code', + + messages, + + schema: [{ + enum: ['always', 'never'], + }], + }, + + create(context) { + const config = context.options[0] || 'never'; + + /** + * Determines a given attribute node has an equal sign. + * @param {ASTNode} attrNode - The attribute node. + * @returns {boolean} Whether or not the attriute node has an equal sign. + */ + function hasEqual(attrNode) { + return attrNode.type !== 'JSXSpreadAttribute' && attrNode.value !== null; + } + + // -------------------------------------------------------------------------- + // Public + // -------------------------------------------------------------------------- + + return { + JSXOpeningElement(node) { + node.attributes.forEach((attrNode) => { + if (!hasEqual(attrNode)) { + return; + } + + const sourceCode = context.getSourceCode(); + const equalToken = sourceCode.getTokenAfter(attrNode.name); + const spacedBefore = sourceCode.isSpaceBetweenTokens(attrNode.name, equalToken); + const spacedAfter = sourceCode.isSpaceBetweenTokens(equalToken, attrNode.value); + + if (config === 'never') { + if (spacedBefore) { + report(context, messages.noSpaceBefore, 'noSpaceBefore', { + node: attrNode, + loc: equalToken.loc.start, + fix(fixer) { + return fixer.removeRange([attrNode.name.range[1], equalToken.range[0]]); + }, + }); + } + if (spacedAfter) { + report(context, messages.noSpaceAfter, 'noSpaceAfter', { + node: attrNode, + loc: equalToken.loc.start, + fix(fixer) { + return fixer.removeRange([equalToken.range[1], attrNode.value.range[0]]); + }, + }); + } + } else if (config === 'always') { + if (!spacedBefore) { + report(context, messages.needSpaceBefore, 'needSpaceBefore', { + node: attrNode, + loc: equalToken.loc.start, + fix(fixer) { + return fixer.insertTextBefore(equalToken, ' '); + }, + }); + } + if (!spacedAfter) { + report(context, messages.needSpaceAfter, 'needSpaceAfter', { + node: attrNode, + loc: equalToken.loc.start, + fix(fixer) { + return fixer.insertTextAfter(equalToken, ' '); + }, + }); + } + } + }); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-filename-extension.js b/node_modules/eslint-plugin-react/lib/rules/jsx-filename-extension.js new file mode 100644 index 000000000..ff6f7a7e8 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-filename-extension.js @@ -0,0 +1,110 @@ +/** + * @fileoverview Restrict file extensions that may contain JSX + * @author Joe Lencioni + */ + +'use strict'; + +const path = require('path'); +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Constants +// ------------------------------------------------------------------------------ + +const DEFAULTS = { + allow: 'always', + extensions: ['.jsx'], +}; + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + noJSXWithExtension: 'JSX not allowed in files with extension \'{{ext}}\'', + extensionOnlyForJSX: 'Only files containing JSX may use the extension \'{{ext}}\'', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow file extensions that may contain JSX', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-filename-extension'), + }, + + messages, + + schema: [{ + type: 'object', + properties: { + allow: { + enum: ['always', 'as-needed'], + }, + extensions: { + type: 'array', + items: { + type: 'string', + }, + }, + }, + additionalProperties: false, + }], + }, + + create(context) { + const filename = context.getFilename(); + + let jsxNode; + + if (filename === '') { + // No need to traverse any nodes. + return {}; + } + + const allow = (context.options[0] && context.options[0].allow) || DEFAULTS.allow; + const allowedExtensions = (context.options[0] && context.options[0].extensions) || DEFAULTS.extensions; + const isAllowedExtension = allowedExtensions.some((extension) => filename.slice(-extension.length) === extension); + + function handleJSX(node) { + if (!jsxNode) { + jsxNode = node; + } + } + + // -------------------------------------------------------------------------- + // Public + // -------------------------------------------------------------------------- + + return { + JSXElement: handleJSX, + JSXFragment: handleJSX, + + 'Program:exit'(node) { + if (jsxNode) { + if (!isAllowedExtension) { + report(context, messages.noJSXWithExtension, 'noJSXWithExtension', { + node: jsxNode, + data: { + ext: path.extname(filename), + }, + }); + } + return; + } + + if (isAllowedExtension && allow === 'as-needed') { + report(context, messages.extensionOnlyForJSX, 'extensionOnlyForJSX', { + node, + data: { + ext: path.extname(filename), + }, + }); + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-first-prop-new-line.js b/node_modules/eslint-plugin-react/lib/rules/jsx-first-prop-new-line.js new file mode 100644 index 000000000..d301a5f3a --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-first-prop-new-line.js @@ -0,0 +1,76 @@ +/** + * @fileoverview Ensure proper position of the first property in JSX + * @author Joachim Seminck + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + propOnNewLine: 'Property should be placed on a new line', + propOnSameLine: 'Property should be placed on the same line as the component declaration', +}; + +module.exports = { + meta: { + docs: { + description: 'Enforce proper position of the first property in JSX', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-first-prop-new-line'), + }, + fixable: 'code', + + messages, + + schema: [{ + enum: ['always', 'never', 'multiline', 'multiline-multiprop'], + }], + }, + + create(context) { + const configuration = context.options[0] || 'multiline-multiprop'; + + function isMultilineJSX(jsxNode) { + return jsxNode.loc.start.line < jsxNode.loc.end.line; + } + + return { + JSXOpeningElement(node) { + if ( + (configuration === 'multiline' && isMultilineJSX(node)) + || (configuration === 'multiline-multiprop' && isMultilineJSX(node) && node.attributes.length > 1) + || (configuration === 'always') + ) { + node.attributes.some((decl) => { + if (decl.loc.start.line === node.loc.start.line) { + report(context, messages.propOnNewLine, 'propOnNewLine', { + node: decl, + fix(fixer) { + return fixer.replaceTextRange([node.name.range[1], decl.range[0]], '\n'); + }, + }); + } + return true; + }); + } else if (configuration === 'never' && node.attributes.length > 0) { + const firstNode = node.attributes[0]; + if (node.loc.start.line < firstNode.loc.start.line) { + report(context, messages.propOnSameLine, 'propOnSameLine', { + node: firstNode, + fix(fixer) { + return fixer.replaceTextRange([node.name.range[1], firstNode.range[0]], ' '); + }, + }); + } + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-fragments.js b/node_modules/eslint-plugin-react/lib/rules/jsx-fragments.js new file mode 100644 index 000000000..38b4dd8b4 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-fragments.js @@ -0,0 +1,209 @@ +/** + * @fileoverview Enforce shorthand or standard form for React fragments. + * @author Alex Zherdev + */ + +'use strict'; + +const elementType = require('jsx-ast-utils/elementType'); +const pragmaUtil = require('../util/pragma'); +const variableUtil = require('../util/variable'); +const testReactVersion = require('../util/version').testReactVersion; +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +function replaceNode(source, node, text) { + return `${source.slice(0, node.range[0])}${text}${source.slice(node.range[1])}`; +} + +const messages = { + fragmentsNotSupported: 'Fragments are only supported starting from React v16.2. ' + + 'Please disable the `react/jsx-fragments` rule in `eslint` settings or upgrade your version of React.', + preferPragma: 'Prefer {{react}}.{{fragment}} over fragment shorthand', + preferFragment: 'Prefer fragment shorthand over {{react}}.{{fragment}}', +}; + +module.exports = { + meta: { + docs: { + description: 'Enforce shorthand or standard form for React fragments', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-fragments'), + }, + fixable: 'code', + + messages, + + schema: [{ + enum: ['syntax', 'element'], + }], + }, + + create(context) { + const configuration = context.options[0] || 'syntax'; + const reactPragma = pragmaUtil.getFromContext(context); + const fragmentPragma = pragmaUtil.getFragmentFromContext(context); + const openFragShort = '<>'; + const closeFragShort = ''; + const openFragLong = `<${reactPragma}.${fragmentPragma}>`; + const closeFragLong = ``; + + function reportOnReactVersion(node) { + if (!testReactVersion(context, '>= 16.2.0')) { + report(context, messages.fragmentsNotSupported, 'fragmentsNotSupported', { + node, + }); + return true; + } + + return false; + } + + function getFixerToLong(jsxFragment) { + const sourceCode = context.getSourceCode(); + if (!jsxFragment.closingFragment || !jsxFragment.openingFragment) { + // the old TS parser crashes here + // TODO: FIXME: can we fake these two descriptors? + return null; + } + return function fix(fixer) { + let source = sourceCode.getText(); + source = replaceNode(source, jsxFragment.closingFragment, closeFragLong); + source = replaceNode(source, jsxFragment.openingFragment, openFragLong); + const lengthDiff = openFragLong.length - sourceCode.getText(jsxFragment.openingFragment).length + + closeFragLong.length - sourceCode.getText(jsxFragment.closingFragment).length; + const range = jsxFragment.range; + return fixer.replaceTextRange(range, source.slice(range[0], range[1] + lengthDiff)); + }; + } + + function getFixerToShort(jsxElement) { + const sourceCode = context.getSourceCode(); + return function fix(fixer) { + let source = sourceCode.getText(); + let lengthDiff; + if (jsxElement.closingElement) { + source = replaceNode(source, jsxElement.closingElement, closeFragShort); + source = replaceNode(source, jsxElement.openingElement, openFragShort); + lengthDiff = sourceCode.getText(jsxElement.openingElement).length - openFragShort.length + + sourceCode.getText(jsxElement.closingElement).length - closeFragShort.length; + } else { + source = replaceNode(source, jsxElement.openingElement, `${openFragShort}${closeFragShort}`); + lengthDiff = sourceCode.getText(jsxElement.openingElement).length - openFragShort.length + - closeFragShort.length; + } + + const range = jsxElement.range; + return fixer.replaceTextRange(range, source.slice(range[0], range[1] - lengthDiff)); + }; + } + + function refersToReactFragment(name) { + const variableInit = variableUtil.findVariableByName(context, name); + if (!variableInit) { + return false; + } + + // const { Fragment } = React; + if (variableInit.type === 'Identifier' && variableInit.name === reactPragma) { + return true; + } + + // const Fragment = React.Fragment; + if ( + variableInit.type === 'MemberExpression' + && variableInit.object.type === 'Identifier' + && variableInit.object.name === reactPragma + && variableInit.property.type === 'Identifier' + && variableInit.property.name === fragmentPragma + ) { + return true; + } + + // const { Fragment } = require('react'); + if ( + variableInit.callee + && variableInit.callee.name === 'require' + && variableInit.arguments + && variableInit.arguments[0] + && variableInit.arguments[0].value === 'react' + ) { + return true; + } + + return false; + } + + const jsxElements = []; + const fragmentNames = new Set([`${reactPragma}.${fragmentPragma}`]); + + // -------------------------------------------------------------------------- + // Public + // -------------------------------------------------------------------------- + + return { + JSXElement(node) { + jsxElements.push(node); + }, + + JSXFragment(node) { + if (reportOnReactVersion(node)) { + return; + } + + if (configuration === 'element') { + report(context, messages.preferPragma, 'preferPragma', { + node, + data: { + react: reactPragma, + fragment: fragmentPragma, + }, + fix: getFixerToLong(node), + }); + } + }, + + ImportDeclaration(node) { + if (node.source && node.source.value === 'react') { + node.specifiers.forEach((spec) => { + if (spec.imported && spec.imported.name === fragmentPragma) { + if (spec.local) { + fragmentNames.add(spec.local.name); + } + } + }); + } + }, + + 'Program:exit'() { + jsxElements.forEach((node) => { + const openingEl = node.openingElement; + const elName = elementType(openingEl); + + if (fragmentNames.has(elName) || refersToReactFragment(elName)) { + if (reportOnReactVersion(node)) { + return; + } + + const attrs = openingEl.attributes; + if (configuration === 'syntax' && !(attrs && attrs.length > 0)) { + report(context, messages.preferFragment, 'preferFragment', { + node, + data: { + react: reactPragma, + fragment: fragmentPragma, + }, + fix: getFixerToShort(node), + }); + } + } + }); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-handler-names.js b/node_modules/eslint-plugin-react/lib/rules/jsx-handler-names.js new file mode 100644 index 000000000..e82db7647 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-handler-names.js @@ -0,0 +1,171 @@ +/** + * @fileoverview Enforce event handler naming conventions in JSX + * @author Jake Marsh + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + badHandlerName: 'Handler function for {{propKey}} prop key must be a camelCase name beginning with \'{{handlerPrefix}}\' only', + badPropKey: 'Prop key for {{propValue}} must begin with \'{{handlerPropPrefix}}\'', +}; + +module.exports = { + meta: { + docs: { + description: 'Enforce event handler naming conventions in JSX', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-handler-names'), + }, + + messages, + + schema: [{ + anyOf: [ + { + type: 'object', + properties: { + eventHandlerPrefix: { type: 'string' }, + eventHandlerPropPrefix: { type: 'string' }, + checkLocalVariables: { type: 'boolean' }, + checkInlineFunction: { type: 'boolean' }, + }, + additionalProperties: false, + }, { + type: 'object', + properties: { + eventHandlerPrefix: { type: 'string' }, + eventHandlerPropPrefix: { + type: 'boolean', + enum: [false], + }, + checkLocalVariables: { type: 'boolean' }, + checkInlineFunction: { type: 'boolean' }, + }, + additionalProperties: false, + }, { + type: 'object', + properties: { + eventHandlerPrefix: { + type: 'boolean', + enum: [false], + }, + eventHandlerPropPrefix: { type: 'string' }, + checkLocalVariables: { type: 'boolean' }, + checkInlineFunction: { type: 'boolean' }, + }, + additionalProperties: false, + }, { + type: 'object', + properties: { + checkLocalVariables: { type: 'boolean' }, + }, + additionalProperties: false, + }, { + type: 'object', + properties: { + checkInlineFunction: { type: 'boolean' }, + }, + additionalProperties: false, + }, + ], + }], + }, + + create(context) { + function isPrefixDisabled(prefix) { + return prefix === false; + } + + function isInlineHandler(node) { + return node.value.expression.type === 'ArrowFunctionExpression'; + } + + const configuration = context.options[0] || {}; + + const eventHandlerPrefix = isPrefixDisabled(configuration.eventHandlerPrefix) + ? null + : configuration.eventHandlerPrefix || 'handle'; + const eventHandlerPropPrefix = isPrefixDisabled(configuration.eventHandlerPropPrefix) + ? null + : configuration.eventHandlerPropPrefix || 'on'; + + const EVENT_HANDLER_REGEX = !eventHandlerPrefix + ? null + : new RegExp(`^((props\\.${eventHandlerPropPrefix || ''})|((.*\\.)?${eventHandlerPrefix}))[0-9]*[A-Z].*$`); + const PROP_EVENT_HANDLER_REGEX = !eventHandlerPropPrefix + ? null + : new RegExp(`^(${eventHandlerPropPrefix}[A-Z].*|ref)$`); + + const checkLocal = !!configuration.checkLocalVariables; + + const checkInlineFunction = !!configuration.checkInlineFunction; + + return { + JSXAttribute(node) { + if ( + !node.value + || !node.value.expression + || (!checkInlineFunction && isInlineHandler(node)) + || ( + !checkLocal + && (isInlineHandler(node) + ? !node.value.expression.body.callee || !node.value.expression.body.callee.object + : !node.value.expression.object + ) + ) + ) { + return; + } + + const propKey = typeof node.name === 'object' ? node.name.name : node.name; + const expression = node.value.expression; + const propValue = context.getSourceCode() + .getText(checkInlineFunction && isInlineHandler(node) ? expression.body.callee : expression) + .replace(/\s*/g, '') + .replace(/^this\.|.*::/, ''); + + if (propKey === 'ref') { + return; + } + + const propIsEventHandler = PROP_EVENT_HANDLER_REGEX && PROP_EVENT_HANDLER_REGEX.test(propKey); + const propFnIsNamedCorrectly = EVENT_HANDLER_REGEX && EVENT_HANDLER_REGEX.test(propValue); + + if ( + propIsEventHandler + && propFnIsNamedCorrectly !== null + && !propFnIsNamedCorrectly + ) { + report(context, messages.badHandlerName, 'badHandlerName', { + node, + data: { + propKey, + handlerPrefix: eventHandlerPrefix, + }, + }); + } else if ( + propFnIsNamedCorrectly + && propIsEventHandler !== null + && !propIsEventHandler + ) { + report(context, messages.badPropKey, 'badPropKey', { + node, + data: { + propValue, + handlerPropPrefix: eventHandlerPropPrefix, + }, + }); + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-indent-props.js b/node_modules/eslint-plugin-react/lib/rules/jsx-indent-props.js new file mode 100644 index 000000000..4b40247da --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-indent-props.js @@ -0,0 +1,213 @@ +/** + * @fileoverview Validate props indentation in JSX + * @author Yannick Croissant + + * This rule has been ported and modified from eslint and nodeca. + * @author Vitaly Puzrin + * @author Gyandeep Singh + * @copyright 2015 Vitaly Puzrin. All rights reserved. + * @copyright 2015 Gyandeep Singh. All rights reserved. + Copyright (C) 2014 by Vitaly Puzrin + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the 'Software'), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + */ + +'use strict'; + +const astUtil = require('../util/ast'); +const docsUrl = require('../util/docsUrl'); +const reportC = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + wrongIndent: 'Expected indentation of {{needed}} {{type}} {{characters}} but found {{gotten}}.', +}; + +module.exports = { + meta: { + docs: { + description: 'Enforce props indentation in JSX', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-indent-props'), + }, + fixable: 'code', + + messages, + + schema: [{ + oneOf: [{ + enum: ['tab', 'first'], + }, { + type: 'integer', + }, { + type: 'object', + properties: { + indentMode: { + oneOf: [{ + enum: ['tab', 'first'], + }, { + type: 'integer', + }], + }, + ignoreTernaryOperator: { + type: 'boolean', + }, + }, + }], + }], + }, + + create(context) { + const extraColumnStart = 0; + let indentType = 'space'; + /** @type {number|'first'} */ + let indentSize = 4; + const line = { + isUsingOperator: false, + currentOperator: false, + }; + let ignoreTernaryOperator = false; + + if (context.options.length) { + const isConfigObject = typeof context.options[0] === 'object'; + const indentMode = isConfigObject + ? context.options[0].indentMode + : context.options[0]; + + if (indentMode === 'first') { + indentSize = 'first'; + indentType = 'space'; + } else if (indentMode === 'tab') { + indentSize = 1; + indentType = 'tab'; + } else if (typeof indentMode === 'number') { + indentSize = indentMode; + indentType = 'space'; + } + + if (isConfigObject && context.options[0].ignoreTernaryOperator) { + ignoreTernaryOperator = true; + } + } + + /** + * Reports a given indent violation and properly pluralizes the message + * @param {ASTNode} node Node violating the indent rule + * @param {Number} needed Expected indentation character count + * @param {Number} gotten Indentation character count in the actual node/code + */ + function report(node, needed, gotten) { + const msgContext = { + needed, + type: indentType, + characters: needed === 1 ? 'character' : 'characters', + gotten, + }; + + reportC(context, messages.wrongIndent, 'wrongIndent', { + node, + data: msgContext, + fix(fixer) { + return fixer.replaceTextRange([node.range[0] - node.loc.start.column, node.range[0]], + Array(needed + 1).join(indentType === 'space' ? ' ' : '\t')); + }, + }); + } + + /** + * Get node indent + * @param {ASTNode} node Node to examine + * @return {Number} Indent + */ + function getNodeIndent(node) { + let src = context.getSourceCode().getText(node, node.loc.start.column + extraColumnStart); + const lines = src.split('\n'); + src = lines[0]; + + let regExp; + if (indentType === 'space') { + regExp = /^[ ]+/; + } else { + regExp = /^[\t]+/; + } + + const indent = regExp.exec(src); + const useOperator = /^([ ]|[\t])*[:]/.test(src) || /^([ ]|[\t])*[?]/.test(src); + const useBracket = /[<]/.test(src); + + line.currentOperator = false; + if (useOperator) { + line.isUsingOperator = true; + line.currentOperator = true; + } else if (useBracket) { + line.isUsingOperator = false; + } + + return indent ? indent[0].length : 0; + } + + /** + * Check indent for nodes list + * @param {ASTNode[]} nodes list of node objects + * @param {Number} indent needed indent + */ + function checkNodesIndent(nodes, indent) { + let nestedIndent = indent; + nodes.forEach((node) => { + const nodeIndent = getNodeIndent(node); + if ( + line.isUsingOperator + && !line.currentOperator + && indentSize !== 'first' + && !ignoreTernaryOperator + ) { + nestedIndent += indentSize; + line.isUsingOperator = false; + } + if ( + node.type !== 'ArrayExpression' && node.type !== 'ObjectExpression' + && nodeIndent !== nestedIndent && astUtil.isNodeFirstInLine(context, node) + ) { + report(node, nestedIndent, nodeIndent); + } + }); + } + + return { + JSXOpeningElement(node) { + if (!node.attributes.length) { + return; + } + let propIndent; + if (indentSize === 'first') { + const firstPropNode = node.attributes[0]; + propIndent = firstPropNode.loc.start.column; + } else { + const elementIndent = getNodeIndent(node); + propIndent = elementIndent + indentSize; + } + checkNodesIndent(node.attributes, propIndent); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-indent.js b/node_modules/eslint-plugin-react/lib/rules/jsx-indent.js new file mode 100644 index 000000000..d66ac5069 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-indent.js @@ -0,0 +1,441 @@ +/** + * @fileoverview Validate JSX indentation + * @author Yannick Croissant + + * This rule has been ported and modified from eslint and nodeca. + * @author Vitaly Puzrin + * @author Gyandeep Singh + * @copyright 2015 Vitaly Puzrin. All rights reserved. + * @copyright 2015 Gyandeep Singh. All rights reserved. + Copyright (C) 2014 by Vitaly Puzrin + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the 'Software'), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + */ + +'use strict'; + +const matchAll = require('string.prototype.matchall'); + +const astUtil = require('../util/ast'); +const docsUrl = require('../util/docsUrl'); +const reportC = require('../util/report'); +const jsxUtil = require('../util/jsx'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + wrongIndent: 'Expected indentation of {{needed}} {{type}} {{characters}} but found {{gotten}}.', +}; + +module.exports = { + meta: { + docs: { + description: 'Enforce JSX indentation', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-indent'), + }, + fixable: 'whitespace', + + messages, + + schema: [{ + oneOf: [{ + enum: ['tab'], + }, { + type: 'integer', + }], + }, { + type: 'object', + properties: { + checkAttributes: { + type: 'boolean', + }, + indentLogicalExpressions: { + type: 'boolean', + }, + }, + additionalProperties: false, + }], + }, + + create(context) { + const extraColumnStart = 0; + let indentType = 'space'; + let indentSize = 4; + + if (context.options.length) { + if (context.options[0] === 'tab') { + indentSize = 1; + indentType = 'tab'; + } else if (typeof context.options[0] === 'number') { + indentSize = context.options[0]; + indentType = 'space'; + } + } + + const indentChar = indentType === 'space' ? ' ' : '\t'; + const options = context.options[1] || {}; + const checkAttributes = options.checkAttributes || false; + const indentLogicalExpressions = options.indentLogicalExpressions || false; + + /** + * Responsible for fixing the indentation issue fix + * @param {ASTNode} node Node violating the indent rule + * @param {Number} needed Expected indentation character count + * @returns {Function} function to be executed by the fixer + * @private + */ + function getFixerFunction(node, needed) { + const indent = Array(needed + 1).join(indentChar); + + if (node.type === 'JSXText' || node.type === 'Literal') { + return function fix(fixer) { + const regExp = /\n[\t ]*(\S)/g; + const fixedText = node.raw.replace(regExp, (match, p1) => `\n${indent}${p1}`); + return fixer.replaceText(node, fixedText); + }; + } + + if (node.type === 'ReturnStatement') { + const raw = context.getSourceCode().getText(node); + const lines = raw.split('\n'); + if (lines.length > 1) { + return function fix(fixer) { + const lastLineStart = raw.lastIndexOf('\n'); + const lastLine = raw.slice(lastLineStart).replace(/^\n[\t ]*(\S)/, (match, p1) => `\n${indent}${p1}`); + return fixer.replaceTextRange( + [node.range[0] + lastLineStart, node.range[1]], + lastLine + ); + }; + } + } + + return function fix(fixer) { + return fixer.replaceTextRange( + [node.range[0] - node.loc.start.column, node.range[0]], + indent + ); + }; + } + + /** + * Reports a given indent violation and properly pluralizes the message + * @param {ASTNode} node Node violating the indent rule + * @param {Number} needed Expected indentation character count + * @param {Number} gotten Indentation character count in the actual node/code + * @param {Object} [loc] Error line and column location + */ + function report(node, needed, gotten, loc) { + const msgContext = { + needed, + type: indentType, + characters: needed === 1 ? 'character' : 'characters', + gotten, + }; + + reportC(context, messages.wrongIndent, 'wrongIndent', Object.assign({ + node, + data: msgContext, + fix: getFixerFunction(node, needed), + }, loc && { loc })); + } + + /** + * Get node indent + * @param {ASTNode} node Node to examine + * @param {Boolean} [byLastLine] get indent of node's last line + * @param {Boolean} [excludeCommas] skip comma on start of line + * @return {Number} Indent + */ + function getNodeIndent(node, byLastLine, excludeCommas) { + let src = context.getSourceCode().getText(node, node.loc.start.column + extraColumnStart); + const lines = src.split('\n'); + if (byLastLine) { + src = lines[lines.length - 1]; + } else { + src = lines[0]; + } + + const skip = excludeCommas ? ',' : ''; + + let regExp; + if (indentType === 'space') { + regExp = new RegExp(`^[ ${skip}]+`); + } else { + regExp = new RegExp(`^[\t${skip}]+`); + } + + const indent = regExp.exec(src); + return indent ? indent[0].length : 0; + } + + /** + * Check if the node is the right member of a logical expression + * @param {ASTNode} node The node to check + * @return {Boolean} true if its the case, false if not + */ + function isRightInLogicalExp(node) { + return ( + node.parent + && node.parent.parent + && node.parent.parent.type === 'LogicalExpression' + && node.parent.parent.right === node.parent + && !indentLogicalExpressions + ); + } + + /** + * Check if the node is the alternate member of a conditional expression + * @param {ASTNode} node The node to check + * @return {Boolean} true if its the case, false if not + */ + function isAlternateInConditionalExp(node) { + return ( + node.parent + && node.parent.parent + && node.parent.parent.type === 'ConditionalExpression' + && node.parent.parent.alternate === node.parent + && context.getSourceCode().getTokenBefore(node).value !== '(' + ); + } + + /** + * Check if the node is within a DoExpression block but not the first expression (which need to be indented) + * @param {ASTNode} node The node to check + * @return {Boolean} true if its the case, false if not + */ + function isSecondOrSubsequentExpWithinDoExp(node) { + /* + It returns true when node.parent.parent.parent.parent matches: + + DoExpression({ + ..., + body: BlockStatement({ + ..., + body: [ + ..., // 1-n times + ExpressionStatement({ + ..., + expression: JSXElement({ + ..., + openingElement: JSXOpeningElement() // the node + }) + }), + ... // 0-n times + ] + }) + }) + + except: + + DoExpression({ + ..., + body: BlockStatement({ + ..., + body: [ + ExpressionStatement({ + ..., + expression: JSXElement({ + ..., + openingElement: JSXOpeningElement() // the node + }) + }), + ... // 0-n times + ] + }) + }) + */ + const isInExpStmt = ( + node.parent + && node.parent.parent + && node.parent.parent.type === 'ExpressionStatement' + ); + if (!isInExpStmt) { + return false; + } + + const expStmt = node.parent.parent; + const isInBlockStmtWithinDoExp = ( + expStmt.parent + && expStmt.parent.type === 'BlockStatement' + && expStmt.parent.parent + && expStmt.parent.parent.type === 'DoExpression' + ); + if (!isInBlockStmtWithinDoExp) { + return false; + } + + const blockStmt = expStmt.parent; + const blockStmtFirstExp = blockStmt.body[0]; + return !(blockStmtFirstExp === expStmt); + } + + /** + * Check indent for nodes list + * @param {ASTNode} node The node to check + * @param {Number} indent needed indent + * @param {Boolean} [excludeCommas] skip comma on start of line + */ + function checkNodesIndent(node, indent, excludeCommas) { + const nodeIndent = getNodeIndent(node, false, excludeCommas); + const isCorrectRightInLogicalExp = isRightInLogicalExp(node) && (nodeIndent - indent) === indentSize; + const isCorrectAlternateInCondExp = isAlternateInConditionalExp(node) && (nodeIndent - indent) === 0; + if ( + nodeIndent !== indent + && astUtil.isNodeFirstInLine(context, node) + && !isCorrectRightInLogicalExp + && !isCorrectAlternateInCondExp + ) { + report(node, indent, nodeIndent); + } + } + + /** + * Check indent for Literal Node or JSXText Node + * @param {ASTNode} node The node to check + * @param {Number} indent needed indent + */ + function checkLiteralNodeIndent(node, indent) { + const value = node.value; + const regExp = indentType === 'space' ? /\n( *)[\t ]*\S/g : /\n(\t*)[\t ]*\S/g; + const nodeIndentsPerLine = Array.from( + matchAll(String(value), regExp), + (match) => (match[1] ? match[1].length : 0) + ); + const hasFirstInLineNode = nodeIndentsPerLine.length > 0; + if ( + hasFirstInLineNode + && !nodeIndentsPerLine.every((actualIndent) => actualIndent === indent) + ) { + nodeIndentsPerLine.forEach((nodeIndent) => { + report(node, indent, nodeIndent); + }); + } + } + + function handleOpeningElement(node) { + const sourceCode = context.getSourceCode(); + let prevToken = sourceCode.getTokenBefore(node); + if (!prevToken) { + return; + } + // Use the parent in a list or an array + if (prevToken.type === 'JSXText' || ((prevToken.type === 'Punctuator') && prevToken.value === ',')) { + prevToken = sourceCode.getNodeByRangeIndex(prevToken.range[0]); + prevToken = prevToken.type === 'Literal' || prevToken.type === 'JSXText' ? prevToken.parent : prevToken; + // Use the first non-punctuator token in a conditional expression + } else if (prevToken.type === 'Punctuator' && prevToken.value === ':') { + do { + prevToken = sourceCode.getTokenBefore(prevToken); + } while (prevToken.type === 'Punctuator' && prevToken.value !== '/'); + prevToken = sourceCode.getNodeByRangeIndex(prevToken.range[0]); + while (prevToken.parent && prevToken.parent.type !== 'ConditionalExpression') { + prevToken = prevToken.parent; + } + } + prevToken = prevToken.type === 'JSXExpressionContainer' ? prevToken.expression : prevToken; + const parentElementIndent = getNodeIndent(prevToken); + const indent = ( + prevToken.loc.start.line === node.loc.start.line + || isRightInLogicalExp(node) + || isAlternateInConditionalExp(node) + || isSecondOrSubsequentExpWithinDoExp(node) + ) ? 0 : indentSize; + checkNodesIndent(node, parentElementIndent + indent); + } + + function handleClosingElement(node) { + if (!node.parent) { + return; + } + const peerElementIndent = getNodeIndent(node.parent.openingElement || node.parent.openingFragment); + checkNodesIndent(node, peerElementIndent); + } + + function handleAttribute(node) { + if (!checkAttributes || (!node.value || node.value.type !== 'JSXExpressionContainer')) { + return; + } + const nameIndent = getNodeIndent(node.name); + const lastToken = context.getSourceCode().getLastToken(node.value); + const firstInLine = astUtil.getFirstNodeInLine(context, lastToken); + const indent = node.name.loc.start.line === firstInLine.loc.start.line ? 0 : nameIndent; + checkNodesIndent(firstInLine, indent); + } + + function handleLiteral(node) { + if (!node.parent) { + return; + } + if (node.parent.type !== 'JSXElement' && node.parent.type !== 'JSXFragment') { + return; + } + const parentNodeIndent = getNodeIndent(node.parent); + checkLiteralNodeIndent(node, parentNodeIndent + indentSize); + } + + return { + JSXOpeningElement: handleOpeningElement, + JSXOpeningFragment: handleOpeningElement, + JSXClosingElement: handleClosingElement, + JSXClosingFragment: handleClosingElement, + JSXAttribute: handleAttribute, + JSXExpressionContainer(node) { + if (!node.parent) { + return; + } + const parentNodeIndent = getNodeIndent(node.parent); + checkNodesIndent(node, parentNodeIndent + indentSize); + }, + Literal: handleLiteral, + JSXText: handleLiteral, + + ReturnStatement(node) { + if ( + !node.parent + || !jsxUtil.isJSX(node.argument) + ) { + return; + } + + let fn = node.parent; + while (fn && fn.type !== 'FunctionDeclaration' && fn.type !== 'FunctionExpression') { + fn = fn.parent; + } + if ( + !fn + || !jsxUtil.isReturningJSX(node, context, true) + ) { + return; + } + + const openingIndent = getNodeIndent(node); + const closingIndent = getNodeIndent(node, true); + + if (openingIndent !== closingIndent) { + report(node, openingIndent, closingIndent); + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-key.js b/node_modules/eslint-plugin-react/lib/rules/jsx-key.js new file mode 100644 index 000000000..a23d84384 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-key.js @@ -0,0 +1,252 @@ +/** + * @fileoverview Report missing `key` props in iterators/collection literals. + * @author Ben Mosher + */ + +'use strict'; + +const hasProp = require('jsx-ast-utils/hasProp'); +const propName = require('jsx-ast-utils/propName'); +const values = require('object.values'); +const docsUrl = require('../util/docsUrl'); +const pragmaUtil = require('../util/pragma'); +const report = require('../util/report'); +const astUtil = require('../util/ast'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const defaultOptions = { + checkFragmentShorthand: false, + checkKeyMustBeforeSpread: false, + warnOnDuplicates: false, +}; + +const messages = { + missingIterKey: 'Missing "key" prop for element in iterator', + missingIterKeyUsePrag: 'Missing "key" prop for element in iterator. Shorthand fragment syntax does not support providing keys. Use {{reactPrag}}.{{fragPrag}} instead', + missingArrayKey: 'Missing "key" prop for element in array', + missingArrayKeyUsePrag: 'Missing "key" prop for element in array. Shorthand fragment syntax does not support providing keys. Use {{reactPrag}}.{{fragPrag}} instead', + keyBeforeSpread: '`key` prop must be placed before any `{...spread}, to avoid conflicting with React’s new JSX transform: https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html`', + nonUniqueKeys: '`key` prop must be unique', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow missing `key` props in iterators/collection literals', + category: 'Possible Errors', + recommended: true, + url: docsUrl('jsx-key'), + }, + + messages, + + schema: [{ + type: 'object', + properties: { + checkFragmentShorthand: { + type: 'boolean', + default: defaultOptions.checkFragmentShorthand, + }, + checkKeyMustBeforeSpread: { + type: 'boolean', + default: defaultOptions.checkKeyMustBeforeSpread, + }, + warnOnDuplicates: { + type: 'boolean', + default: defaultOptions.warnOnDuplicates, + }, + }, + additionalProperties: false, + }], + }, + + create(context) { + const options = Object.assign({}, defaultOptions, context.options[0]); + const checkFragmentShorthand = options.checkFragmentShorthand; + const checkKeyMustBeforeSpread = options.checkKeyMustBeforeSpread; + const warnOnDuplicates = options.warnOnDuplicates; + const reactPragma = pragmaUtil.getFromContext(context); + const fragmentPragma = pragmaUtil.getFragmentFromContext(context); + + function checkIteratorElement(node) { + if (node.type === 'JSXElement' && !hasProp(node.openingElement.attributes, 'key')) { + report(context, messages.missingIterKey, 'missingIterKey', { + node, + }); + } else if (checkFragmentShorthand && node.type === 'JSXFragment') { + report(context, messages.missingIterKeyUsePrag, 'missingIterKeyUsePrag', { + node, + data: { + reactPrag: reactPragma, + fragPrag: fragmentPragma, + }, + }); + } + } + + function getReturnStatements(node) { + const returnStatements = arguments[1] || []; + if (node.type === 'IfStatement') { + if (node.consequent) { + getReturnStatements(node.consequent, returnStatements); + } + if (node.alternate) { + getReturnStatements(node.alternate, returnStatements); + } + } else if (Array.isArray(node.body)) { + node.body.forEach((item) => { + if (item.type === 'IfStatement') { + getReturnStatements(item, returnStatements); + } + + if (item.type === 'ReturnStatement') { + returnStatements.push(item); + } + }); + } + + return returnStatements; + } + + function isKeyAfterSpread(attributes) { + let hasFoundSpread = false; + return attributes.some((attribute) => { + if (attribute.type === 'JSXSpreadAttribute') { + hasFoundSpread = true; + return false; + } + if (attribute.type !== 'JSXAttribute') { + return false; + } + return hasFoundSpread && propName(attribute) === 'key'; + }); + } + + /** + * Checks if the given node is a function expression or arrow function, + * and checks if there is a missing key prop in return statement's arguments + * @param {ASTNode} node + */ + function checkFunctionsBlockStatement(node) { + if (astUtil.isFunctionLikeExpression(node)) { + if (node.body.type === 'BlockStatement') { + getReturnStatements(node.body) + .filter((returnStatement) => returnStatement && returnStatement.argument) + .forEach((returnStatement) => { + checkIteratorElement(returnStatement.argument); + }); + } + } + } + + /** + * Checks if the given node is an arrow function that has an JSX Element or JSX Fragment in its body, + * and the JSX is missing a key prop + * @param {ASTNode} node + */ + function checkArrowFunctionWithJSX(node) { + const isArrFn = node && node.type === 'ArrowFunctionExpression'; + + if (isArrFn && (node.body.type === 'JSXElement' || node.body.type === 'JSXFragment')) { + checkIteratorElement(node.body); + } + } + + const seen = new WeakSet(); + + return { + 'ArrayExpression, JSXElement > JSXElement'(node) { + const jsx = (node.type === 'ArrayExpression' ? node.elements : node.parent.children).filter((x) => x && x.type === 'JSXElement'); + if (jsx.length === 0) { + return; + } + + const map = {}; + jsx.forEach((element) => { + const attrs = element.openingElement.attributes; + const keys = attrs.filter((x) => x.name && x.name.name === 'key'); + + if (keys.length === 0) { + if (node.type === 'ArrayExpression') { + report(context, messages.missingArrayKey, 'missingArrayKey', { + node: element, + }); + } + } else { + keys.forEach((attr) => { + const value = context.getSourceCode().getText(attr.value); + if (!map[value]) { map[value] = []; } + map[value].push(attr); + + if (checkKeyMustBeforeSpread && isKeyAfterSpread(attrs)) { + report(context, messages.keyBeforeSpread, 'keyBeforeSpread', { + node: node.type === 'ArrayExpression' ? node : node.parent, + }); + } + }); + } + }); + + if (warnOnDuplicates) { + values(map).filter((v) => v.length > 1).forEach((v) => { + v.forEach((n) => { + if (!seen.has(n)) { + seen.add(n); + report(context, messages.nonUniqueKeys, 'nonUniqueKeys', { + node: n, + }); + } + }); + }); + } + }, + + JSXFragment(node) { + if (!checkFragmentShorthand) { + return; + } + + if (node.parent.type === 'ArrayExpression') { + report(context, messages.missingArrayKeyUsePrag, 'missingArrayKeyUsePrag', { + node, + data: { + reactPrag: reactPragma, + fragPrag: fragmentPragma, + }, + }); + } + }, + + // Array.prototype.map + // eslint-disable-next-line no-multi-str + 'CallExpression[callee.type="MemberExpression"][callee.property.name="map"],\ + CallExpression[callee.type="OptionalMemberExpression"][callee.property.name="map"],\ + OptionalCallExpression[callee.type="MemberExpression"][callee.property.name="map"],\ + OptionalCallExpression[callee.type="OptionalMemberExpression"][callee.property.name="map"]'(node) { + const fn = node.arguments.length > 0 && node.arguments[0]; + if (!fn || !astUtil.isFunctionLikeExpression(fn)) { + return; + } + + checkArrowFunctionWithJSX(fn); + + checkFunctionsBlockStatement(fn); + }, + + // Array.from + 'CallExpression[callee.type="MemberExpression"][callee.property.name="from"]'(node) { + const fn = node.arguments.length > 1 && node.arguments[1]; + if (!astUtil.isFunctionLikeExpression(fn)) { + return; + } + + checkArrowFunctionWithJSX(fn); + + checkFunctionsBlockStatement(fn); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-max-depth.js b/node_modules/eslint-plugin-react/lib/rules/jsx-max-depth.js new file mode 100644 index 000000000..f5c72dcc9 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-max-depth.js @@ -0,0 +1,166 @@ +/** + * @fileoverview Validate JSX maximum depth + * @author Chris + */ + +'use strict'; + +const has = require('object.hasown/polyfill')(); +const includes = require('array-includes'); +const variableUtil = require('../util/variable'); +const jsxUtil = require('../util/jsx'); +const docsUrl = require('../util/docsUrl'); +const reportC = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + wrongDepth: 'Expected the depth of nested jsx elements to be <= {{needed}}, but found {{found}}.', +}; + +module.exports = { + meta: { + docs: { + description: 'Enforce JSX maximum depth', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-max-depth'), + }, + + messages, + + schema: [ + { + type: 'object', + properties: { + max: { + type: 'integer', + minimum: 0, + }, + }, + additionalProperties: false, + }, + ], + }, + create(context) { + const DEFAULT_DEPTH = 2; + + const option = context.options[0] || {}; + const maxDepth = has(option, 'max') ? option.max : DEFAULT_DEPTH; + + function isExpression(node) { + return node.type === 'JSXExpressionContainer'; + } + + function hasJSX(node) { + return jsxUtil.isJSX(node) || (isExpression(node) && jsxUtil.isJSX(node.expression)); + } + + function isLeaf(node) { + const children = node.children; + + return !children || children.length === 0 || !children.some(hasJSX); + } + + function getDepth(node) { + let count = 0; + + while (jsxUtil.isJSX(node.parent) || isExpression(node.parent)) { + node = node.parent; + if (jsxUtil.isJSX(node)) { + count += 1; + } + } + + return count; + } + + function report(node, depth) { + reportC(context, messages.wrongDepth, 'wrongDepth', { + node, + data: { + found: depth, + needed: maxDepth, + }, + }); + } + + function findJSXElementOrFragment(variables, name, previousReferences) { + function find(refs, prevRefs) { + for (let i = refs.length - 1; i >= 0; i--) { + if (has(refs[i], 'writeExpr')) { + const writeExpr = refs[i].writeExpr; + + return (jsxUtil.isJSX(writeExpr) + && writeExpr) + || ((writeExpr && writeExpr.type === 'Identifier') + && findJSXElementOrFragment(variables, writeExpr.name, prevRefs)); + } + } + + return null; + } + + const variable = variableUtil.getVariable(variables, name); + if (variable && variable.references) { + const containDuplicates = previousReferences.some((ref) => includes(variable.references, ref)); + + // Prevent getting stuck in circular references + if (containDuplicates) { + return false; + } + + return find(variable.references, previousReferences.concat(variable.references)); + } + + return false; + } + + function checkDescendant(baseDepth, children) { + baseDepth += 1; + (children || []).forEach((node) => { + if (!hasJSX(node)) { + return; + } + + if (baseDepth > maxDepth) { + report(node, baseDepth); + } else if (!isLeaf(node)) { + checkDescendant(baseDepth, node.children); + } + }); + } + + function handleJSX(node) { + if (!isLeaf(node)) { + return; + } + + const depth = getDepth(node); + if (depth > maxDepth) { + report(node, depth); + } + } + + return { + JSXElement: handleJSX, + JSXFragment: handleJSX, + + JSXExpressionContainer(node) { + if (node.expression.type !== 'Identifier') { + return; + } + + const variables = variableUtil.variablesInScope(context); + const element = findJSXElementOrFragment(variables, node.expression.name, []); + + if (element) { + const baseDepth = getDepth(node); + checkDescendant(baseDepth, element.children); + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-max-props-per-line.js b/node_modules/eslint-plugin-react/lib/rules/jsx-max-props-per-line.js new file mode 100644 index 000000000..89e874852 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-max-props-per-line.js @@ -0,0 +1,154 @@ +/** + * @fileoverview Limit maximum of props on a single line in JSX + * @author Yannick Croissant + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +function getPropName(context, propNode) { + if (propNode.type === 'JSXSpreadAttribute') { + return context.getSourceCode().getText(propNode.argument); + } + return propNode.name.name; +} + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + newLine: 'Prop `{{prop}}` must be placed on a new line', +}; + +module.exports = { + meta: { + docs: { + description: 'Enforce maximum of props on a single line in JSX', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-max-props-per-line'), + }, + fixable: 'code', + + messages, + + schema: [{ + anyOf: [{ + type: 'object', + properties: { + maximum: { + type: 'object', + properties: { + single: { + type: 'integer', + minimum: 1, + }, + multi: { + type: 'integer', + minimum: 1, + }, + }, + }, + }, + additionalProperties: false, + }, { + type: 'object', + properties: { + maximum: { + type: 'number', + minimum: 1, + }, + when: { + type: 'string', + enum: ['always', 'multiline'], + }, + }, + additionalProperties: false, + }], + }], + }, + + create(context) { + const configuration = context.options[0] || {}; + const maximum = configuration.maximum || 1; + + const maxConfig = typeof maximum === 'number' + ? { + single: configuration.when === 'multiline' ? Infinity : maximum, + multi: maximum, + } + : { + single: maximum.single || Infinity, + multi: maximum.multi || Infinity, + }; + + function generateFixFunction(line, max) { + const sourceCode = context.getSourceCode(); + const output = []; + const front = line[0].range[0]; + const back = line[line.length - 1].range[1]; + + for (let i = 0; i < line.length; i += max) { + const nodes = line.slice(i, i + max); + output.push(nodes.reduce((prev, curr) => { + if (prev === '') { + return sourceCode.getText(curr); + } + return `${prev} ${sourceCode.getText(curr)}`; + }, '')); + } + + const code = output.join('\n'); + + return function fix(fixer) { + return fixer.replaceTextRange([front, back], code); + }; + } + + return { + JSXOpeningElement(node) { + if (!node.attributes.length) { + return; + } + + const isSingleLineTag = node.loc.start.line === node.loc.end.line; + + if ((isSingleLineTag ? maxConfig.single : maxConfig.multi) === Infinity) { + return; + } + + const firstProp = node.attributes[0]; + const linePartitionedProps = [[firstProp]]; + + node.attributes.reduce((last, decl) => { + if (last.loc.end.line === decl.loc.start.line) { + linePartitionedProps[linePartitionedProps.length - 1].push(decl); + } else { + linePartitionedProps.push([decl]); + } + return decl; + }); + + linePartitionedProps.forEach((propsInLine) => { + const maxPropsCountPerLine = isSingleLineTag && propsInLine[0].loc.start.line === node.loc.start.line + ? maxConfig.single + : maxConfig.multi; + + if (propsInLine.length > maxPropsCountPerLine) { + const name = getPropName(context, propsInLine[maxPropsCountPerLine]); + report(context, messages.newLine, 'newLine', { + node: propsInLine[maxPropsCountPerLine], + data: { + prop: name, + }, + fix: generateFixFunction(propsInLine, maxPropsCountPerLine), + }); + } + }); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-newline.js b/node_modules/eslint-plugin-react/lib/rules/jsx-newline.js new file mode 100644 index 000000000..cbc5e5828 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-newline.js @@ -0,0 +1,150 @@ +/** + * @fileoverview Require or prevent a new line after jsx elements and expressions. + * @author Johnny Zabala + * @author Joseph Stiles + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + require: 'JSX element should start in a new line', + prevent: 'JSX element should not start in a new line', + allowMultilines: 'Multiline JSX elements should start in a new line', +}; + +function isMultilined(node) { + return node.loc.start.line !== node.loc.end.line; +} + +module.exports = { + meta: { + docs: { + description: 'Require or prevent a new line after jsx elements and expressions.', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-newline'), + }, + fixable: 'code', + + messages, + schema: [ + { + type: 'object', + properties: { + prevent: { + default: false, + type: 'boolean', + }, + allowMultilines: { + default: false, + type: 'boolean', + }, + }, + additionalProperties: false, + if: { + properties: { + allowMultilines: { + const: true, + }, + }, + }, + then: { + properties: { + prevent: { + const: true, + }, + }, + required: [ + 'prevent', + ], + }, + }, + ], + }, + create(context) { + const jsxElementParents = new Set(); + const sourceCode = context.getSourceCode(); + + return { + 'Program:exit'() { + jsxElementParents.forEach((parent) => { + parent.children.forEach((element, index, elements) => { + if (element.type === 'JSXElement' || element.type === 'JSXExpressionContainer') { + const configuration = context.options[0] || {}; + const prevent = configuration.prevent || false; + const allowMultilines = configuration.allowMultilines || false; + + const firstAdjacentSibling = elements[index + 1]; + const secondAdjacentSibling = elements[index + 2]; + + const hasSibling = firstAdjacentSibling + && secondAdjacentSibling + && (firstAdjacentSibling.type === 'Literal' || firstAdjacentSibling.type === 'JSXText'); + + if (!hasSibling) return; + + // Check adjacent sibling has the proper amount of newlines + const isWithoutNewLine = !/\n\s*\n/.test(firstAdjacentSibling.value); + + if (allowMultilines && (isMultilined(element) || isMultilined(secondAdjacentSibling))) { + if (!isWithoutNewLine) return; + + const regex = /(\n)(?!.*\1)/g; + const replacement = '\n\n'; + const messageId = 'allowMultilines'; + + report(context, messages[messageId], messageId, { + node: secondAdjacentSibling, + fix(fixer) { + return fixer.replaceText( + firstAdjacentSibling, + sourceCode.getText(firstAdjacentSibling) + .replace(regex, replacement) + ); + }, + }); + + return; + } + + if (isWithoutNewLine === prevent) return; + const messageId = prevent + ? 'prevent' + : 'require'; + + const regex = prevent + ? /(\n\n)(?!.*\1)/g + : /(\n)(?!.*\1)/g; + + const replacement = prevent + ? '\n' + : '\n\n'; + + report(context, messages[messageId], messageId, { + node: secondAdjacentSibling, + fix(fixer) { + return fixer.replaceText( + firstAdjacentSibling, + // double or remove the last newline + sourceCode.getText(firstAdjacentSibling) + .replace(regex, replacement) + ); + }, + }); + } + }); + }); + }, + ':matches(JSXElement, JSXFragment) > :matches(JSXElement, JSXExpressionContainer)': (node) => { + jsxElementParents.add(node.parent); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-no-bind.js b/node_modules/eslint-plugin-react/lib/rules/jsx-no-bind.js new file mode 100644 index 000000000..0a4c38e61 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-no-bind.js @@ -0,0 +1,208 @@ +/** + * @fileoverview Prevents usage of Function.prototype.bind and arrow functions + * in React component props. + * @author Daniel Lo Nigro + * @author Jacky Ho + */ + +'use strict'; + +const propName = require('jsx-ast-utils/propName'); +const docsUrl = require('../util/docsUrl'); +const jsxUtil = require('../util/jsx'); +const report = require('../util/report'); + +// ----------------------------------------------------------------------------- +// Rule Definition +// ----------------------------------------------------------------------------- + +const messages = { + bindCall: 'JSX props should not use .bind()', + arrowFunc: 'JSX props should not use arrow functions', + bindExpression: 'JSX props should not use ::', + func: 'JSX props should not use functions', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow `.bind()` or arrow functions in JSX props', + category: 'Best Practices', + recommended: false, + url: docsUrl('jsx-no-bind'), + }, + + messages, + + schema: [{ + type: 'object', + properties: { + allowArrowFunctions: { + default: false, + type: 'boolean', + }, + allowBind: { + default: false, + type: 'boolean', + }, + allowFunctions: { + default: false, + type: 'boolean', + }, + ignoreRefs: { + default: false, + type: 'boolean', + }, + ignoreDOMComponents: { + default: false, + type: 'boolean', + }, + }, + additionalProperties: false, + }], + }, + + create(context) { + const configuration = context.options[0] || {}; + + // Keep track of all the variable names pointing to a bind call, + // bind expression or an arrow function in different block statements + const blockVariableNameSets = {}; + + /** + * @param {string | number} blockStart + */ + function setBlockVariableNameSet(blockStart) { + blockVariableNameSets[blockStart] = { + arrowFunc: new Set(), + bindCall: new Set(), + bindExpression: new Set(), + func: new Set(), + }; + } + + function getNodeViolationType(node) { + const nodeType = node.type; + if ( + !configuration.allowBind + && nodeType === 'CallExpression' + && node.callee.type === 'MemberExpression' + && node.callee.property.type === 'Identifier' + && node.callee.property.name === 'bind' + ) { + return 'bindCall'; + } + if (nodeType === 'ConditionalExpression') { + return getNodeViolationType(node.test) + || getNodeViolationType(node.consequent) + || getNodeViolationType(node.alternate); + } + if (!configuration.allowArrowFunctions && nodeType === 'ArrowFunctionExpression') { + return 'arrowFunc'; + } + if ( + !configuration.allowFunctions + && (nodeType === 'FunctionExpression' || nodeType === 'FunctionDeclaration') + ) { + return 'func'; + } + if (!configuration.allowBind && nodeType === 'BindExpression') { + return 'bindExpression'; + } + + return null; + } + + /** + * @param {string | number} violationType + * @param {any} variableName + * @param {string | number} blockStart + */ + function addVariableNameToSet(violationType, variableName, blockStart) { + blockVariableNameSets[blockStart][violationType].add(variableName); + } + + function getBlockStatementAncestors(node) { + return context.getAncestors(node).reverse().filter( + (ancestor) => ancestor.type === 'BlockStatement' + ); + } + + function reportVariableViolation(node, name, blockStart) { + const blockSets = blockVariableNameSets[blockStart]; + const violationTypes = Object.keys(blockSets); + + return violationTypes.find((type) => { + if (blockSets[type].has(name)) { + report(context, messages[type], type, { + node, + }); + return true; + } + + return false; + }); + } + + function findVariableViolation(node, name) { + getBlockStatementAncestors(node).find( + (block) => reportVariableViolation(node, name, block.range[0]) + ); + } + + return { + BlockStatement(node) { + setBlockVariableNameSet(node.range[0]); + }, + + FunctionDeclaration(node) { + const blockAncestors = getBlockStatementAncestors(node); + const variableViolationType = getNodeViolationType(node); + + if (blockAncestors.length > 0 && variableViolationType) { + addVariableNameToSet(variableViolationType, node.id.name, blockAncestors[0].range[0]); + } + }, + + VariableDeclarator(node) { + if (!node.init) { + return; + } + const blockAncestors = getBlockStatementAncestors(node); + const variableViolationType = getNodeViolationType(node.init); + + if ( + blockAncestors.length > 0 + && variableViolationType + && node.parent.kind === 'const' // only support const right now + ) { + addVariableNameToSet( + variableViolationType, node.id.name, blockAncestors[0].range[0] + ); + } + }, + + JSXAttribute(node) { + const isRef = configuration.ignoreRefs && propName(node) === 'ref'; + if (isRef || !node.value || !node.value.expression) { + return; + } + const isDOMComponent = jsxUtil.isDOMComponent(node.parent); + if (configuration.ignoreDOMComponents && isDOMComponent) { + return; + } + const valueNode = node.value.expression; + const valueNodeType = valueNode.type; + const nodeViolationType = getNodeViolationType(valueNode); + + if (valueNodeType === 'Identifier') { + findVariableViolation(node, valueNode.name); + } else if (nodeViolationType) { + report(context, messages[nodeViolationType], nodeViolationType, { + node, + }); + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-no-comment-textnodes.js b/node_modules/eslint-plugin-react/lib/rules/jsx-no-comment-textnodes.js new file mode 100644 index 000000000..b33cea0cc --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-no-comment-textnodes.js @@ -0,0 +1,64 @@ +/** + * @fileoverview Comments inside children section of tag should be placed inside braces. + * @author Ben Vinegar + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + putCommentInBraces: 'Comments inside children section of tag should be placed inside braces', +}; + +function checkText(node, context) { + // since babel-eslint has the wrong node.raw, we'll get the source text + const rawValue = context.getSourceCode().getText(node); + if (/^\s*\/(\/|\*)/m.test(rawValue)) { + // inside component, e.g.
literal
+ if ( + node.parent.type !== 'JSXAttribute' + && node.parent.type !== 'JSXExpressionContainer' + && node.parent.type.indexOf('JSX') !== -1 + ) { + report(context, messages.putCommentInBraces, 'putCommentInBraces', { + node, + }); + } + } +} + +module.exports = { + meta: { + docs: { + description: 'Disallow comments from being inserted as text nodes', + category: 'Possible Errors', + recommended: true, + url: docsUrl('jsx-no-comment-textnodes'), + }, + + messages, + + schema: [], + }, + + create(context) { + // -------------------------------------------------------------------------- + // Public + // -------------------------------------------------------------------------- + + return { + Literal(node) { + checkText(node, context); + }, + JSXText(node) { + checkText(node, context); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-no-constructed-context-values.js b/node_modules/eslint-plugin-react/lib/rules/jsx-no-constructed-context-values.js new file mode 100644 index 000000000..af7c9575d --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-no-constructed-context-values.js @@ -0,0 +1,218 @@ +/** + * @fileoverview Prevents jsx context provider values from taking values that + * will cause needless rerenders. + * @author Dylan Oshima + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Helpers +// ------------------------------------------------------------------------------ + +// Recursively checks if an element is a construction. +// A construction is a variable that changes identity every render. +function isConstruction(node, callScope) { + switch (node.type) { + case 'Literal': + if (node.regex != null) { + return { type: 'regular expression', node }; + } + return null; + case 'Identifier': { + const variableScoping = callScope.set.get(node.name); + + if (variableScoping == null || variableScoping.defs == null) { + // If it's not in scope, we don't care. + return null; // Handled + } + + // Gets the last variable identity + const variableDefs = variableScoping.defs; + const def = variableDefs[variableDefs.length - 1]; + if (def != null + && def.type !== 'Variable' + && def.type !== 'FunctionName' + ) { + // Parameter or an unusual pattern. Bail out. + return null; // Unhandled + } + + if (def.node.type === 'FunctionDeclaration') { + return { type: 'function declaration', node: def.node, usage: node }; + } + + const init = def.node.init; + if (init == null) { + return null; + } + + const initConstruction = isConstruction(init, callScope); + if (initConstruction == null) { + return null; + } + + return { + type: initConstruction.type, + node: initConstruction.node, + usage: node, + }; + } + case 'ObjectExpression': + // Any object initialized inline will create a new identity + return { type: 'object', node }; + case 'ArrayExpression': + return { type: 'array', node }; + case 'ArrowFunctionExpression': + case 'FunctionExpression': + // Functions that are initialized inline will have a new identity + return { type: 'function expression', node }; + case 'ClassExpression': + return { type: 'class expression', node }; + case 'NewExpression': + // `const a = new SomeClass();` is a construction + return { type: 'new expression', node }; + case 'ConditionalExpression': + return (isConstruction(node.consequent, callScope) + || isConstruction(node.alternate, callScope) + ); + case 'LogicalExpression': + return (isConstruction(node.left, callScope) + || isConstruction(node.right, callScope) + ); + case 'MemberExpression': { + const objConstruction = isConstruction(node.object, callScope); + if (objConstruction == null) { + return null; + } + return { + type: objConstruction.type, + node: objConstruction.node, + usage: node.object, + }; + } + case 'JSXFragment': + return { type: 'JSX fragment', node }; + case 'JSXElement': + return { type: 'JSX element', node }; + case 'AssignmentExpression': { + const construct = isConstruction(node.right, callScope); + if (construct != null) { + return { + type: 'assignment expression', + node: construct.node, + usage: node, + }; + } + return null; + } + case 'TypeCastExpression': + case 'TSAsExpression': + return isConstruction(node.expression, callScope); + default: + return null; + } +} + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + withIdentifierMsg: "The '{{variableName}}' {{type}} (at line {{nodeLine}}) passed as the value prop to the Context provider (at line {{usageLine}}) changes every render. To fix this consider wrapping it in a useMemo hook.", + withIdentifierMsgFunc: "The '{{variableName}}' {{type}} (at line {{nodeLine}}) passed as the value prop to the Context provider (at line {{usageLine}}) changes every render. To fix this consider wrapping it in a useCallback hook.", + defaultMsg: 'The {{type}} passed as the value prop to the Context provider (at line {{nodeLine}}) changes every render. To fix this consider wrapping it in a useMemo hook.', + defaultMsgFunc: 'The {{type}} passed as the value prop to the Context provider (at line {{nodeLine}}) changes every render. To fix this consider wrapping it in a useCallback hook.', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallows JSX context provider values from taking values that will cause needless rerenders', + category: 'Best Practices', + recommended: false, + url: docsUrl('jsx-no-constructed-context-values'), + }, + messages, + }, + + create(context) { + return { + JSXOpeningElement(node) { + const openingElementName = node.name; + if (openingElementName.type !== 'JSXMemberExpression') { + // Has no member + return; + } + + const isJsxContext = openingElementName.property.name === 'Provider'; + if (!isJsxContext) { + // Member is not Provider + return; + } + + // Contexts can take in more than just a value prop + // so we need to iterate through all of them + const jsxValueAttribute = node.attributes.find( + (attribute) => attribute.type === 'JSXAttribute' && attribute.name.name === 'value' + ); + + if (jsxValueAttribute == null) { + // No value prop was passed + return; + } + + const valueNode = jsxValueAttribute.value; + if (!valueNode) { + // attribute is a boolean shorthand + return; + } + if (valueNode.type !== 'JSXExpressionContainer') { + // value could be a literal + return; + } + + const valueExpression = valueNode.expression; + const invocationScope = context.getScope(); + + // Check if the value prop is a construction + const constructInfo = isConstruction(valueExpression, invocationScope); + if (constructInfo == null) { + return; + } + + // Report found error + const constructType = constructInfo.type; + const constructNode = constructInfo.node; + const constructUsage = constructInfo.usage; + const data = { + type: constructType, nodeLine: constructNode.loc.start.line, + }; + let messageId = 'defaultMsg'; + + // Variable passed to value prop + if (constructUsage != null) { + messageId = 'withIdentifierMsg'; + data.usageLine = constructUsage.loc.start.line; + data.variableName = constructUsage.name; + } + + // Type of expression + if ( + constructType === 'function expression' + || constructType === 'function declaration' + ) { + messageId += 'Func'; + } + + report(context, messages[messageId], messageId, { + node: constructNode, + data, + }); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-no-duplicate-props.js b/node_modules/eslint-plugin-react/lib/rules/jsx-no-duplicate-props.js new file mode 100644 index 000000000..41e17828e --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-no-duplicate-props.js @@ -0,0 +1,76 @@ +/** + * @fileoverview Enforce no duplicate props + * @author Markus Ånöstam + */ + +'use strict'; + +const has = require('object.hasown/polyfill')(); +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + noDuplicateProps: 'No duplicate props allowed', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow duplicate properties in JSX', + category: 'Possible Errors', + recommended: true, + url: docsUrl('jsx-no-duplicate-props'), + }, + + messages, + + schema: [{ + type: 'object', + properties: { + ignoreCase: { + type: 'boolean', + }, + }, + additionalProperties: false, + }], + }, + + create(context) { + const configuration = context.options[0] || {}; + const ignoreCase = configuration.ignoreCase || false; + + return { + JSXOpeningElement(node) { + const props = {}; + + node.attributes.forEach((decl) => { + if (decl.type === 'JSXSpreadAttribute') { + return; + } + + let name = decl.name.name; + + if (typeof name !== 'string') { + return; + } + + if (ignoreCase) { + name = name.toLowerCase(); + } + + if (has(props, name)) { + report(context, messages.noDuplicateProps, 'noDuplicateProps', { + node: decl, + }); + } else { + props[name] = 1; + } + }); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-no-leaked-render.js b/node_modules/eslint-plugin-react/lib/rules/jsx-no-leaked-render.js new file mode 100644 index 000000000..efea6a63c --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-no-leaked-render.js @@ -0,0 +1,161 @@ +/** + * @fileoverview Prevent problematic leaked values from being rendered + * @author Mario Beltrán + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); +const isParenthesized = require('../util/ast').isParenthesized; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const messages = { + noPotentialLeakedRender: 'Potential leaked value that might cause unintentionally rendered values or rendering crashes', +}; + +const COERCE_STRATEGY = 'coerce'; +const TERNARY_STRATEGY = 'ternary'; +const DEFAULT_VALID_STRATEGIES = [TERNARY_STRATEGY, COERCE_STRATEGY]; +const COERCE_VALID_LEFT_SIDE_EXPRESSIONS = ['UnaryExpression', 'BinaryExpression', 'CallExpression']; +const TERNARY_INVALID_ALTERNATE_VALUES = [undefined, null, false]; + +function trimLeftNode(node) { + // Remove double unary expression (boolean coercion), so we avoid trimming valid negations + if (node.type === 'UnaryExpression' && node.argument.type === 'UnaryExpression') { + return trimLeftNode(node.argument.argument); + } + + return node; +} + +function getIsCoerceValidNestedLogicalExpression(node) { + if (node.type === 'LogicalExpression') { + return getIsCoerceValidNestedLogicalExpression(node.left) && getIsCoerceValidNestedLogicalExpression(node.right); + } + + return COERCE_VALID_LEFT_SIDE_EXPRESSIONS.some((validExpression) => validExpression === node.type); +} + +function extractExpressionBetweenLogicalAnds(node) { + if (node.type !== 'LogicalExpression') return [node]; + if (node.operator !== '&&') return [node]; + return [].concat( + extractExpressionBetweenLogicalAnds(node.left), + extractExpressionBetweenLogicalAnds(node.right) + ); +} + +function ruleFixer(context, fixStrategy, fixer, reportedNode, leftNode, rightNode) { + const sourceCode = context.getSourceCode(); + const rightSideText = sourceCode.getText(rightNode); + + if (fixStrategy === COERCE_STRATEGY) { + const expressions = extractExpressionBetweenLogicalAnds(leftNode); + const newText = expressions.map((node) => { + let nodeText = sourceCode.getText(node); + if (isParenthesized(context, node)) { + nodeText = `(${nodeText})`; + } + return `${getIsCoerceValidNestedLogicalExpression(node) ? '' : '!!'}${nodeText}`; + }).join(' && '); + + return fixer.replaceText(reportedNode, `${newText} && ${rightSideText}`); + } + + if (fixStrategy === TERNARY_STRATEGY) { + let leftSideText = sourceCode.getText(trimLeftNode(leftNode)); + if (isParenthesized(context, leftNode)) { + leftSideText = `(${leftSideText})`; + } + return fixer.replaceText(reportedNode, `${leftSideText} ? ${rightSideText} : null`); + } + + throw new TypeError('Invalid value for "validStrategies" option'); +} + +/** + * @type {import('eslint').Rule.RuleModule} + */ +module.exports = { + meta: { + docs: { + description: 'Disallow problematic leaked values from being rendered', + category: 'Possible Errors', + recommended: false, + url: docsUrl('jsx-no-leaked-render'), + }, + + messages, + + fixable: 'code', + schema: [ + { + type: 'object', + properties: { + validStrategies: { + type: 'array', + items: { + enum: [ + TERNARY_STRATEGY, + COERCE_STRATEGY, + ], + }, + uniqueItems: true, + default: DEFAULT_VALID_STRATEGIES, + }, + }, + additionalProperties: false, + }, + ], + }, + + create(context) { + const config = context.options[0] || {}; + const validStrategies = new Set(config.validStrategies || DEFAULT_VALID_STRATEGIES); + const fixStrategy = Array.from(validStrategies)[0]; + + return { + 'JSXExpressionContainer > LogicalExpression[operator="&&"]'(node) { + const leftSide = node.left; + + const isCoerceValidLeftSide = COERCE_VALID_LEFT_SIDE_EXPRESSIONS + .some((validExpression) => validExpression === leftSide.type); + if (validStrategies.has(COERCE_STRATEGY)) { + if (isCoerceValidLeftSide || getIsCoerceValidNestedLogicalExpression(leftSide)) { + return; + } + } + + report(context, messages.noPotentialLeakedRender, 'noPotentialLeakedRender', { + node, + fix(fixer) { + return ruleFixer(context, fixStrategy, fixer, node, leftSide, node.right); + }, + }); + }, + + 'JSXExpressionContainer > ConditionalExpression'(node) { + if (validStrategies.has(TERNARY_STRATEGY)) { + return; + } + + const isValidTernaryAlternate = TERNARY_INVALID_ALTERNATE_VALUES.indexOf(node.alternate.value) === -1; + const isJSXElementAlternate = node.alternate.type === 'JSXElement'; + if (isValidTernaryAlternate || isJSXElementAlternate) { + return; + } + + report(context, messages.noPotentialLeakedRender, 'noPotentialLeakedRender', { + node, + fix(fixer) { + return ruleFixer(context, fixStrategy, fixer, node, node.test, node.consequent); + }, + }); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-no-literals.js b/node_modules/eslint-plugin-react/lib/rules/jsx-no-literals.js new file mode 100644 index 000000000..4349b0829 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-no-literals.js @@ -0,0 +1,192 @@ +/** + * @fileoverview Prevent using string literals in React component definition + * @author Caleb Morris + * @author David Buchan-Swanson + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +function trimIfString(val) { + return typeof val === 'string' ? val.trim() : val; +} + +const messages = { + invalidPropValue: 'Invalid prop value: "{{text}}"', + noStringsInAttributes: 'Strings not allowed in attributes: "{{text}}"', + noStringsInJSX: 'Strings not allowed in JSX files: "{{text}}"', + literalNotInJSXExpression: 'Missing JSX expression container around literal string: "{{text}}"', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow usage of string literals in JSX', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-no-literals'), + }, + + messages, + + schema: [{ + type: 'object', + properties: { + noStrings: { + type: 'boolean', + }, + allowedStrings: { + type: 'array', + uniqueItems: true, + items: { + type: 'string', + }, + }, + ignoreProps: { + type: 'boolean', + }, + noAttributeStrings: { + type: 'boolean', + }, + }, + additionalProperties: false, + }], + }, + + create(context) { + const defaults = { + noStrings: false, + allowedStrings: [], + ignoreProps: false, + noAttributeStrings: false, + }; + const config = Object.assign({}, defaults, context.options[0] || {}); + config.allowedStrings = new Set(config.allowedStrings.map(trimIfString)); + + function defaultMessageId() { + const ancestorIsJSXElement = arguments.length >= 1 && arguments[0]; + if (config.noAttributeStrings && !ancestorIsJSXElement) { + return 'noStringsInAttributes'; + } + if (config.noStrings) { + return 'noStringsInJSX'; + } + return 'literalNotInJSXExpression'; + } + + function getParentIgnoringBinaryExpressions(node) { + let current = node; + while (current.parent.type === 'BinaryExpression') { + current = current.parent; + } + return current.parent; + } + + function getValidation(node) { + const values = [trimIfString(node.raw), trimIfString(node.value)]; + if (values.some((value) => config.allowedStrings.has(value))) { + return false; + } + + const parent = getParentIgnoringBinaryExpressions(node); + + function isParentNodeStandard() { + if (!/^[\s]+$/.test(node.value) && typeof node.value === 'string' && parent.type.includes('JSX')) { + if (config.noAttributeStrings) { + return parent.type === 'JSXAttribute' || parent.type === 'JSXElement'; + } + if (!config.noAttributeStrings) { + return parent.type !== 'JSXAttribute'; + } + } + + return false; + } + + const standard = isParentNodeStandard(); + + if (config.noStrings) { + return standard; + } + return standard && parent.type !== 'JSXExpressionContainer'; + } + + function getParentAndGrandParentType(node) { + const parent = getParentIgnoringBinaryExpressions(node); + const parentType = parent.type; + const grandParentType = parent.parent.type; + + return { + parent, + parentType, + grandParentType, + grandParent: parent.parent, + }; + } + + function hasJSXElementParentOrGrandParent(node) { + const parents = getParentAndGrandParentType(node); + const parentType = parents.parentType; + const grandParentType = parents.grandParentType; + + return parentType === 'JSXFragment' || parentType === 'JSXElement' || grandParentType === 'JSXElement'; + } + + function reportLiteralNode(node, messageId) { + const ancestorIsJSXElement = hasJSXElementParentOrGrandParent(node); + messageId = messageId || defaultMessageId(ancestorIsJSXElement); + + report(context, messages[messageId], messageId, { + node, + data: { + text: context.getSourceCode().getText(node).trim(), + }, + }); + } + + // -------------------------------------------------------------------------- + // Public + // -------------------------------------------------------------------------- + + return { + Literal(node) { + if (getValidation(node) && (hasJSXElementParentOrGrandParent(node) || !config.ignoreProps)) { + reportLiteralNode(node); + } + }, + + JSXAttribute(node) { + const isNodeValueString = node && node.value && node.value.type === 'Literal' && typeof node.value.value === 'string' && !config.allowedStrings.has(node.value.value); + + if (config.noStrings && !config.ignoreProps && isNodeValueString) { + const messageId = 'invalidPropValue'; + reportLiteralNode(node, messageId); + } + }, + + JSXText(node) { + if (getValidation(node)) { + reportLiteralNode(node); + } + }, + + TemplateLiteral(node) { + const parents = getParentAndGrandParentType(node); + const parentType = parents.parentType; + const grandParentType = parents.grandParentType; + const isParentJSXExpressionCont = parentType === 'JSXExpressionContainer'; + const isParentJSXElement = parentType === 'JSXElement' || grandParentType === 'JSXElement'; + + if (isParentJSXExpressionCont && config.noStrings && (isParentJSXElement || !config.ignoreProps)) { + reportLiteralNode(node); + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-no-script-url.js b/node_modules/eslint-plugin-react/lib/rules/jsx-no-script-url.js new file mode 100644 index 000000000..425741cf1 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-no-script-url.js @@ -0,0 +1,97 @@ +/** + * @fileoverview Prevent usage of `javascript:` URLs + * @author Sergei Startsev + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +// https://github.com/facebook/react/blob/d0ebde77f6d1232cefc0da184d731943d78e86f2/packages/react-dom/src/shared/sanitizeURL.js#L30 +/* eslint-disable-next-line max-len, no-control-regex */ +const isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i; + +function hasJavaScriptProtocol(attr) { + return attr.value && attr.value.type === 'Literal' + && isJavaScriptProtocol.test(attr.value.value); +} + +function shouldVerifyElement(node, config) { + const name = node.name && node.name.name; + return name === 'a' || config.find((i) => i.name === name); +} + +function shouldVerifyProp(node, config) { + const name = node.name && node.name.name; + const parentName = node.parent.name && node.parent.name.name; + + if (parentName === 'a' && name === 'href') { + return true; + } + + const el = config.find((i) => i.name === parentName); + if (!el) { + return false; + } + + const props = el.props || []; + return node.name && props.indexOf(name) !== -1; +} + +const messages = { + noScriptURL: 'A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML, try using dangerouslySetInnerHTML instead.', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow usage of `javascript:` URLs', + category: 'Best Practices', + recommended: false, + url: docsUrl('jsx-no-script-url'), + }, + + messages, + + schema: [{ + type: 'array', + uniqueItems: true, + items: { + type: 'object', + properties: { + name: { + type: 'string', + }, + props: { + type: 'array', + items: { + type: 'string', + uniqueItems: true, + }, + }, + }, + required: ['name', 'props'], + additionalProperties: false, + }, + }], + }, + + create(context) { + const config = context.options[0] || []; + return { + JSXAttribute(node) { + const parent = node.parent; + if (shouldVerifyElement(parent, config) && shouldVerifyProp(node, config) && hasJavaScriptProtocol(node)) { + report(context, messages.noScriptURL, 'noScriptURL', { + node, + }); + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-no-target-blank.js b/node_modules/eslint-plugin-react/lib/rules/jsx-no-target-blank.js new file mode 100644 index 000000000..ca1eb7c7c --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-no-target-blank.js @@ -0,0 +1,267 @@ +/** + * @fileoverview Forbid target='_blank' attribute + * @author Kevin Miller + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const linkComponentsUtil = require('../util/linkComponents'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +function findLastIndex(arr, condition) { + for (let i = arr.length - 1; i >= 0; i -= 1) { + if (condition(arr[i])) { + return i; + } + } + + return -1; +} + +function attributeValuePossiblyBlank(attribute) { + if (!attribute || !attribute.value) { + return false; + } + const value = attribute.value; + if (value.type === 'Literal') { + return typeof value.value === 'string' && value.value.toLowerCase() === '_blank'; + } + if (value.type === 'JSXExpressionContainer') { + const expr = value.expression; + if (expr.type === 'Literal') { + return typeof expr.value === 'string' && expr.value.toLowerCase() === '_blank'; + } + if (expr.type === 'ConditionalExpression') { + if (expr.alternate.type === 'Literal' && expr.alternate.value && expr.alternate.value.toLowerCase() === '_blank') { + return true; + } + if (expr.consequent.type === 'Literal' && expr.consequent.value && expr.consequent.value.toLowerCase() === '_blank') { + return true; + } + } + } + return false; +} + +function hasExternalLink(node, linkAttribute, warnOnSpreadAttributes, spreadAttributeIndex) { + const linkIndex = findLastIndex(node.attributes, (attr) => attr.name && attr.name.name === linkAttribute); + const foundExternalLink = linkIndex !== -1 && ((attr) => attr.value && attr.value.type === 'Literal' && /^(?:\w+:|\/\/)/.test(attr.value.value))( + node.attributes[linkIndex]); + return foundExternalLink || (warnOnSpreadAttributes && linkIndex < spreadAttributeIndex); +} + +function hasDynamicLink(node, linkAttribute) { + const dynamicLinkIndex = findLastIndex(node.attributes, (attr) => attr.name + && attr.name.name === linkAttribute + && attr.value + && attr.value.type === 'JSXExpressionContainer'); + if (dynamicLinkIndex !== -1) { + return true; + } +} + +function getStringFromValue(value) { + if (value) { + if (value.type === 'Literal') { + return value.value; + } + if (value.type === 'JSXExpressionContainer') { + if (value.expression.type === 'TemplateLiteral') { + return value.expression.quasis[0].value.cooked; + } + const expr = value.expression; + return expr && ( + expr.type === 'ConditionalExpression' + ? [expr.consequent.value, expr.alternate.value] + : expr.value + ); + } + } + return null; +} + +function hasSecureRel(node, allowReferrer, warnOnSpreadAttributes, spreadAttributeIndex) { + const relIndex = findLastIndex(node.attributes, (attr) => (attr.type === 'JSXAttribute' && attr.name.name === 'rel')); + if (relIndex === -1 || (warnOnSpreadAttributes && relIndex < spreadAttributeIndex)) { + return false; + } + + const relAttribute = node.attributes[relIndex]; + const value = getStringFromValue(relAttribute.value); + return [].concat(value).every((item) => { + const tags = typeof item === 'string' ? item.toLowerCase().split(' ') : false; + const noreferrer = tags && tags.indexOf('noreferrer') >= 0; + if (noreferrer) { + return true; + } + const noopener = tags && tags.indexOf('noopener') >= 0; + return allowReferrer && noopener; + }); +} + +const messages = { + noTargetBlankWithoutNoreferrer: 'Using target="_blank" without rel="noreferrer" (which implies rel="noopener") is a security risk in older browsers: see https://mathiasbynens.github.io/rel-noopener/#recommendations', + noTargetBlankWithoutNoopener: 'Using target="_blank" without rel="noreferrer" or rel="noopener" (the former implies the latter and is preferred due to wider support) is a security risk: see https://mathiasbynens.github.io/rel-noopener/#recommendations', +}; + +module.exports = { + meta: { + fixable: 'code', + docs: { + description: 'Disallow `target="_blank"` attribute without `rel="noreferrer"`', + category: 'Best Practices', + recommended: true, + url: docsUrl('jsx-no-target-blank'), + }, + + messages, + + schema: [{ + type: 'object', + properties: { + allowReferrer: { + type: 'boolean', + }, + enforceDynamicLinks: { + enum: ['always', 'never'], + }, + warnOnSpreadAttributes: { + type: 'boolean', + }, + links: { + type: 'boolean', + default: true, + }, + forms: { + type: 'boolean', + default: false, + }, + }, + additionalProperties: false, + }], + }, + + create(context) { + const configuration = Object.assign( + { + allowReferrer: false, + warnOnSpreadAttributes: false, + links: true, + forms: false, + }, + context.options[0] + ); + const allowReferrer = configuration.allowReferrer; + const warnOnSpreadAttributes = configuration.warnOnSpreadAttributes; + const enforceDynamicLinks = configuration.enforceDynamicLinks || 'always'; + const linkComponents = linkComponentsUtil.getLinkComponents(context); + const formComponents = linkComponentsUtil.getFormComponents(context); + + return { + JSXOpeningElement(node) { + const targetIndex = findLastIndex(node.attributes, (attr) => attr.name && attr.name.name === 'target'); + const spreadAttributeIndex = findLastIndex(node.attributes, (attr) => (attr.type === 'JSXSpreadAttribute')); + + if (linkComponents.has(node.name.name)) { + if (!attributeValuePossiblyBlank(node.attributes[targetIndex])) { + const hasSpread = spreadAttributeIndex >= 0; + + if (warnOnSpreadAttributes && hasSpread) { + // continue to check below + } else if ((hasSpread && targetIndex < spreadAttributeIndex) || !hasSpread || !warnOnSpreadAttributes) { + return; + } + } + + const linkAttribute = linkComponents.get(node.name.name); + const hasDangerousLink = hasExternalLink(node, linkAttribute, warnOnSpreadAttributes, spreadAttributeIndex) + || (enforceDynamicLinks === 'always' && hasDynamicLink(node, linkAttribute)); + if (hasDangerousLink && !hasSecureRel(node, allowReferrer, warnOnSpreadAttributes, spreadAttributeIndex)) { + const messageId = allowReferrer ? 'noTargetBlankWithoutNoopener' : 'noTargetBlankWithoutNoreferrer'; + const relValue = allowReferrer ? 'noopener' : 'noreferrer'; + report(context, messages[messageId], messageId, { + node, + fix(fixer) { + // eslint 5 uses `node.attributes`; eslint 6+ uses `node.parent.attributes` + const nodeWithAttrs = node.parent.attributes ? node.parent : node; + // eslint 5 does not provide a `name` property on JSXSpreadElements + const relAttribute = nodeWithAttrs.attributes.find((attr) => attr.name && attr.name.name === 'rel'); + + if (targetIndex < spreadAttributeIndex || (spreadAttributeIndex >= 0 && !relAttribute)) { + return null; + } + + if (!relAttribute) { + return fixer.insertTextAfter(nodeWithAttrs.attributes.slice(-1)[0], ` rel="${relValue}"`); + } + + if (!relAttribute.value) { + return fixer.insertTextAfter(relAttribute, `="${relValue}"`); + } + + if (relAttribute.value.type === 'Literal') { + const parts = relAttribute.value.value + .split('noreferrer') + .filter(Boolean); + return fixer.replaceText(relAttribute.value, `"${parts.concat('noreferrer').join(' ')}"`); + } + + if (relAttribute.value.type === 'JSXExpressionContainer') { + if (relAttribute.value.expression.type === 'Literal') { + if (typeof relAttribute.value.expression.value === 'string') { + const parts = relAttribute.value.expression.value + .split('noreferrer') + .filter(Boolean); + return fixer.replaceText(relAttribute.value.expression, `"${parts.concat('noreferrer').join(' ')}"`); + } + + // for undefined, boolean, number, symbol, bigint, and null + return fixer.replaceText(relAttribute.value, '"noreferrer"'); + } + } + + return null; + }, + }); + } + } + if (formComponents.has(node.name.name)) { + if (!attributeValuePossiblyBlank(node.attributes[targetIndex])) { + const hasSpread = spreadAttributeIndex >= 0; + + if (warnOnSpreadAttributes && hasSpread) { + // continue to check below + } else if ( + (hasSpread && targetIndex < spreadAttributeIndex) + || !hasSpread + || !warnOnSpreadAttributes + ) { + return; + } + } + + if (!configuration.forms || hasSecureRel(node)) { + return; + } + + const formAttribute = formComponents.get(node.name.name); + + if ( + hasExternalLink(node, formAttribute) + || (enforceDynamicLinks === 'always' && hasDynamicLink(node, formAttribute)) + ) { + const messageId = allowReferrer ? 'noTargetBlankWithoutNoopener' : 'noTargetBlankWithoutNoreferrer'; + report(context, messages[messageId], messageId, { + node, + }); + } + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-no-undef.js b/node_modules/eslint-plugin-react/lib/rules/jsx-no-undef.js new file mode 100644 index 000000000..d7a42ccff --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-no-undef.js @@ -0,0 +1,115 @@ +/** + * @fileoverview Disallow undeclared variables in JSX + * @author Yannick Croissant + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const jsxUtil = require('../util/jsx'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + undefined: '\'{{identifier}}\' is not defined.', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow undeclared variables in JSX', + category: 'Possible Errors', + recommended: true, + url: docsUrl('jsx-no-undef'), + }, + + messages, + + schema: [{ + type: 'object', + properties: { + allowGlobals: { + type: 'boolean', + }, + }, + additionalProperties: false, + }], + }, + + create(context) { + const config = context.options[0] || {}; + const allowGlobals = config.allowGlobals || false; + + /** + * Compare an identifier with the variables declared in the scope + * @param {ASTNode} node - Identifier or JSXIdentifier node + * @returns {void} + */ + function checkIdentifierInJSX(node) { + let scope = context.getScope(); + const sourceCode = context.getSourceCode(); + const sourceType = sourceCode.ast.sourceType; + const scopeUpperBound = !allowGlobals && sourceType === 'module' ? 'module' : 'global'; + let variables = scope.variables; + let i; + let len; + + // Ignore 'this' keyword (also maked as JSXIdentifier when used in JSX) + if (node.name === 'this') { + return; + } + + while (scope.type !== scopeUpperBound && scope.type !== 'global') { + scope = scope.upper; + variables = scope.variables.concat(variables); + } + if (scope.childScopes.length) { + variables = scope.childScopes[0].variables.concat(variables); + // Temporary fix for babel-eslint + if (scope.childScopes[0].childScopes.length) { + variables = scope.childScopes[0].childScopes[0].variables.concat(variables); + } + } + + for (i = 0, len = variables.length; i < len; i++) { + if (variables[i].name === node.name) { + return; + } + } + + report(context, messages.undefined, 'undefined', { + node, + data: { + identifier: node.name, + }, + }); + } + + return { + JSXOpeningElement(node) { + switch (node.name.type) { + case 'JSXIdentifier': + if (jsxUtil.isDOMComponent(node)) { + return; + } + node = node.name; + break; + case 'JSXMemberExpression': + node = node.name; + do { + node = node.object; + } while (node && node.type !== 'JSXIdentifier'); + break; + case 'JSXNamespacedName': + return; + default: + break; + } + checkIdentifierInJSX(node); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-no-useless-fragment.js b/node_modules/eslint-plugin-react/lib/rules/jsx-no-useless-fragment.js new file mode 100644 index 000000000..56c6baea7 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-no-useless-fragment.js @@ -0,0 +1,249 @@ +/** + * @fileoverview Disallow useless fragments + */ + +'use strict'; + +const arrayIncludes = require('array-includes'); + +const pragmaUtil = require('../util/pragma'); +const jsxUtil = require('../util/jsx'); +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +function isJSXText(node) { + return !!node && (node.type === 'JSXText' || node.type === 'Literal'); +} + +/** + * @param {string} text + * @returns {boolean} + */ +function isOnlyWhitespace(text) { + return text.trim().length === 0; +} + +/** + * @param {ASTNode} node + * @returns {boolean} + */ +function isNonspaceJSXTextOrJSXCurly(node) { + return (isJSXText(node) && !isOnlyWhitespace(node.raw)) || node.type === 'JSXExpressionContainer'; +} + +/** + * Somehow fragment like this is useful: ee eeee eeee ...} /> + * @param {ASTNode} node + * @returns {boolean} + */ +function isFragmentWithOnlyTextAndIsNotChild(node) { + return node.children.length === 1 + && isJSXText(node.children[0]) + && !(node.parent.type === 'JSXElement' || node.parent.type === 'JSXFragment'); +} + +/** + * @param {string} text + * @returns {string} + */ +function trimLikeReact(text) { + const leadingSpaces = /^\s*/.exec(text)[0]; + const trailingSpaces = /\s*$/.exec(text)[0]; + + const start = arrayIncludes(leadingSpaces, '\n') ? leadingSpaces.length : 0; + const end = arrayIncludes(trailingSpaces, '\n') ? text.length - trailingSpaces.length : text.length; + + return text.slice(start, end); +} + +/** + * Test if node is like `_` + * @param {JSXElement} node + * @returns {boolean} + */ +function isKeyedElement(node) { + return node.type === 'JSXElement' + && node.openingElement.attributes + && node.openingElement.attributes.some(jsxUtil.isJSXAttributeKey); +} + +/** + * @param {ASTNode} node + * @returns {boolean} + */ +function containsCallExpression(node) { + return node + && node.type === 'JSXExpressionContainer' + && node.expression + && node.expression.type === 'CallExpression'; +} + +const messages = { + NeedsMoreChildren: 'Fragments should contain more than one child - otherwise, there’s no need for a Fragment at all.', + ChildOfHtmlElement: 'Passing a fragment to an HTML element is useless.', +}; + +module.exports = { + meta: { + type: 'suggestion', + fixable: 'code', + docs: { + description: 'Disallow unnecessary fragments', + category: 'Possible Errors', + recommended: false, + url: docsUrl('jsx-no-useless-fragment'), + }, + messages, + }, + + create(context) { + const config = context.options[0] || {}; + const allowExpressions = config.allowExpressions || false; + + const reactPragma = pragmaUtil.getFromContext(context); + const fragmentPragma = pragmaUtil.getFragmentFromContext(context); + + /** + * Test whether a node is an padding spaces trimmed by react runtime. + * @param {ASTNode} node + * @returns {boolean} + */ + function isPaddingSpaces(node) { + return isJSXText(node) + && isOnlyWhitespace(node.raw) + && arrayIncludes(node.raw, '\n'); + } + + function isFragmentWithSingleExpression(node) { + const children = node && node.children.filter((child) => !isPaddingSpaces(child)); + return ( + children + && children.length === 1 + && children[0].type === 'JSXExpressionContainer' + ); + } + + /** + * Test whether a JSXElement has less than two children, excluding paddings spaces. + * @param {JSXElement|JSXFragment} node + * @returns {boolean} + */ + function hasLessThanTwoChildren(node) { + if (!node || !node.children) { + return true; + } + + /** @type {ASTNode[]} */ + const nonPaddingChildren = node.children.filter( + (child) => !isPaddingSpaces(child) + ); + + if (nonPaddingChildren.length < 2) { + return !containsCallExpression(nonPaddingChildren[0]); + } + } + + /** + * @param {JSXElement|JSXFragment} node + * @returns {boolean} + */ + function isChildOfHtmlElement(node) { + return node.parent.type === 'JSXElement' + && node.parent.openingElement.name.type === 'JSXIdentifier' + && /^[a-z]+$/.test(node.parent.openingElement.name.name); + } + + /** + * @param {JSXElement|JSXFragment} node + * @return {boolean} + */ + function isChildOfComponentElement(node) { + return node.parent.type === 'JSXElement' + && !isChildOfHtmlElement(node) + && !jsxUtil.isFragment(node.parent, reactPragma, fragmentPragma); + } + + /** + * @param {ASTNode} node + * @returns {boolean} + */ + function canFix(node) { + // Not safe to fix fragments without a jsx parent. + if (!(node.parent.type === 'JSXElement' || node.parent.type === 'JSXFragment')) { + // const a = <> + if (node.children.length === 0) { + return false; + } + + // const a = <>cat {meow} + if (node.children.some(isNonspaceJSXTextOrJSXCurly)) { + return false; + } + } + + // Not safe to fix `<>foo` because `Eeee` might require its children be a ReactElement. + if (isChildOfComponentElement(node)) { + return false; + } + + // old TS parser can't handle this one + if (node.type === 'JSXFragment' && (!node.openingFragment || !node.closingFragment)) { + return false; + } + + return true; + } + + /** + * @param {ASTNode} node + * @returns {Function | undefined} + */ + function getFix(node) { + if (!canFix(node)) { + return undefined; + } + + return function fix(fixer) { + const opener = node.type === 'JSXFragment' ? node.openingFragment : node.openingElement; + const closer = node.type === 'JSXFragment' ? node.closingFragment : node.closingElement; + + const childrenText = opener.selfClosing ? '' : context.getSourceCode().getText().slice(opener.range[1], closer.range[0]); + + return fixer.replaceText(node, trimLikeReact(childrenText)); + }; + } + + function checkNode(node) { + if (isKeyedElement(node)) { + return; + } + + if ( + hasLessThanTwoChildren(node) + && !isFragmentWithOnlyTextAndIsNotChild(node) + && !(allowExpressions && isFragmentWithSingleExpression(node)) + ) { + report(context, messages.NeedsMoreChildren, 'NeedsMoreChildren', { + node, + fix: getFix(node), + }); + } + + if (isChildOfHtmlElement(node)) { + report(context, messages.ChildOfHtmlElement, 'ChildOfHtmlElement', { + node, + fix: getFix(node), + }); + } + } + + return { + JSXElement(node) { + if (jsxUtil.isFragment(node, reactPragma, fragmentPragma)) { + checkNode(node); + } + }, + JSXFragment: checkNode, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-one-expression-per-line.js b/node_modules/eslint-plugin-react/lib/rules/jsx-one-expression-per-line.js new file mode 100644 index 000000000..6d0d1575d --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-one-expression-per-line.js @@ -0,0 +1,233 @@ +/** + * @fileoverview Limit to one expression per line in JSX + * @author Mark Ivan Allen + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const jsxUtil = require('../util/jsx'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const optionDefaults = { + allow: 'none', +}; + +const messages = { + moveToNewLine: '`{{descriptor}}` must be placed on a new line', +}; + +module.exports = { + meta: { + docs: { + description: 'Require one JSX element per line', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-one-expression-per-line'), + }, + fixable: 'whitespace', + + messages, + + schema: [ + { + type: 'object', + properties: { + allow: { + enum: ['none', 'literal', 'single-child'], + }, + }, + default: optionDefaults, + additionalProperties: false, + }, + ], + }, + + create(context) { + const options = Object.assign({}, optionDefaults, context.options[0]); + + function nodeKey(node) { + return `${node.loc.start.line},${node.loc.start.column}`; + } + + function nodeDescriptor(n) { + return n.openingElement ? n.openingElement.name.name : context.getSourceCode().getText(n).replace(/\n/g, ''); + } + + function handleJSX(node) { + const children = node.children; + + if (!children || !children.length) { + return; + } + + const openingElement = node.openingElement || node.openingFragment; + const closingElement = node.closingElement || node.closingFragment; + const openingElementStartLine = openingElement.loc.start.line; + const openingElementEndLine = openingElement.loc.end.line; + const closingElementStartLine = closingElement.loc.start.line; + const closingElementEndLine = closingElement.loc.end.line; + + if (children.length === 1) { + const child = children[0]; + if ( + openingElementStartLine === openingElementEndLine + && openingElementEndLine === closingElementStartLine + && closingElementStartLine === closingElementEndLine + && closingElementEndLine === child.loc.start.line + && child.loc.start.line === child.loc.end.line + ) { + if ( + options.allow === 'single-child' + || (options.allow === 'literal' && (child.type === 'Literal' || child.type === 'JSXText')) + ) { + return; + } + } + } + + const childrenGroupedByLine = {}; + const fixDetailsByNode = {}; + + children.forEach((child) => { + let countNewLinesBeforeContent = 0; + let countNewLinesAfterContent = 0; + + if (child.type === 'Literal' || child.type === 'JSXText') { + if (jsxUtil.isWhiteSpaces(child.raw)) { + return; + } + + countNewLinesBeforeContent = (child.raw.match(/^\s*\n/g) || []).length; + countNewLinesAfterContent = (child.raw.match(/\n\s*$/g) || []).length; + } + + const startLine = child.loc.start.line + countNewLinesBeforeContent; + const endLine = child.loc.end.line - countNewLinesAfterContent; + + if (startLine === endLine) { + if (!childrenGroupedByLine[startLine]) { + childrenGroupedByLine[startLine] = []; + } + childrenGroupedByLine[startLine].push(child); + } else { + if (!childrenGroupedByLine[startLine]) { + childrenGroupedByLine[startLine] = []; + } + childrenGroupedByLine[startLine].push(child); + if (!childrenGroupedByLine[endLine]) { + childrenGroupedByLine[endLine] = []; + } + childrenGroupedByLine[endLine].push(child); + } + }); + + Object.keys(childrenGroupedByLine).forEach((_line) => { + const line = parseInt(_line, 10); + const firstIndex = 0; + const lastIndex = childrenGroupedByLine[line].length - 1; + + childrenGroupedByLine[line].forEach((child, i) => { + let prevChild; + let nextChild; + + if (i === firstIndex) { + if (line === openingElementEndLine) { + prevChild = openingElement; + } + } else { + prevChild = childrenGroupedByLine[line][i - 1]; + } + + if (i === lastIndex) { + if (line === closingElementStartLine) { + nextChild = closingElement; + } + } else { + // We don't need to append a trailing because the next child will prepend a leading. + // nextChild = childrenGroupedByLine[line][i + 1]; + } + + function spaceBetweenPrev() { + return ((prevChild.type === 'Literal' || prevChild.type === 'JSXText') && / $/.test(prevChild.raw)) + || ((child.type === 'Literal' || child.type === 'JSXText') && /^ /.test(child.raw)) + || context.getSourceCode().isSpaceBetweenTokens(prevChild, child); + } + + function spaceBetweenNext() { + return ((nextChild.type === 'Literal' || nextChild.type === 'JSXText') && /^ /.test(nextChild.raw)) + || ((child.type === 'Literal' || child.type === 'JSXText') && / $/.test(child.raw)) + || context.getSourceCode().isSpaceBetweenTokens(child, nextChild); + } + + if (!prevChild && !nextChild) { + return; + } + + const source = context.getSourceCode().getText(child); + const leadingSpace = !!(prevChild && spaceBetweenPrev()); + const trailingSpace = !!(nextChild && spaceBetweenNext()); + const leadingNewLine = !!prevChild; + const trailingNewLine = !!nextChild; + + const key = nodeKey(child); + + if (!fixDetailsByNode[key]) { + fixDetailsByNode[key] = { + node: child, + source, + descriptor: nodeDescriptor(child), + }; + } + + if (leadingSpace) { + fixDetailsByNode[key].leadingSpace = true; + } + if (leadingNewLine) { + fixDetailsByNode[key].leadingNewLine = true; + } + if (trailingNewLine) { + fixDetailsByNode[key].trailingNewLine = true; + } + if (trailingSpace) { + fixDetailsByNode[key].trailingSpace = true; + } + }); + }); + + Object.keys(fixDetailsByNode).forEach((key) => { + const details = fixDetailsByNode[key]; + + const nodeToReport = details.node; + const descriptor = details.descriptor; + const source = details.source.replace(/(^ +| +(?=\n)*$)/g, ''); + + const leadingSpaceString = details.leadingSpace ? '\n{\' \'}' : ''; + const trailingSpaceString = details.trailingSpace ? '{\' \'}\n' : ''; + const leadingNewLineString = details.leadingNewLine ? '\n' : ''; + const trailingNewLineString = details.trailingNewLine ? '\n' : ''; + + const replaceText = `${leadingSpaceString}${leadingNewLineString}${source}${trailingNewLineString}${trailingSpaceString}`; + + report(context, messages.moveToNewLine, 'moveToNewLine', { + node: nodeToReport, + data: { + descriptor, + }, + fix(fixer) { + return fixer.replaceText(nodeToReport, replaceText); + }, + }); + }); + } + + return { + JSXElement: handleJSX, + JSXFragment: handleJSX, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-pascal-case.js b/node_modules/eslint-plugin-react/lib/rules/jsx-pascal-case.js new file mode 100644 index 000000000..a1bb48116 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-pascal-case.js @@ -0,0 +1,163 @@ +/** + * @fileoverview Enforce PascalCase for user-defined JSX components + * @author Jake Marsh + */ + +'use strict'; + +const elementType = require('jsx-ast-utils/elementType'); +const minimatch = require('minimatch'); +const docsUrl = require('../util/docsUrl'); +const jsxUtil = require('../util/jsx'); +const report = require('../util/report'); + +function testDigit(char) { + const charCode = char.charCodeAt(0); + return charCode >= 48 && charCode <= 57; +} + +function testUpperCase(char) { + const upperCase = char.toUpperCase(); + return char === upperCase && upperCase !== char.toLowerCase(); +} + +function testLowerCase(char) { + const lowerCase = char.toLowerCase(); + return char === lowerCase && lowerCase !== char.toUpperCase(); +} + +function testPascalCase(name) { + if (!testUpperCase(name.charAt(0))) { + return false; + } + const anyNonAlphaNumeric = Array.prototype.some.call( + name.slice(1), + (char) => char.toLowerCase() === char.toUpperCase() && !testDigit(char) + ); + if (anyNonAlphaNumeric) { + return false; + } + return Array.prototype.some.call( + name.slice(1), + (char) => testLowerCase(char) || testDigit(char) + ); +} + +function testAllCaps(name) { + const firstChar = name.charAt(0); + if (!(testUpperCase(firstChar) || testDigit(firstChar))) { + return false; + } + for (let i = 1; i < name.length - 1; i += 1) { + const char = name.charAt(i); + if (!(testUpperCase(char) || testDigit(char) || char === '_')) { + return false; + } + } + const lastChar = name.charAt(name.length - 1); + if (!(testUpperCase(lastChar) || testDigit(lastChar))) { + return false; + } + return true; +} + +function ignoreCheck(ignore, name) { + return ignore.some( + (entry) => name === entry || minimatch(name, entry, { noglobstar: true }) + ); +} + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + usePascalCase: 'Imported JSX component {{name}} must be in PascalCase', + usePascalOrSnakeCase: 'Imported JSX component {{name}} must be in PascalCase or SCREAMING_SNAKE_CASE', +}; + +module.exports = { + meta: { + docs: { + description: 'Enforce PascalCase for user-defined JSX components', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-pascal-case'), + }, + + messages, + + schema: [{ + type: 'object', + properties: { + allowAllCaps: { + type: 'boolean', + }, + allowLeadingUnderscore: { + type: 'boolean', + }, + allowNamespace: { + type: 'boolean', + }, + ignore: { + items: [ + { + type: 'string', + }, + ], + minItems: 0, + type: 'array', + uniqueItems: true, + }, + }, + additionalProperties: false, + }], + }, + + create(context) { + const configuration = context.options[0] || {}; + const allowAllCaps = configuration.allowAllCaps || false; + const allowLeadingUnderscore = configuration.allowLeadingUnderscore || false; + const allowNamespace = configuration.allowNamespace || false; + const ignore = configuration.ignore || []; + + return { + JSXOpeningElement(node) { + const isCompatTag = jsxUtil.isDOMComponent(node); + if (isCompatTag) return undefined; + + const name = elementType(node); + let checkNames = [name]; + let index = 0; + + if (name.lastIndexOf(':') > -1) { + checkNames = name.split(':'); + } else if (name.lastIndexOf('.') > -1) { + checkNames = name.split('.'); + } + + do { + const splitName = checkNames[index]; + if (splitName.length === 1) return undefined; + const isIgnored = ignoreCheck(ignore, splitName); + + const checkName = allowLeadingUnderscore && splitName.startsWith('_') ? splitName.slice(1) : splitName; + const isPascalCase = testPascalCase(checkName); + const isAllowedAllCaps = allowAllCaps && testAllCaps(checkName); + + if (!isPascalCase && !isAllowedAllCaps && !isIgnored) { + const messageId = allowAllCaps ? 'usePascalOrSnakeCase' : 'usePascalCase'; + report(context, messages[messageId], messageId, { + node, + data: { + name: splitName, + }, + }); + break; + } + index += 1; + } while (index < checkNames.length && !allowNamespace); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-props-no-multi-spaces.js b/node_modules/eslint-plugin-react/lib/rules/jsx-props-no-multi-spaces.js new file mode 100644 index 000000000..b0d34d59d --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-props-no-multi-spaces.js @@ -0,0 +1,134 @@ +/** + * @fileoverview Disallow multiple spaces between inline JSX props + * @author Adrian Moennich + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + noLineGap: 'Expected no line gap between “{{prop1}}” and “{{prop2}}”', + onlyOneSpace: 'Expected only one space between “{{prop1}}” and “{{prop2}}”', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow multiple spaces between inline JSX props', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-props-no-multi-spaces'), + }, + fixable: 'code', + + messages, + + schema: [], + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + function getPropName(propNode) { + switch (propNode.type) { + case 'JSXSpreadAttribute': + return context.getSourceCode().getText(propNode.argument); + case 'JSXIdentifier': + return propNode.name; + case 'JSXMemberExpression': + return `${getPropName(propNode.object)}.${propNode.property.name}`; + default: + return propNode.name + ? propNode.name.name + : `${context.getSourceCode().getText(propNode.object)}.${propNode.property.name}`; // needed for typescript-eslint parser + } + } + + // First and second must be adjacent nodes + function hasEmptyLines(first, second) { + const comments = sourceCode.getCommentsBefore ? sourceCode.getCommentsBefore(second) : []; + const nodes = [].concat(first, comments, second); + + for (let i = 1; i < nodes.length; i += 1) { + const prev = nodes[i - 1]; + const curr = nodes[i]; + if (curr.loc.start.line - prev.loc.end.line >= 2) { + return true; + } + } + + return false; + } + + function checkSpacing(prev, node) { + if (hasEmptyLines(prev, node)) { + report(context, messages.noLineGap, 'noLineGap', { + node, + data: { + prop1: getPropName(prev), + prop2: getPropName(node), + }, + }); + } + + if (prev.loc.end.line !== node.loc.end.line) { + return; + } + + const between = context.getSourceCode().text.slice(prev.range[1], node.range[0]); + + if (between !== ' ') { + report(context, messages.onlyOneSpace, 'onlyOneSpace', { + node, + data: { + prop1: getPropName(prev), + prop2: getPropName(node), + }, + fix(fixer) { + return fixer.replaceTextRange([prev.range[1], node.range[0]], ' '); + }, + }); + } + } + + function containsGenericType(node) { + const containsTypeParams = typeof node.typeParameters !== 'undefined'; + return containsTypeParams && node.typeParameters.type === 'TSTypeParameterInstantiation'; + } + + function getGenericNode(node) { + const name = node.name; + if (containsGenericType(node)) { + const type = node.typeParameters; + + return Object.assign( + {}, + node, + { + range: [ + name.range[0], + type.range[1], + ], + } + ); + } + + return name; + } + + return { + JSXOpeningElement(node) { + node.attributes.reduce((prev, prop) => { + checkSpacing(prev, prop); + return prop; + }, getGenericNode(node)); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-props-no-spreading.js b/node_modules/eslint-plugin-react/lib/rules/jsx-props-no-spreading.js new file mode 100644 index 000000000..acbdea797 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-props-no-spreading.js @@ -0,0 +1,141 @@ +/** + * @fileoverview Prevent JSX prop spreading + * @author Ashish Gambhir + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Constants +// ------------------------------------------------------------------------------ + +const OPTIONS = { ignore: 'ignore', enforce: 'enforce' }; +const DEFAULTS = { + html: OPTIONS.enforce, + custom: OPTIONS.enforce, + explicitSpread: OPTIONS.enforce, + exceptions: [], +}; + +const isException = (tag, allExceptions) => allExceptions.indexOf(tag) !== -1; +const isProperty = (property) => property.type === 'Property'; +const getTagNameFromMemberExpression = (node) => { + if (node.property.parent) { + return `${node.property.parent.object.name}.${node.property.name}`; + } + // for eslint 3 + return `${node.object.name}.${node.property.name}`; +}; + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + noSpreading: 'Prop spreading is forbidden', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow JSX prop spreading', + category: 'Best Practices', + recommended: false, + url: docsUrl('jsx-props-no-spreading'), + }, + + messages, + + schema: [{ + allOf: [{ + type: 'object', + properties: { + html: { + enum: [OPTIONS.enforce, OPTIONS.ignore], + }, + custom: { + enum: [OPTIONS.enforce, OPTIONS.ignore], + }, + exceptions: { + type: 'array', + items: { + type: 'string', + uniqueItems: true, + }, + }, + }, + }, { + not: { + type: 'object', + required: ['html', 'custom'], + properties: { + html: { + enum: [OPTIONS.ignore], + }, + custom: { + enum: [OPTIONS.ignore], + }, + exceptions: { + type: 'array', + minItems: 0, + maxItems: 0, + }, + }, + }, + }], + }], + }, + + create(context) { + const configuration = context.options[0] || {}; + const ignoreHtmlTags = (configuration.html || DEFAULTS.html) === OPTIONS.ignore; + const ignoreCustomTags = (configuration.custom || DEFAULTS.custom) === OPTIONS.ignore; + const ignoreExplicitSpread = (configuration.explicitSpread || DEFAULTS.explicitSpread) === OPTIONS.ignore; + const exceptions = configuration.exceptions || DEFAULTS.exceptions; + return { + JSXSpreadAttribute(node) { + const jsxOpeningElement = node.parent.name; + const type = jsxOpeningElement.type; + + let tagName; + if (type === 'JSXIdentifier') { + tagName = jsxOpeningElement.name; + } else if (type === 'JSXMemberExpression') { + tagName = getTagNameFromMemberExpression(jsxOpeningElement); + } else { + tagName = undefined; + } + + const isHTMLTag = tagName && tagName[0] !== tagName[0].toUpperCase(); + const isCustomTag = tagName && (tagName[0] === tagName[0].toUpperCase() || tagName.includes('.')); + if ( + isHTMLTag + && ((ignoreHtmlTags && !isException(tagName, exceptions)) + || (!ignoreHtmlTags && isException(tagName, exceptions))) + ) { + return; + } + if ( + isCustomTag + && ((ignoreCustomTags && !isException(tagName, exceptions)) + || (!ignoreCustomTags && isException(tagName, exceptions))) + ) { + return; + } + if ( + ignoreExplicitSpread + && node.argument.type === 'ObjectExpression' + && node.argument.properties.every(isProperty) + ) { + return; + } + report(context, messages.noSpreading, 'noSpreading', { + node, + }); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-sort-default-props.js b/node_modules/eslint-plugin-react/lib/rules/jsx-sort-default-props.js new file mode 100644 index 000000000..f7062b81c --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-sort-default-props.js @@ -0,0 +1,173 @@ +/** + * @fileoverview Enforce default props alphabetical sorting + * @author Vladimir Kattsov + */ + +'use strict'; + +const variableUtil = require('../util/variable'); +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + propsNotSorted: 'Default prop types declarations should be sorted alphabetically', +}; + +module.exports = { + meta: { + docs: { + description: 'Enforce defaultProps declarations alphabetical sorting', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-sort-default-props'), + }, + // fixable: 'code', + + messages, + + schema: [{ + type: 'object', + properties: { + ignoreCase: { + type: 'boolean', + }, + }, + additionalProperties: false, + }], + }, + + create(context) { + const configuration = context.options[0] || {}; + const ignoreCase = configuration.ignoreCase || false; + + /** + * Get properties name + * @param {Object} node - Property. + * @returns {String} Property name. + */ + function getPropertyName(node) { + if (node.key || ['MethodDefinition', 'Property'].indexOf(node.type) !== -1) { + return node.key.name; + } + if (node.type === 'MemberExpression') { + return node.property.name; + // Special case for class properties + // (babel-eslint@5 does not expose property name so we have to rely on tokens) + } + if (node.type === 'ClassProperty') { + const tokens = context.getSourceCode().getFirstTokens(node, 2); + return tokens[1] && tokens[1].type === 'Identifier' ? tokens[1].value : tokens[0].value; + } + return ''; + } + + /** + * Checks if the Identifier node passed in looks like a defaultProps declaration. + * @param {ASTNode} node The node to check. Must be an Identifier node. + * @returns {Boolean} `true` if the node is a defaultProps declaration, `false` if not + */ + function isDefaultPropsDeclaration(node) { + const propName = getPropertyName(node); + return (propName === 'defaultProps' || propName === 'getDefaultProps'); + } + + function getKey(node) { + return context.getSourceCode().getText(node.key || node.argument); + } + + /** + * Find a variable by name in the current scope. + * @param {string} name Name of the variable to look for. + * @returns {ASTNode|null} Return null if the variable could not be found, ASTNode otherwise. + */ + function findVariableByName(name) { + const variable = variableUtil.variablesInScope(context).find((item) => item.name === name); + + if (!variable || !variable.defs[0] || !variable.defs[0].node) { + return null; + } + + if (variable.defs[0].node.type === 'TypeAlias') { + return variable.defs[0].node.right; + } + + return variable.defs[0].node.init; + } + + /** + * Checks if defaultProps declarations are sorted + * @param {Array} declarations The array of AST nodes being checked. + * @returns {void} + */ + function checkSorted(declarations) { + // function fix(fixer) { + // return propTypesSortUtil.fixPropTypesSort(fixer, context, declarations, ignoreCase); + // } + + declarations.reduce((prev, curr, idx, decls) => { + if (/Spread(?:Property|Element)$/.test(curr.type)) { + return decls[idx + 1]; + } + + let prevPropName = getKey(prev); + let currentPropName = getKey(curr); + + if (ignoreCase) { + prevPropName = prevPropName.toLowerCase(); + currentPropName = currentPropName.toLowerCase(); + } + + if (currentPropName < prevPropName) { + report(context, messages.propsNotSorted, 'propsNotSorted', { + node: curr, + // fix + }); + + return prev; + } + + return curr; + }, declarations[0]); + } + + function checkNode(node) { + if (!node) { + return; + } + if (node.type === 'ObjectExpression') { + checkSorted(node.properties); + } else if (node.type === 'Identifier') { + const propTypesObject = findVariableByName(node.name); + if (propTypesObject && propTypesObject.properties) { + checkSorted(propTypesObject.properties); + } + } + } + + // -------------------------------------------------------------------------- + // Public API + // -------------------------------------------------------------------------- + + return { + 'ClassProperty, PropertyDefinition'(node) { + if (!isDefaultPropsDeclaration(node)) { + return; + } + + checkNode(node.value); + }, + + MemberExpression(node) { + if (!isDefaultPropsDeclaration(node)) { + return; + } + + checkNode(node.parent.right); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-sort-props.js b/node_modules/eslint-plugin-react/lib/rules/jsx-sort-props.js new file mode 100644 index 000000000..74929cc60 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-sort-props.js @@ -0,0 +1,528 @@ +/** + * @fileoverview Enforce props alphabetical sorting + * @author Ilya Volodin, Yannick Croissant + */ + +'use strict'; + +const propName = require('jsx-ast-utils/propName'); +const includes = require('array-includes'); +const docsUrl = require('../util/docsUrl'); +const jsxUtil = require('../util/jsx'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +function isCallbackPropName(name) { + return /^on[A-Z]/.test(name); +} + +function isMultilineProp(node) { + return node.loc.start.line !== node.loc.end.line; +} + +const messages = { + noUnreservedProps: 'A customized reserved first list must only contain a subset of React reserved props. Remove: {{unreservedWords}}', + listIsEmpty: 'A customized reserved first list must not be empty', + listReservedPropsFirst: 'Reserved props must be listed before all other props', + listCallbacksLast: 'Callbacks must be listed after all other props', + listShorthandFirst: 'Shorthand props must be listed before all other props', + listShorthandLast: 'Shorthand props must be listed after all other props', + listMultilineFirst: 'Multiline props must be listed before all other props', + listMultilineLast: 'Multiline props must be listed after all other props', + sortPropsByAlpha: 'Props should be sorted alphabetically', +}; + +const RESERVED_PROPS_LIST = [ + 'children', + 'dangerouslySetInnerHTML', + 'key', + 'ref', +]; + +function isReservedPropName(name, list) { + return list.indexOf(name) >= 0; +} + +let attributeMap; +// attributeMap = { end: endrange, hasComment: true||false if comment in between nodes exists, it needs to be sorted to end } + +function shouldSortToEnd(node) { + const attr = attributeMap.get(node); + return !!attr && !!attr.hasComment; +} + +function contextCompare(a, b, options) { + let aProp = propName(a); + let bProp = propName(b); + + const aSortToEnd = shouldSortToEnd(a); + const bSortToEnd = shouldSortToEnd(b); + if (aSortToEnd && !bSortToEnd) { + return 1; + } + if (!aSortToEnd && bSortToEnd) { + return -1; + } + + if (options.reservedFirst) { + const aIsReserved = isReservedPropName(aProp, options.reservedList); + const bIsReserved = isReservedPropName(bProp, options.reservedList); + if (aIsReserved && !bIsReserved) { + return -1; + } + if (!aIsReserved && bIsReserved) { + return 1; + } + } + + if (options.callbacksLast) { + const aIsCallback = isCallbackPropName(aProp); + const bIsCallback = isCallbackPropName(bProp); + if (aIsCallback && !bIsCallback) { + return 1; + } + if (!aIsCallback && bIsCallback) { + return -1; + } + } + + if (options.shorthandFirst || options.shorthandLast) { + const shorthandSign = options.shorthandFirst ? -1 : 1; + if (!a.value && b.value) { + return shorthandSign; + } + if (a.value && !b.value) { + return -shorthandSign; + } + } + + if (options.multiline !== 'ignore') { + const multilineSign = options.multiline === 'first' ? -1 : 1; + const aIsMultiline = isMultilineProp(a); + const bIsMultiline = isMultilineProp(b); + if (aIsMultiline && !bIsMultiline) { + return multilineSign; + } + if (!aIsMultiline && bIsMultiline) { + return -multilineSign; + } + } + + if (options.noSortAlphabetically) { + return 0; + } + + const actualLocale = options.locale === 'auto' ? undefined : options.locale; + + if (options.ignoreCase) { + aProp = aProp.toLowerCase(); + bProp = bProp.toLowerCase(); + return aProp.localeCompare(bProp, actualLocale); + } + if (aProp === bProp) { + return 0; + } + if (options.locale === 'auto') { + return aProp < bProp ? -1 : 1; + } + return aProp.localeCompare(bProp, actualLocale); +} + +/** + * Create an array of arrays where each subarray is composed of attributes + * that are considered sortable. + * @param {Array} attributes + * @param {Object} context The context of the rule + * @return {Array>} + */ +function getGroupsOfSortableAttributes(attributes, context) { + const sourceCode = context.getSourceCode(); + + const sortableAttributeGroups = []; + let groupCount = 0; + function addtoSortableAttributeGroups(attribute) { + sortableAttributeGroups[groupCount - 1].push(attribute); + } + + for (let i = 0; i < attributes.length; i++) { + const attribute = attributes[i]; + const nextAttribute = attributes[i + 1]; + const attributeline = attribute.loc.start.line; + let comment = []; + try { + comment = sourceCode.getCommentsAfter(attribute); + } catch (e) { /**/ } + const lastAttr = attributes[i - 1]; + const attrIsSpread = attribute.type === 'JSXSpreadAttribute'; + + // If we have no groups or if the last attribute was JSXSpreadAttribute + // then we start a new group. Append attributes to the group until we + // come across another JSXSpreadAttribute or exhaust the array. + if ( + !lastAttr + || (lastAttr.type === 'JSXSpreadAttribute' && !attrIsSpread) + ) { + groupCount += 1; + sortableAttributeGroups[groupCount - 1] = []; + } + if (!attrIsSpread) { + if (comment.length === 0) { + attributeMap.set(attribute, { end: attribute.range[1], hasComment: false }); + addtoSortableAttributeGroups(attribute); + } else { + const firstComment = comment[0]; + const commentline = firstComment.loc.start.line; + if (comment.length === 1) { + if (attributeline + 1 === commentline && nextAttribute) { + attributeMap.set(attribute, { end: nextAttribute.range[1], hasComment: true }); + addtoSortableAttributeGroups(attribute); + i += 1; + } else if (attributeline === commentline) { + if (firstComment.type === 'Block' && nextAttribute) { + attributeMap.set(attribute, { end: nextAttribute.range[1], hasComment: true }); + i += 1; + } else if (firstComment.type === 'Block') { + attributeMap.set(attribute, { end: firstComment.range[1], hasComment: true }); + } else { + attributeMap.set(attribute, { end: firstComment.range[1], hasComment: false }); + } + addtoSortableAttributeGroups(attribute); + } + } else if (comment.length > 1 && attributeline + 1 === comment[1].loc.start.line && nextAttribute) { + const commentNextAttribute = sourceCode.getCommentsAfter(nextAttribute); + attributeMap.set(attribute, { end: nextAttribute.range[1], hasComment: true }); + if ( + commentNextAttribute.length === 1 + && nextAttribute.loc.start.line === commentNextAttribute[0].loc.start.line + ) { + attributeMap.set(attribute, { end: commentNextAttribute[0].range[1], hasComment: true }); + } + addtoSortableAttributeGroups(attribute); + i += 1; + } + } + } + } + return sortableAttributeGroups; +} + +function generateFixerFunction(node, context, reservedList) { + const sourceCode = context.getSourceCode(); + const attributes = node.attributes.slice(0); + const configuration = context.options[0] || {}; + const ignoreCase = configuration.ignoreCase || false; + const callbacksLast = configuration.callbacksLast || false; + const shorthandFirst = configuration.shorthandFirst || false; + const shorthandLast = configuration.shorthandLast || false; + const multiline = configuration.multiline || 'ignore'; + const noSortAlphabetically = configuration.noSortAlphabetically || false; + const reservedFirst = configuration.reservedFirst || false; + const locale = configuration.locale || 'auto'; + + // Sort props according to the context. Only supports ignoreCase. + // Since we cannot safely move JSXSpreadAttribute (due to potential variable overrides), + // we only consider groups of sortable attributes. + const options = { + ignoreCase, + callbacksLast, + shorthandFirst, + shorthandLast, + multiline, + noSortAlphabetically, + reservedFirst, + reservedList, + locale, + }; + const sortableAttributeGroups = getGroupsOfSortableAttributes(attributes, context); + const sortedAttributeGroups = sortableAttributeGroups + .slice(0) + .map((group) => group.slice(0).sort((a, b) => contextCompare(a, b, options))); + + return function fixFunction(fixer) { + const fixers = []; + let source = sourceCode.getText(); + + sortableAttributeGroups.forEach((sortableGroup, ii) => { + sortableGroup.forEach((attr, jj) => { + const sortedAttr = sortedAttributeGroups[ii][jj]; + const sortedAttrText = source.substring(sortedAttr.range[0], attributeMap.get(sortedAttr).end); + fixers.push({ + range: [attr.range[0], attributeMap.get(attr).end], + text: sortedAttrText, + }); + }); + }); + + fixers.sort((a, b) => b.range[0] - a.range[0]); + + const firstFixer = fixers[0]; + const lastFixer = fixers[fixers.length - 1]; + const rangeStart = lastFixer ? lastFixer.range[0] : 0; + const rangeEnd = firstFixer ? firstFixer.range[1] : -0; + + fixers.forEach((fix) => { + source = `${source.substr(0, fix.range[0])}${fix.text}${source.substr(fix.range[1])}`; + }); + + return fixer.replaceTextRange([rangeStart, rangeEnd], source.substr(rangeStart, rangeEnd - rangeStart)); + }; +} + +/** + * Checks if the `reservedFirst` option is valid + * @param {Object} context The context of the rule + * @param {Boolean|Array} reservedFirst The `reservedFirst` option + * @return {Function|undefined} If an error is detected, a function to generate the error message, otherwise, `undefined` + */ +// eslint-disable-next-line consistent-return +function validateReservedFirstConfig(context, reservedFirst) { + if (reservedFirst) { + if (Array.isArray(reservedFirst)) { + // Only allow a subset of reserved words in customized lists + const nonReservedWords = reservedFirst.filter((word) => !isReservedPropName( + word, + RESERVED_PROPS_LIST + )); + + if (reservedFirst.length === 0) { + return function Report(decl) { + report(context, messages.listIsEmpty, 'listIsEmpty', { + node: decl, + }); + }; + } + if (nonReservedWords.length > 0) { + return function Report(decl) { + report(context, messages.noUnreservedProps, 'noUnreservedProps', { + node: decl, + data: { + unreservedWords: nonReservedWords.toString(), + }, + }); + }; + } + } + } +} + +const reportedNodeAttributes = new WeakMap(); +/** + * Check if the current node attribute has already been reported with the same error type + * if that's the case then we don't report a new error + * otherwise we report the error + * @param {Object} nodeAttribute The node attribute to be reported + * @param {string} errorType The error type to be reported + * @param {Object} node The parent node for the node attribute + * @param {Object} context The context of the rule + * @param {Array} reservedList The list of reserved props + */ +function reportNodeAttribute(nodeAttribute, errorType, node, context, reservedList) { + const errors = reportedNodeAttributes.get(nodeAttribute) || []; + + if (includes(errors, errorType)) { + return; + } + + errors.push(errorType); + + reportedNodeAttributes.set(nodeAttribute, errors); + + report(context, messages[errorType], errorType, { + node: nodeAttribute.name, + fix: generateFixerFunction(node, context, reservedList), + }); +} + +module.exports = { + meta: { + docs: { + description: 'Enforce props alphabetical sorting', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-sort-props'), + }, + fixable: 'code', + + messages, + + schema: [{ + type: 'object', + properties: { + // Whether callbacks (prefixed with "on") should be listed at the very end, + // after all other props. Supersedes shorthandLast. + callbacksLast: { + type: 'boolean', + }, + // Whether shorthand properties (without a value) should be listed first + shorthandFirst: { + type: 'boolean', + }, + // Whether shorthand properties (without a value) should be listed last + shorthandLast: { + type: 'boolean', + }, + // Whether multiline properties should be listed first or last + multiline: { + enum: ['ignore', 'first', 'last'], + default: 'ignore', + }, + ignoreCase: { + type: 'boolean', + }, + // Whether alphabetical sorting should be enforced + noSortAlphabetically: { + type: 'boolean', + }, + reservedFirst: { + type: ['array', 'boolean'], + }, + locale: { + type: 'string', + default: 'auto', + }, + }, + additionalProperties: false, + }], + }, + + create(context) { + const configuration = context.options[0] || {}; + const ignoreCase = configuration.ignoreCase || false; + const callbacksLast = configuration.callbacksLast || false; + const shorthandFirst = configuration.shorthandFirst || false; + const shorthandLast = configuration.shorthandLast || false; + const multiline = configuration.multiline || 'ignore'; + const noSortAlphabetically = configuration.noSortAlphabetically || false; + const reservedFirst = configuration.reservedFirst || false; + const reservedFirstError = validateReservedFirstConfig(context, reservedFirst); + const reservedList = Array.isArray(reservedFirst) ? reservedFirst : RESERVED_PROPS_LIST; + const locale = configuration.locale || 'auto'; + + return { + Program() { + attributeMap = new WeakMap(); + }, + + JSXOpeningElement(node) { + // `dangerouslySetInnerHTML` is only "reserved" on DOM components + const nodeReservedList = reservedFirst && !jsxUtil.isDOMComponent(node) ? reservedList.filter((prop) => prop !== 'dangerouslySetInnerHTML') : reservedList; + + node.attributes.reduce((memo, decl, idx, attrs) => { + if (decl.type === 'JSXSpreadAttribute') { + return attrs[idx + 1]; + } + + let previousPropName = propName(memo); + let currentPropName = propName(decl); + const previousValue = memo.value; + const currentValue = decl.value; + const previousIsCallback = isCallbackPropName(previousPropName); + const currentIsCallback = isCallbackPropName(currentPropName); + + if (ignoreCase) { + previousPropName = previousPropName.toLowerCase(); + currentPropName = currentPropName.toLowerCase(); + } + + if (reservedFirst) { + if (reservedFirstError) { + reservedFirstError(decl); + return memo; + } + + const previousIsReserved = isReservedPropName(previousPropName, nodeReservedList); + const currentIsReserved = isReservedPropName(currentPropName, nodeReservedList); + + if (previousIsReserved && !currentIsReserved) { + return decl; + } + if (!previousIsReserved && currentIsReserved) { + reportNodeAttribute(decl, 'listReservedPropsFirst', node, context, nodeReservedList); + + return memo; + } + } + + if (callbacksLast) { + if (!previousIsCallback && currentIsCallback) { + // Entering the callback prop section + return decl; + } + if (previousIsCallback && !currentIsCallback) { + // Encountered a non-callback prop after a callback prop + reportNodeAttribute(memo, 'listCallbacksLast', node, context, nodeReservedList); + + return memo; + } + } + + if (shorthandFirst) { + if (currentValue && !previousValue) { + return decl; + } + if (!currentValue && previousValue) { + reportNodeAttribute(decl, 'listShorthandFirst', node, context, nodeReservedList); + + return memo; + } + } + + if (shorthandLast) { + if (!currentValue && previousValue) { + return decl; + } + if (currentValue && !previousValue) { + reportNodeAttribute(memo, 'listShorthandLast', node, context, nodeReservedList); + + return memo; + } + } + + const previousIsMultiline = isMultilineProp(memo); + const currentIsMultiline = isMultilineProp(decl); + if (multiline === 'first') { + if (previousIsMultiline && !currentIsMultiline) { + // Exiting the multiline prop section + return decl; + } + if (!previousIsMultiline && currentIsMultiline) { + // Encountered a non-multiline prop before a multiline prop + reportNodeAttribute(decl, 'listMultilineFirst', node, context, nodeReservedList); + + return memo; + } + } else if (multiline === 'last') { + if (!previousIsMultiline && currentIsMultiline) { + // Entering the multiline prop section + return decl; + } + if (previousIsMultiline && !currentIsMultiline) { + // Encountered a non-multiline prop after a multiline prop + reportNodeAttribute(memo, 'listMultilineLast', node, context, nodeReservedList); + + return memo; + } + } + + if ( + !noSortAlphabetically + && ( + (ignoreCase || locale !== 'auto') + ? previousPropName.localeCompare(currentPropName, locale === 'auto' ? undefined : locale) > 0 + : previousPropName > currentPropName + ) + ) { + reportNodeAttribute(decl, 'sortPropsByAlpha', node, context, nodeReservedList); + + return memo; + } + + return decl; + }, node.attributes[0]); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-space-before-closing.js b/node_modules/eslint-plugin-react/lib/rules/jsx-space-before-closing.js new file mode 100644 index 000000000..5bb8da622 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-space-before-closing.js @@ -0,0 +1,95 @@ +/** + * @fileoverview Validate spacing before closing bracket in JSX. + * @author ryym + * @deprecated + */ + +'use strict'; + +const getTokenBeforeClosingBracket = require('../util/getTokenBeforeClosingBracket'); +const docsUrl = require('../util/docsUrl'); +const log = require('../util/log'); +const report = require('../util/report'); + +let isWarnedForDeprecation = false; + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + noSpaceBeforeClose: 'A space is forbidden before closing bracket', + needSpaceBeforeClose: 'A space is required before closing bracket', +}; + +module.exports = { + meta: { + deprecated: true, + docs: { + description: 'Enforce spacing before closing bracket in JSX', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-space-before-closing'), + }, + fixable: 'code', + + messages, + + schema: [{ + enum: ['always', 'never'], + }], + }, + + create(context) { + const configuration = context.options[0] || 'always'; + + // -------------------------------------------------------------------------- + // Public + // -------------------------------------------------------------------------- + + return { + JSXOpeningElement(node) { + if (!node.selfClosing) { + return; + } + + const sourceCode = context.getSourceCode(); + + const leftToken = getTokenBeforeClosingBracket(node); + const closingSlash = sourceCode.getTokenAfter(leftToken); + + if (leftToken.loc.end.line !== closingSlash.loc.start.line) { + return; + } + + if (configuration === 'always' && !sourceCode.isSpaceBetweenTokens(leftToken, closingSlash)) { + report(context, messages.needSpaceBeforeClose, 'needSpaceBeforeClose', { + loc: closingSlash.loc.start, + fix(fixer) { + return fixer.insertTextBefore(closingSlash, ' '); + }, + }); + } else if (configuration === 'never' && sourceCode.isSpaceBetweenTokens(leftToken, closingSlash)) { + report(context, messages.noSpaceBeforeClose, 'noSpaceBeforeClose', { + loc: closingSlash.loc.start, + fix(fixer) { + const previousToken = sourceCode.getTokenBefore(closingSlash); + return fixer.removeRange([previousToken.range[1], closingSlash.range[0]]); + }, + }); + } + }, + + Program() { + if (isWarnedForDeprecation) { + return; + } + + log('The react/jsx-space-before-closing rule is deprecated. ' + + 'Please use the react/jsx-tag-spacing rule with the ' + + '"beforeSelfClosing" option instead.'); + isWarnedForDeprecation = true; + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-tag-spacing.js b/node_modules/eslint-plugin-react/lib/rules/jsx-tag-spacing.js new file mode 100644 index 000000000..e7c632b47 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-tag-spacing.js @@ -0,0 +1,323 @@ +/** + * @fileoverview Validates whitespace in and around the JSX opening and closing brackets + * @author Diogo Franco (Kovensky) + */ + +'use strict'; + +const getTokenBeforeClosingBracket = require('../util/getTokenBeforeClosingBracket'); +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +const messages = { + selfCloseSlashNoSpace: 'Whitespace is forbidden between `/` and `>`; write `/>`', + selfCloseSlashNeedSpace: 'Whitespace is required between `/` and `>`; write `/ >`', + closeSlashNoSpace: 'Whitespace is forbidden between `<` and `/`; write ` isTagNameRe.test(name); + +module.exports = { + // eslint-disable-next-line eslint-plugin/prefer-message-ids -- https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/issues/292 + meta: { + docs: { + description: 'Disallow variables used in JSX to be incorrectly marked as unused', + category: 'Best Practices', + recommended: true, + url: docsUrl('jsx-uses-vars'), + }, + schema: [], + }, + + create(context) { + return { + JSXOpeningElement(node) { + let name; + if (node.name.namespace) { + // + return; + } + if (node.name.name) { + // + name = node.name.name; + // Exclude lowercase tag names like
+ if (isTagName(name)) { + return; + } + } else if (node.name.object) { + // + let parent = node.name.object; + while (parent.object) { + parent = parent.object; + } + name = parent.name; + } else { + return; + } + + context.markVariableAsUsed(name); + }, + + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-wrap-multilines.js b/node_modules/eslint-plugin-react/lib/rules/jsx-wrap-multilines.js new file mode 100644 index 000000000..5f0a5ec18 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/jsx-wrap-multilines.js @@ -0,0 +1,260 @@ +/** + * @fileoverview Prevent missing parentheses around multilines JSX + * @author Yannick Croissant + */ + +'use strict'; + +const has = require('object.hasown/polyfill')(); +const docsUrl = require('../util/docsUrl'); +const jsxUtil = require('../util/jsx'); +const reportC = require('../util/report'); +const isParenthesized = require('../util/ast').isParenthesized; + +// ------------------------------------------------------------------------------ +// Constants +// ------------------------------------------------------------------------------ + +const DEFAULTS = { + declaration: 'parens', + assignment: 'parens', + return: 'parens', + arrow: 'parens', + condition: 'ignore', + logical: 'ignore', + prop: 'ignore', +}; + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + missingParens: 'Missing parentheses around multilines JSX', + parensOnNewLines: 'Parentheses around JSX should be on separate lines', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow missing parentheses around multiline JSX', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('jsx-wrap-multilines'), + }, + fixable: 'code', + + messages, + + schema: [{ + type: 'object', + // true/false are for backwards compatibility + properties: { + declaration: { + enum: [true, false, 'ignore', 'parens', 'parens-new-line'], + }, + assignment: { + enum: [true, false, 'ignore', 'parens', 'parens-new-line'], + }, + return: { + enum: [true, false, 'ignore', 'parens', 'parens-new-line'], + }, + arrow: { + enum: [true, false, 'ignore', 'parens', 'parens-new-line'], + }, + condition: { + enum: [true, false, 'ignore', 'parens', 'parens-new-line'], + }, + logical: { + enum: [true, false, 'ignore', 'parens', 'parens-new-line'], + }, + prop: { + enum: [true, false, 'ignore', 'parens', 'parens-new-line'], + }, + }, + additionalProperties: false, + }], + }, + + create(context) { + function getOption(type) { + const userOptions = context.options[0] || {}; + if (has(userOptions, type)) { + return userOptions[type]; + } + return DEFAULTS[type]; + } + + function isEnabled(type) { + const option = getOption(type); + return option && option !== 'ignore'; + } + + function needsOpeningNewLine(node) { + const previousToken = context.getSourceCode().getTokenBefore(node); + + if (!isParenthesized(context, node)) { + return false; + } + + if (previousToken.loc.end.line === node.loc.start.line) { + return true; + } + + return false; + } + + function needsClosingNewLine(node) { + const nextToken = context.getSourceCode().getTokenAfter(node); + + if (!isParenthesized(context, node)) { + return false; + } + + if (node.loc.end.line === nextToken.loc.end.line) { + return true; + } + + return false; + } + + function isMultilines(node) { + return node.loc.start.line !== node.loc.end.line; + } + + function report(node, messageId, fix) { + reportC(context, messages[messageId], messageId, { + node, + fix, + }); + } + + function trimTokenBeforeNewline(node, tokenBefore) { + // if the token before the jsx is a bracket or curly brace + // we don't want a space between the opening parentheses and the multiline jsx + const isBracket = tokenBefore.value === '{' || tokenBefore.value === '['; + return `${tokenBefore.value.trim()}${isBracket ? '' : ' '}`; + } + + function check(node, type) { + if (!node || !jsxUtil.isJSX(node)) { + return; + } + + const sourceCode = context.getSourceCode(); + const option = getOption(type); + + if ((option === true || option === 'parens') && !isParenthesized(context, node) && isMultilines(node)) { + report(node, 'missingParens', (fixer) => fixer.replaceText(node, `(${sourceCode.getText(node)})`)); + } + + if (option === 'parens-new-line' && isMultilines(node)) { + if (!isParenthesized(context, node)) { + const tokenBefore = sourceCode.getTokenBefore(node, { includeComments: true }); + const tokenAfter = sourceCode.getTokenAfter(node, { includeComments: true }); + const start = node.loc.start; + if (tokenBefore.loc.end.line < start.line) { + // Strip newline after operator if parens newline is specified + report( + node, + 'missingParens', + (fixer) => fixer.replaceTextRange( + [tokenBefore.range[0], tokenAfter && (tokenAfter.value === ';' || tokenAfter.value === '}') ? tokenAfter.range[0] : node.range[1]], + `${trimTokenBeforeNewline(node, tokenBefore)}(\n${start.column > 0 ? ' '.repeat(start.column) : ''}${sourceCode.getText(node)}\n${start.column > 0 ? ' '.repeat(start.column - 2) : ''})` + ) + ); + } else { + report(node, 'missingParens', (fixer) => fixer.replaceText(node, `(\n${sourceCode.getText(node)}\n)`)); + } + } else { + const needsOpening = needsOpeningNewLine(node); + const needsClosing = needsClosingNewLine(node); + if (needsOpening || needsClosing) { + report(node, 'parensOnNewLines', (fixer) => { + const text = sourceCode.getText(node); + let fixed = text; + if (needsOpening) { + fixed = `\n${fixed}`; + } + if (needsClosing) { + fixed = `${fixed}\n`; + } + return fixer.replaceText(node, fixed); + }); + } + } + } + } + + // -------------------------------------------------------------------------- + // Public + // -------------------------------------------------------------------------- + + return { + + VariableDeclarator(node) { + const type = 'declaration'; + if (!isEnabled(type)) { + return; + } + if (!isEnabled('condition') && node.init && node.init.type === 'ConditionalExpression') { + check(node.init.consequent, type); + check(node.init.alternate, type); + return; + } + check(node.init, type); + }, + + AssignmentExpression(node) { + const type = 'assignment'; + if (!isEnabled(type)) { + return; + } + if (!isEnabled('condition') && node.right.type === 'ConditionalExpression') { + check(node.right.consequent, type); + check(node.right.alternate, type); + return; + } + check(node.right, type); + }, + + ReturnStatement(node) { + const type = 'return'; + if (isEnabled(type)) { + check(node.argument, type); + } + }, + + 'ArrowFunctionExpression:exit': (node) => { + const arrowBody = node.body; + const type = 'arrow'; + + if (isEnabled(type) && arrowBody.type !== 'BlockStatement') { + check(arrowBody, type); + } + }, + + ConditionalExpression(node) { + const type = 'condition'; + if (isEnabled(type)) { + check(node.consequent, type); + check(node.alternate, type); + } + }, + + LogicalExpression(node) { + const type = 'logical'; + if (isEnabled(type)) { + check(node.right, type); + } + }, + + JSXAttribute(node) { + const type = 'prop'; + if (isEnabled(type) && node.value && node.value.type === 'JSXExpressionContainer') { + check(node.value.expression, type); + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-access-state-in-setstate.js b/node_modules/eslint-plugin-react/lib/rules/no-access-state-in-setstate.js new file mode 100644 index 000000000..89d497607 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-access-state-in-setstate.js @@ -0,0 +1,187 @@ +/** + * @fileoverview Prevent usage of this.state within setState + * @author Rolf Erik Lekang, Jørgen Aaberg + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const componentUtil = require('../util/componentUtil'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + useCallback: 'Use callback in setState when referencing the previous state.', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow when this.state is accessed within setState', + category: 'Possible Errors', + recommended: false, + url: docsUrl('no-access-state-in-setstate'), + }, + + messages, + }, + + create(context) { + function isSetStateCall(node) { + return node.type === 'CallExpression' + && node.callee.property + && node.callee.property.name === 'setState' + && node.callee.object.type === 'ThisExpression'; + } + + function isFirstArgumentInSetStateCall(current, node) { + if (!isSetStateCall(current)) { + return false; + } + while (node && node.parent !== current) { + node = node.parent; + } + return current.arguments[0] === node; + } + + function isClassComponent() { + return !!(componentUtil.getParentES6Component(context) || componentUtil.getParentES5Component(context)); + } + + // The methods array contains all methods or functions that are using this.state + // or that are calling another method or function using this.state + const methods = []; + // The vars array contains all variables that contains this.state + const vars = []; + return { + CallExpression(node) { + if (!isClassComponent()) { + return; + } + // Appends all the methods that are calling another + // method containing this.state to the methods array + methods.forEach((method) => { + if (node.callee.name === method.methodName) { + let current = node.parent; + while (current.type !== 'Program') { + if (current.type === 'MethodDefinition') { + methods.push({ + methodName: current.key.name, + node: method.node, + }); + break; + } + current = current.parent; + } + } + }); + + // Finding all CallExpressions that is inside a setState + // to further check if they contains this.state + let current = node.parent; + while (current.type !== 'Program') { + if (isFirstArgumentInSetStateCall(current, node)) { + const methodName = node.callee.name; + methods.forEach((method) => { + if (method.methodName === methodName) { + report(context, messages.useCallback, 'useCallback', { + node: method.node, + }); + } + }); + + break; + } + current = current.parent; + } + }, + + MemberExpression(node) { + if ( + node.property.name === 'state' + && node.object.type === 'ThisExpression' + && isClassComponent() + ) { + let current = node; + while (current.type !== 'Program') { + // Reporting if this.state is directly within this.setState + if (isFirstArgumentInSetStateCall(current, node)) { + report(context, messages.useCallback, 'useCallback', { + node, + }); + break; + } + + // Storing all functions and methods that contains this.state + if (current.type === 'MethodDefinition') { + methods.push({ + methodName: current.key.name, + node, + }); + break; + } else if (current.type === 'FunctionExpression' && current.parent.key) { + methods.push({ + methodName: current.parent.key.name, + node, + }); + break; + } + + // Storing all variables containing this.state + if (current.type === 'VariableDeclarator') { + vars.push({ + node, + scope: context.getScope(), + variableName: current.id.name, + }); + break; + } + + current = current.parent; + } + } + }, + + Identifier(node) { + // Checks if the identifier is a variable within an object + let current = node; + while (current.parent.type === 'BinaryExpression') { + current = current.parent; + } + if ( + current.parent.value === current + || current.parent.object === current + ) { + while (current.type !== 'Program') { + if (isFirstArgumentInSetStateCall(current, node)) { + vars + .filter((v) => v.scope === context.getScope() && v.variableName === node.name) + .forEach((v) => { + report(context, messages.useCallback, 'useCallback', { + node: v.node, + }); + }); + } + current = current.parent; + } + } + }, + + ObjectPattern(node) { + const isDerivedFromThis = node.parent.init && node.parent.init.type === 'ThisExpression'; + node.properties.forEach((property) => { + if (property && property.key && property.key.name === 'state' && isDerivedFromThis) { + vars.push({ + node: property.key, + scope: context.getScope(), + variableName: property.key.name, + }); + } + }); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-adjacent-inline-elements.js b/node_modules/eslint-plugin-react/lib/rules/no-adjacent-inline-elements.js new file mode 100644 index 000000000..60e404ba2 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-adjacent-inline-elements.js @@ -0,0 +1,125 @@ +/** + * @fileoverview Prevent adjacent inline elements not separated by whitespace. + * @author Sean Hayes + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const isCreateElement = require('../util/isCreateElement'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Helpers +// ------------------------------------------------------------------------------ + +// https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements +const inlineNames = [ + 'a', + 'b', + 'big', + 'i', + 'small', + 'tt', + 'abbr', + 'acronym', + 'cite', + 'code', + 'dfn', + 'em', + 'kbd', + 'strong', + 'samp', + 'time', + 'var', + 'bdo', + 'br', + 'img', + 'map', + 'object', + 'q', + 'script', + 'span', + 'sub', + 'sup', + 'button', + 'input', + 'label', + 'select', + 'textarea', +]; +// Note: raw   will be transformed into \u00a0. +const whitespaceRegex = /(?:^\s|\s$)/; + +function isInline(node) { + if (node.type === 'Literal') { + // Regular whitespace will be removed. + const value = node.value; + // To properly separate inline elements, each end of the literal will need + // whitespace. + return !whitespaceRegex.test(value); + } + if (node.type === 'JSXElement' && inlineNames.indexOf(node.openingElement.name.name) > -1) { + return true; + } + if (node.type === 'CallExpression' && inlineNames.indexOf(node.arguments[0].value) > -1) { + return true; + } + return false; +} + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + inlineElement: 'Child elements which render as inline HTML elements should be separated by a space or wrapped in block level elements.', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow adjacent inline elements not separated by whitespace.', + category: 'Best Practices', + recommended: false, + url: docsUrl('no-adjacent-inline-elements'), + }, + schema: [], + + messages, + }, + create(context) { + function validate(node, children) { + let currentIsInline = false; + let previousIsInline = false; + if (!children) { + return; + } + for (let i = 0; i < children.length; i++) { + currentIsInline = isInline(children[i]); + if (previousIsInline && currentIsInline) { + report(context, messages.inlineElement, 'inlineElement', { + node, + }); + return; + } + previousIsInline = currentIsInline; + } + } + return { + JSXElement(node) { + validate(node, node.children); + }, + CallExpression(node) { + if (!isCreateElement(node, context)) { + return; + } + if (node.arguments.length < 2 || !node.arguments[2]) { + return; + } + const children = node.arguments[2].elements; + validate(node, children); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-array-index-key.js b/node_modules/eslint-plugin-react/lib/rules/no-array-index-key.js new file mode 100644 index 000000000..0e641b58f --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-array-index-key.js @@ -0,0 +1,287 @@ +/** + * @fileoverview Prevent usage of Array index in keys + * @author Joe Lencioni + */ + +'use strict'; + +const has = require('object.hasown/polyfill')(); +const astUtil = require('../util/ast'); +const docsUrl = require('../util/docsUrl'); +const pragma = require('../util/pragma'); +const report = require('../util/report'); +const variableUtil = require('../util/variable'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +function isCreateCloneElement(node, context) { + if (!node) { + return false; + } + + if (node.type === 'MemberExpression' || node.type === 'OptionalMemberExpression') { + return node.object + && node.object.name === pragma.getFromContext(context) + && ['createElement', 'cloneElement'].indexOf(node.property.name) !== -1; + } + + if (node.type === 'Identifier') { + const variable = variableUtil.findVariableByName(context, node.name); + if (variable && variable.type === 'ImportSpecifier') { + return variable.parent.source.value === 'react'; + } + } + + return false; +} + +const messages = { + noArrayIndex: 'Do not use Array index in keys', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow usage of Array index in keys', + category: 'Best Practices', + recommended: false, + url: docsUrl('no-array-index-key'), + }, + + messages, + + schema: [], + }, + + create(context) { + // -------------------------------------------------------------------------- + // Public + // -------------------------------------------------------------------------- + const indexParamNames = []; + const iteratorFunctionsToIndexParamPosition = { + every: 1, + filter: 1, + find: 1, + findIndex: 1, + forEach: 1, + map: 1, + reduce: 2, + reduceRight: 2, + some: 1, + }; + + function isArrayIndex(node) { + return node.type === 'Identifier' + && indexParamNames.indexOf(node.name) !== -1; + } + + function isUsingReactChildren(node) { + const callee = node.callee; + if ( + !callee + || !callee.property + || !callee.object + ) { + return null; + } + + const isReactChildMethod = ['map', 'forEach'].indexOf(callee.property.name) > -1; + if (!isReactChildMethod) { + return null; + } + + const obj = callee.object; + if (obj && obj.name === 'Children') { + return true; + } + if (obj && obj.object && obj.object.name === pragma.getFromContext(context)) { + return true; + } + + return false; + } + + function getMapIndexParamName(node) { + const callee = node.callee; + if (callee.type !== 'MemberExpression' && callee.type !== 'OptionalMemberExpression') { + return null; + } + if (callee.property.type !== 'Identifier') { + return null; + } + if (!has(iteratorFunctionsToIndexParamPosition, callee.property.name)) { + return null; + } + + const callbackArg = isUsingReactChildren(node) + ? node.arguments[1] + : node.arguments[0]; + + if (!callbackArg) { + return null; + } + + if (!astUtil.isFunctionLikeExpression(callbackArg)) { + return null; + } + + const params = callbackArg.params; + + const indexParamPosition = iteratorFunctionsToIndexParamPosition[callee.property.name]; + if (params.length < indexParamPosition + 1) { + return null; + } + + return params[indexParamPosition].name; + } + + function getIdentifiersFromBinaryExpression(side) { + if (side.type === 'Identifier') { + return side; + } + + if (side.type === 'BinaryExpression') { + // recurse + const left = getIdentifiersFromBinaryExpression(side.left); + const right = getIdentifiersFromBinaryExpression(side.right); + return [].concat(left, right).filter(Boolean); + } + + return null; + } + + function checkPropValue(node) { + if (isArrayIndex(node)) { + // key={bar} + report(context, messages.noArrayIndex, 'noArrayIndex', { + node, + }); + return; + } + + if (node.type === 'TemplateLiteral') { + // key={`foo-${bar}`} + node.expressions.filter(isArrayIndex).forEach(() => { + report(context, messages.noArrayIndex, 'noArrayIndex', { + node, + }); + }); + + return; + } + + if (node.type === 'BinaryExpression') { + // key={'foo' + bar} + const identifiers = getIdentifiersFromBinaryExpression(node); + + identifiers.filter(isArrayIndex).forEach(() => { + report(context, messages.noArrayIndex, 'noArrayIndex', { + node, + }); + }); + + return; + } + + if (node.type === 'CallExpression' + && node.callee + && node.callee.type === 'MemberExpression' + && node.callee.object + && isArrayIndex(node.callee.object) + && node.callee.property + && node.callee.property.type === 'Identifier' + && node.callee.property.name === 'toString' + ) { + // key={bar.toString()} + report(context, messages.noArrayIndex, 'noArrayIndex', { + node, + }); + return; + } + + if (node.type === 'CallExpression' + && node.callee + && node.callee.type === 'Identifier' + && node.callee.name === 'String' + && Array.isArray(node.arguments) + && node.arguments.length > 0 + && isArrayIndex(node.arguments[0]) + ) { + // key={String(bar)} + report(context, messages.noArrayIndex, 'noArrayIndex', { + node: node.arguments[0], + }); + } + } + + function popIndex(node) { + const mapIndexParamName = getMapIndexParamName(node); + if (!mapIndexParamName) { + return; + } + + indexParamNames.pop(); + } + + return { + 'CallExpression, OptionalCallExpression'(node) { + if (isCreateCloneElement(node.callee, context) && node.arguments.length > 1) { + // React.createElement + if (!indexParamNames.length) { + return; + } + + const props = node.arguments[1]; + + if (props.type !== 'ObjectExpression') { + return; + } + + props.properties.forEach((prop) => { + if (!prop.key || prop.key.name !== 'key') { + // { ...foo } + // { foo: bar } + return; + } + + checkPropValue(prop.value); + }); + + return; + } + + const mapIndexParamName = getMapIndexParamName(node); + if (!mapIndexParamName) { + return; + } + + indexParamNames.push(mapIndexParamName); + }, + + JSXAttribute(node) { + if (node.name.name !== 'key') { + // foo={bar} + return; + } + + if (!indexParamNames.length) { + // Not inside a call expression that we think has an index param. + return; + } + + const value = node.value; + if (!value || value.type !== 'JSXExpressionContainer') { + // key='foo' or just simply 'key' + return; + } + + checkPropValue(value.expression); + }, + + 'CallExpression:exit': popIndex, + 'OptionalCallExpression:exit': popIndex, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-arrow-function-lifecycle.js b/node_modules/eslint-plugin-react/lib/rules/no-arrow-function-lifecycle.js new file mode 100644 index 000000000..273eb1caa --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-arrow-function-lifecycle.js @@ -0,0 +1,142 @@ +/** + * @fileoverview Lifecycle methods should be methods on the prototype, not class fields + * @author Tan Nguyen + */ + +'use strict'; + +const values = require('object.values'); + +const Components = require('../util/Components'); +const astUtil = require('../util/ast'); +const componentUtil = require('../util/componentUtil'); +const docsUrl = require('../util/docsUrl'); +const lifecycleMethods = require('../util/lifecycleMethods'); +const report = require('../util/report'); + +function getText(node) { + const params = node.value.params.map((p) => p.name); + + if (node.type === 'Property') { + return `: function(${params.join(', ')}) `; + } + + if (node.type === 'ClassProperty' || node.type === 'PropertyDefinition') { + return `(${params.join(', ')}) `; + } + + return null; +} + +const messages = { + lifecycle: '{{propertyName}} is a React lifecycle method, and should not be an arrow function or in a class field. Use an instance method instead.', +}; + +module.exports = { + meta: { + docs: { + description: 'Lifecycle methods should be methods on the prototype, not class fields', + category: 'Best Practices', + recommended: false, + url: docsUrl('no-arrow-function-lifecycle'), + }, + messages, + schema: [], + fixable: 'code', + }, + + create: Components.detect((context, components) => { + /** + * @param {Array} properties list of component properties + */ + function reportNoArrowFunctionLifecycle(properties) { + properties.forEach((node) => { + if (!node || !node.value) { + return; + } + + const propertyName = astUtil.getPropertyName(node); + const nodeType = node.value.type; + const isLifecycleMethod = ( + node.static && !componentUtil.isES5Component(node, context) + ? lifecycleMethods.static + : lifecycleMethods.instance + ).indexOf(propertyName) > -1; + + if (nodeType === 'ArrowFunctionExpression' && isLifecycleMethod) { + const body = node.value.body; + const isBlockBody = body.type === 'BlockStatement'; + const sourceCode = context.getSourceCode(); + + let nextComment = []; + let previousComment = []; + let bodyRange; + if (!isBlockBody) { + const previousToken = sourceCode.getTokenBefore(body); + + if (sourceCode.getCommentsBefore) { + // eslint >=4.x + previousComment = sourceCode.getCommentsBefore(body); + } else { + // eslint 3.x + const potentialComment = sourceCode.getTokenBefore(body, { includeComments: true }); + previousComment = previousToken === potentialComment ? [] : [potentialComment]; + } + + if (sourceCode.getCommentsAfter) { + // eslint >=4.x + nextComment = sourceCode.getCommentsAfter(body); + } else { + // eslint 3.x + const potentialComment = sourceCode.getTokenAfter(body, { includeComments: true }); + const nextToken = sourceCode.getTokenAfter(body); + nextComment = nextToken === potentialComment ? [] : [potentialComment]; + } + bodyRange = [ + (previousComment.length > 0 ? previousComment[0] : body).range[0], + (nextComment.length > 0 ? nextComment[nextComment.length - 1] : body).range[1], + ]; + } + const headRange = [ + node.key.range[1], + (previousComment.length > 0 ? previousComment[0] : body).range[0], + ]; + + report( + context, + messages.lifecycle, + 'lifecycle', + { + node, + data: { + propertyName, + }, + fix(fixer) { + if (!sourceCode.getCommentsAfter) { + // eslint 3.x + return isBlockBody && fixer.replaceTextRange(headRange, getText(node)); + } + return [].concat( + fixer.replaceTextRange(headRange, getText(node)), + isBlockBody ? [] : fixer.replaceTextRange( + bodyRange, + `{ return ${previousComment.map((x) => sourceCode.getText(x)).join('')}${sourceCode.getText(body)}${nextComment.map((x) => sourceCode.getText(x)).join('')}; }` + ) + ); + }, + } + ); + } + }); + } + + return { + 'Program:exit'() { + values(components.list()).forEach((component) => { + const properties = astUtil.getComponentProperties(component.node); + reportNoArrowFunctionLifecycle(properties); + }); + }, + }; + }), +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-children-prop.js b/node_modules/eslint-plugin-react/lib/rules/no-children-prop.js new file mode 100644 index 000000000..440e61e94 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-children-prop.js @@ -0,0 +1,119 @@ +/** + * @fileoverview Prevent passing of children as props + * @author Benjamin Stepp + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const isCreateElement = require('../util/isCreateElement'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Helpers +// ------------------------------------------------------------------------------ + +/** + * Checks if the node is a createElement call with a props literal. + * @param {ASTNode} node - The AST node being checked. + * @param {Context} context - The AST node being checked. + * @returns {Boolean} - True if node is a createElement call with a props + * object literal, False if not. +*/ +function isCreateElementWithProps(node, context) { + return isCreateElement(node, context) + && node.arguments.length > 1 + && node.arguments[1].type === 'ObjectExpression'; +} + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + nestChildren: 'Do not pass children as props. Instead, nest children between the opening and closing tags.', + passChildrenAsArgs: 'Do not pass children as props. Instead, pass them as additional arguments to React.createElement.', + nestFunction: 'Do not nest a function between the opening and closing tags. Instead, pass it as a prop.', + passFunctionAsArgs: 'Do not pass a function as an additional argument to React.createElement. Instead, pass it as a prop.', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow passing of children as props', + category: 'Best Practices', + recommended: true, + url: docsUrl('no-children-prop'), + }, + + messages, + + schema: [{ + type: 'object', + properties: { + allowFunctions: { + type: 'boolean', + default: false, + }, + }, + additionalProperties: false, + }], + }, + create(context) { + const configuration = context.options[0] || {}; + + function isFunction(node) { + return configuration.allowFunctions && (node.type === 'ArrowFunctionExpression' || node.type === 'FunctionExpression'); + } + + return { + JSXAttribute(node) { + if (node.name.name !== 'children') { + return; + } + + const value = node.value; + if (value && value.type === 'JSXExpressionContainer' && isFunction(value.expression)) { + return; + } + + report(context, messages.nestChildren, 'nestChildren', { + node, + }); + }, + CallExpression(node) { + if (!isCreateElementWithProps(node, context)) { + return; + } + + const props = node.arguments[1].properties; + const childrenProp = props.find((prop) => prop.key && prop.key.name === 'children'); + + if (childrenProp) { + if (childrenProp.value && !isFunction(childrenProp.value)) { + report(context, messages.passChildrenAsArgs, 'passChildrenAsArgs', { + node, + }); + } + } else if (node.arguments.length === 3) { + const children = node.arguments[2]; + if (isFunction(children)) { + report(context, messages.passFunctionAsArgs, 'passFunctionAsArgs', { + node, + }); + } + } + }, + JSXElement(node) { + const children = node.children; + if (children && children.length === 1 && children[0].type === 'JSXExpressionContainer') { + if (isFunction(children[0].expression)) { + report(context, messages.nestFunction, 'nestFunction', { + node, + }); + } + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-danger-with-children.js b/node_modules/eslint-plugin-react/lib/rules/no-danger-with-children.js new file mode 100644 index 000000000..17d55930f --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-danger-with-children.js @@ -0,0 +1,155 @@ +/** + * @fileoverview Report when a DOM element is using both children and dangerouslySetInnerHTML + * @author David Petersen + */ + +'use strict'; + +const variableUtil = require('../util/variable'); +const jsxUtil = require('../util/jsx'); +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ +const messages = { + dangerWithChildren: 'Only set one of `children` or `props.dangerouslySetInnerHTML`', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow when a DOM element is using both children and dangerouslySetInnerHTML', + category: 'Possible Errors', + recommended: true, + url: docsUrl('no-danger-with-children'), + }, + + messages, + + schema: [], // no options + }, + create(context) { + function findSpreadVariable(name) { + return variableUtil.variablesInScope(context).find((item) => item.name === name); + } + /** + * Takes a ObjectExpression and returns the value of the prop if it has it + * @param {object} node - ObjectExpression node + * @param {string} propName - name of the prop to look for + * @param {string[]} seenProps + * @returns {object | boolean} + */ + function findObjectProp(node, propName, seenProps) { + if (!node.properties) { + return false; + } + return node.properties.find((prop) => { + if (prop.type === 'Property') { + return prop.key.name === propName; + } + if (prop.type === 'ExperimentalSpreadProperty' || prop.type === 'SpreadElement') { + const variable = findSpreadVariable(prop.argument.name); + if (variable && variable.defs.length && variable.defs[0].node.init) { + if (seenProps.indexOf(prop.argument.name) > -1) { + return false; + } + const newSeenProps = seenProps.concat(prop.argument.name || []); + return findObjectProp(variable.defs[0].node.init, propName, newSeenProps); + } + } + return false; + }); + } + + /** + * Takes a JSXElement and returns the value of the prop if it has it + * @param {object} node - JSXElement node + * @param {string} propName - name of the prop to look for + * @returns {object | boolean} + */ + function findJsxProp(node, propName) { + const attributes = node.openingElement.attributes; + return attributes.find((attribute) => { + if (attribute.type === 'JSXSpreadAttribute') { + const variable = findSpreadVariable(attribute.argument.name); + if (variable && variable.defs.length && variable.defs[0].node.init) { + return findObjectProp(variable.defs[0].node.init, propName, []); + } + } + return attribute.name && attribute.name.name === propName; + }); + } + + /** + * Checks to see if a node is a line break + * @param {ASTNode} node The AST node being checked + * @returns {Boolean} True if node is a line break, false if not + */ + function isLineBreak(node) { + const isLiteral = node.type === 'Literal' || node.type === 'JSXText'; + const isMultiline = node.loc.start.line !== node.loc.end.line; + const isWhiteSpaces = jsxUtil.isWhiteSpaces(node.value); + + return isLiteral && isMultiline && isWhiteSpaces; + } + + return { + JSXElement(node) { + let hasChildren = false; + + if (node.children.length && !isLineBreak(node.children[0])) { + hasChildren = true; + } else if (findJsxProp(node, 'children')) { + hasChildren = true; + } + + if ( + node.openingElement.attributes + && hasChildren + && findJsxProp(node, 'dangerouslySetInnerHTML') + ) { + report(context, messages.dangerWithChildren, 'dangerWithChildren', { + node, + }); + } + }, + CallExpression(node) { + if ( + node.callee + && node.callee.type === 'MemberExpression' + && node.callee.property.name === 'createElement' + && node.arguments.length > 1 + ) { + let hasChildren = false; + + let props = node.arguments[1]; + + if (props.type === 'Identifier') { + const variable = variableUtil.variablesInScope(context).find((item) => item.name === props.name); + if (variable && variable.defs.length && variable.defs[0].node.init) { + props = variable.defs[0].node.init; + } + } + + const dangerously = findObjectProp(props, 'dangerouslySetInnerHTML', []); + + if (node.arguments.length === 2) { + if (findObjectProp(props, 'children', [])) { + hasChildren = true; + } + } else { + hasChildren = true; + } + + if (dangerously && hasChildren) { + report(context, messages.dangerWithChildren, 'dangerWithChildren', { + node, + }); + } + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-danger.js b/node_modules/eslint-plugin-react/lib/rules/no-danger.js new file mode 100644 index 000000000..a7cf8b59f --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-danger.js @@ -0,0 +1,74 @@ +/** + * @fileoverview Prevent usage of dangerous JSX props + * @author Scott Andrews + */ + +'use strict'; + +const has = require('object.hasown/polyfill')(); +const fromEntries = require('object.fromentries/polyfill')(); + +const docsUrl = require('../util/docsUrl'); +const jsxUtil = require('../util/jsx'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Constants +// ------------------------------------------------------------------------------ + +const DANGEROUS_PROPERTY_NAMES = [ + 'dangerouslySetInnerHTML', +]; + +const DANGEROUS_PROPERTIES = fromEntries(DANGEROUS_PROPERTY_NAMES.map((prop) => [prop, prop])); + +// ------------------------------------------------------------------------------ +// Helpers +// ------------------------------------------------------------------------------ + +/** + * Checks if a JSX attribute is dangerous. + * @param {String} name - Name of the attribute to check. + * @returns {boolean} Whether or not the attribute is dangerous. + */ +function isDangerous(name) { + return has(DANGEROUS_PROPERTIES, name); +} + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + dangerousProp: 'Dangerous property \'{{name}}\' found', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow usage of dangerous JSX properties', + category: 'Best Practices', + recommended: false, + url: docsUrl('no-danger'), + }, + + messages, + + schema: [], + }, + + create(context) { + return { + JSXAttribute(node) { + if (jsxUtil.isDOMComponent(node.parent) && isDangerous(node.name.name)) { + report(context, messages.dangerousProp, 'dangerousProp', { + node, + data: { + name: node.name.name, + }, + }); + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-deprecated.js b/node_modules/eslint-plugin-react/lib/rules/no-deprecated.js new file mode 100644 index 000000000..ac7beb180 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-deprecated.js @@ -0,0 +1,227 @@ +/** + * @fileoverview Prevent usage of deprecated methods + * @author Yannick Croissant + * @author Scott Feeney + * @author Sergei Startsev + */ + +'use strict'; + +const values = require('object.values'); +const astUtil = require('../util/ast'); +const componentUtil = require('../util/componentUtil'); +const docsUrl = require('../util/docsUrl'); +const pragmaUtil = require('../util/pragma'); +const testReactVersion = require('../util/version').testReactVersion; +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Constants +// ------------------------------------------------------------------------------ + +const MODULES = { + react: ['React'], + 'react-addons-perf': ['ReactPerf', 'Perf'], +}; + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +function getDeprecated(pragma) { + const deprecated = {}; + // 0.12.0 + deprecated[`${pragma}.renderComponent`] = ['0.12.0', `${pragma}.render`]; + deprecated[`${pragma}.renderComponentToString`] = ['0.12.0', `${pragma}.renderToString`]; + deprecated[`${pragma}.renderComponentToStaticMarkup`] = ['0.12.0', `${pragma}.renderToStaticMarkup`]; + deprecated[`${pragma}.isValidComponent`] = ['0.12.0', `${pragma}.isValidElement`]; + deprecated[`${pragma}.PropTypes.component`] = ['0.12.0', `${pragma}.PropTypes.element`]; + deprecated[`${pragma}.PropTypes.renderable`] = ['0.12.0', `${pragma}.PropTypes.node`]; + deprecated[`${pragma}.isValidClass`] = ['0.12.0']; + deprecated['this.transferPropsTo'] = ['0.12.0', 'spread operator ({...})']; + // 0.13.0 + deprecated[`${pragma}.addons.classSet`] = ['0.13.0', 'the npm module classnames']; + deprecated[`${pragma}.addons.cloneWithProps`] = ['0.13.0', `${pragma}.cloneElement`]; + // 0.14.0 + deprecated[`${pragma}.render`] = ['0.14.0', 'ReactDOM.render']; + deprecated[`${pragma}.unmountComponentAtNode`] = ['0.14.0', 'ReactDOM.unmountComponentAtNode']; + deprecated[`${pragma}.findDOMNode`] = ['0.14.0', 'ReactDOM.findDOMNode']; + deprecated[`${pragma}.renderToString`] = ['0.14.0', 'ReactDOMServer.renderToString']; + deprecated[`${pragma}.renderToStaticMarkup`] = ['0.14.0', 'ReactDOMServer.renderToStaticMarkup']; + // 15.0.0 + deprecated[`${pragma}.addons.LinkedStateMixin`] = ['15.0.0']; + deprecated['ReactPerf.printDOM'] = ['15.0.0', 'ReactPerf.printOperations']; + deprecated['Perf.printDOM'] = ['15.0.0', 'Perf.printOperations']; + deprecated['ReactPerf.getMeasurementsSummaryMap'] = ['15.0.0', 'ReactPerf.getWasted']; + deprecated['Perf.getMeasurementsSummaryMap'] = ['15.0.0', 'Perf.getWasted']; + // 15.5.0 + deprecated[`${pragma}.createClass`] = ['15.5.0', 'the npm module create-react-class']; + deprecated[`${pragma}.addons.TestUtils`] = ['15.5.0', 'ReactDOM.TestUtils']; + deprecated[`${pragma}.PropTypes`] = ['15.5.0', 'the npm module prop-types']; + // 15.6.0 + deprecated[`${pragma}.DOM`] = ['15.6.0', 'the npm module react-dom-factories']; + // 16.9.0 + // For now the following life-cycle methods are just legacy, not deprecated: + // `componentWillMount`, `componentWillReceiveProps`, `componentWillUpdate` + // https://github.com/yannickcr/eslint-plugin-react/pull/1750#issuecomment-425975934 + deprecated.componentWillMount = [ + '16.9.0', + 'UNSAFE_componentWillMount', + 'https://reactjs.org/docs/react-component.html#unsafe_componentwillmount. ' + + 'Use https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles to automatically update your components.', + ]; + deprecated.componentWillReceiveProps = [ + '16.9.0', + 'UNSAFE_componentWillReceiveProps', + 'https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops. ' + + 'Use https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles to automatically update your components.', + ]; + deprecated.componentWillUpdate = [ + '16.9.0', + 'UNSAFE_componentWillUpdate', + 'https://reactjs.org/docs/react-component.html#unsafe_componentwillupdate. ' + + 'Use https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles to automatically update your components.', + ]; + return deprecated; +} + +const messages = { + deprecated: '{{oldMethod}} is deprecated since React {{version}}{{newMethod}}{{refs}}', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow usage of deprecated methods', + category: 'Best Practices', + recommended: true, + url: docsUrl('no-deprecated'), + }, + + messages, + + schema: [], + }, + + create(context) { + const pragma = pragmaUtil.getFromContext(context); + const deprecated = getDeprecated(pragma); + + function isDeprecated(method) { + return ( + deprecated + && deprecated[method] + && deprecated[method][0] + && testReactVersion(context, `>= ${deprecated[method][0]}`) + ); + } + + function checkDeprecation(node, methodName, methodNode) { + if (!isDeprecated(methodName)) { + return; + } + const version = deprecated[methodName][0]; + const newMethod = deprecated[methodName][1]; + const refs = deprecated[methodName][2]; + report(context, messages.deprecated, 'deprecated', { + node: methodNode || node, + data: { + oldMethod: methodName, + version, + newMethod: newMethod ? `, use ${newMethod} instead` : '', + refs: refs ? `, see ${refs}` : '', + }, + }); + } + + function getReactModuleName(node) { + let moduleName = false; + if (!node.init) { + return moduleName; + } + + values(MODULES).some((moduleNames) => { + moduleName = moduleNames.find((name) => name === node.init.name); + return moduleName; + }); + + return moduleName; + } + + /** + * Returns life cycle methods if available + * @param {ASTNode} node The AST node being checked. + * @returns {Array} The array of methods. + */ + function getLifeCycleMethods(node) { + const properties = astUtil.getComponentProperties(node); + return properties.map((property) => ({ + name: astUtil.getPropertyName(property), + node: astUtil.getPropertyNameNode(property), + })); + } + + /** + * Checks life cycle methods + * @param {ASTNode} node The AST node being checked. + */ + function checkLifeCycleMethods(node) { + if ( + componentUtil.isES5Component(node, context) + || componentUtil.isES6Component(node, context) + ) { + const methods = getLifeCycleMethods(node); + methods.forEach((method) => checkDeprecation(node, method.name, method.node)); + } + } + + // -------------------------------------------------------------------------- + // Public + // -------------------------------------------------------------------------- + + return { + MemberExpression(node) { + checkDeprecation(node, context.getSourceCode().getText(node)); + }, + + ImportDeclaration(node) { + const isReactImport = typeof MODULES[node.source.value] !== 'undefined'; + if (!isReactImport) { + return; + } + node.specifiers.forEach((specifier) => { + if (!specifier.imported) { + return; + } + checkDeprecation(node, `${MODULES[node.source.value][0]}.${specifier.imported.name}`); + }); + }, + + VariableDeclarator(node) { + const reactModuleName = getReactModuleName(node); + const isRequire = node.init && node.init.callee && node.init.callee.name === 'require'; + const isReactRequire = node.init + && node.init.arguments + && node.init.arguments.length + && typeof MODULES[node.init.arguments[0].value] !== 'undefined'; + const isDestructuring = node.id && node.id.type === 'ObjectPattern'; + + if ( + !(isDestructuring && reactModuleName) + && !(isDestructuring && isRequire && isReactRequire) + ) { + return; + } + node.id.properties.forEach((property) => { + if (property.type !== 'RestElement' && property.key) { + checkDeprecation(node, `${reactModuleName || pragma}.${property.key.name}`); + } + }); + }, + + ClassDeclaration: checkLifeCycleMethods, + ClassExpression: checkLifeCycleMethods, + ObjectExpression: checkLifeCycleMethods, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-did-mount-set-state.js b/node_modules/eslint-plugin-react/lib/rules/no-did-mount-set-state.js new file mode 100644 index 000000000..a5705ef2d --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-did-mount-set-state.js @@ -0,0 +1,10 @@ +/** + * @fileoverview Prevent usage of setState in componentDidMount + * @author Yannick Croissant + */ + +'use strict'; + +const makeNoMethodSetStateRule = require('../util/makeNoMethodSetStateRule'); + +module.exports = makeNoMethodSetStateRule('componentDidMount'); diff --git a/node_modules/eslint-plugin-react/lib/rules/no-did-update-set-state.js b/node_modules/eslint-plugin-react/lib/rules/no-did-update-set-state.js new file mode 100644 index 000000000..5c76a1ff5 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-did-update-set-state.js @@ -0,0 +1,10 @@ +/** + * @fileoverview Prevent usage of setState in componentDidUpdate + * @author Yannick Croissant + */ + +'use strict'; + +const makeNoMethodSetStateRule = require('../util/makeNoMethodSetStateRule'); + +module.exports = makeNoMethodSetStateRule('componentDidUpdate'); diff --git a/node_modules/eslint-plugin-react/lib/rules/no-direct-mutation-state.js b/node_modules/eslint-plugin-react/lib/rules/no-direct-mutation-state.js new file mode 100644 index 000000000..8b6839f31 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-direct-mutation-state.js @@ -0,0 +1,154 @@ +/** + * @fileoverview Prevent direct mutation of this.state + * @author David Petersen + * @author Nicolas Fernandez <@burabure> + */ + +'use strict'; + +const Components = require('../util/Components'); +const componentUtil = require('../util/componentUtil'); +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + noDirectMutation: 'Do not mutate state directly. Use setState().', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow direct mutation of this.state', + category: 'Possible Errors', + recommended: true, + url: docsUrl('no-direct-mutation-state'), + }, + + messages, + }, + + create: Components.detect((context, components, utils) => { + /** + * Checks if the component is valid + * @param {Object} component The component to process + * @returns {Boolean} True if the component is valid, false if not. + */ + function isValid(component) { + return Boolean(component && !component.mutateSetState); + } + + /** + * Reports undeclared proptypes for a given component + * @param {Object} component The component to process + */ + function reportMutations(component) { + let mutation; + for (let i = 0, j = component.mutations.length; i < j; i++) { + mutation = component.mutations[i]; + report(context, messages.noDirectMutation, 'noDirectMutation', { + node: mutation, + }); + } + } + + /** + * Walks through the MemberExpression to the top-most property. + * @param {Object} node The node to process + * @returns {Object} The outer-most MemberExpression + */ + function getOuterMemberExpression(node) { + while (node.object && node.object.property) { + node = node.object; + } + return node; + } + + /** + * Determine if we should currently ignore assignments in this component. + * @param {?Object} component The component to process + * @returns {Boolean} True if we should skip assignment checks. + */ + function shouldIgnoreComponent(component) { + return !component || (component.inConstructor && !component.inCallExpression); + } + + // -------------------------------------------------------------------------- + // Public + // -------------------------------------------------------------------------- + return { + MethodDefinition(node) { + if (node.kind === 'constructor') { + components.set(node, { + inConstructor: true, + }); + } + }, + + CallExpression(node) { + components.set(node, { + inCallExpression: true, + }); + }, + + AssignmentExpression(node) { + const component = components.get(utils.getParentComponent()); + if (shouldIgnoreComponent(component) || !node.left || !node.left.object) { + return; + } + const item = getOuterMemberExpression(node.left); + if (componentUtil.isStateMemberExpression(item)) { + const mutations = (component && component.mutations) || []; + mutations.push(node.left.object); + components.set(node, { + mutateSetState: true, + mutations, + }); + } + }, + + UpdateExpression(node) { + const component = components.get(utils.getParentComponent()); + if (shouldIgnoreComponent(component) || node.argument.type !== 'MemberExpression') { + return; + } + const item = getOuterMemberExpression(node.argument); + if (componentUtil.isStateMemberExpression(item)) { + const mutations = (component && component.mutations) || []; + mutations.push(item); + components.set(node, { + mutateSetState: true, + mutations, + }); + } + }, + + 'CallExpression:exit'(node) { + components.set(node, { + inCallExpression: false, + }); + }, + + 'MethodDefinition:exit'(node) { + if (node.kind === 'constructor') { + components.set(node, { + inConstructor: false, + }); + } + }, + + 'Program:exit'() { + const list = components.list(); + + Object.keys(list).forEach((key) => { + if (!isValid(list[key])) { + reportMutations(list[key]); + } + }); + }, + }; + }), +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-find-dom-node.js b/node_modules/eslint-plugin-react/lib/rules/no-find-dom-node.js new file mode 100644 index 000000000..0dae59da4 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-find-dom-node.js @@ -0,0 +1,50 @@ +/** + * @fileoverview Prevent usage of findDOMNode + * @author Yannick Croissant + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + noFindDOMNode: 'Do not use findDOMNode. It doesn’t work with function components and is deprecated in StrictMode. See https://reactjs.org/docs/react-dom.html#finddomnode', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow usage of findDOMNode', + category: 'Best Practices', + recommended: true, + url: docsUrl('no-find-dom-node'), + }, + + messages, + + schema: [], + }, + + create(context) { + return { + CallExpression(node) { + const callee = node.callee; + + const isfindDOMNode = (callee.name === 'findDOMNode') + || (callee.property && callee.property.name === 'findDOMNode'); + if (!isfindDOMNode) { + return; + } + + report(context, messages.noFindDOMNode, 'noFindDOMNode', { + node: callee, + }); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-invalid-html-attribute.js b/node_modules/eslint-plugin-react/lib/rules/no-invalid-html-attribute.js new file mode 100644 index 000000000..9ba7bfa16 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-invalid-html-attribute.js @@ -0,0 +1,592 @@ +/** + * @fileoverview Check if tag attributes to have non-valid value + * @author Sebastian Malton + */ + +'use strict'; + +const matchAll = require('string.prototype.matchall'); +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const rel = new Map([ + ['alternate', new Set(['link', 'area', 'a'])], + ['apple-touch-icon', new Set(['link'])], + ['author', new Set(['link', 'area', 'a'])], + ['bookmark', new Set(['area', 'a'])], + ['canonical', new Set(['link'])], + ['dns-prefetch', new Set(['link'])], + ['external', new Set(['area', 'a', 'form'])], + ['help', new Set(['link', 'area', 'a', 'form'])], + ['icon', new Set(['link'])], + ['license', new Set(['link', 'area', 'a', 'form'])], + ['manifest', new Set(['link'])], + ['mask-icon', new Set(['link'])], + ['modulepreload', new Set(['link'])], + ['next', new Set(['link', 'area', 'a', 'form'])], + ['nofollow', new Set(['area', 'a', 'form'])], + ['noopener', new Set(['area', 'a', 'form'])], + ['noreferrer', new Set(['area', 'a', 'form'])], + ['opener', new Set(['area', 'a', 'form'])], + ['pingback', new Set(['link'])], + ['preconnect', new Set(['link'])], + ['prefetch', new Set(['link'])], + ['preload', new Set(['link'])], + ['prerender', new Set(['link'])], + ['prev', new Set(['link', 'area', 'a', 'form'])], + ['search', new Set(['link', 'area', 'a', 'form'])], + ['shortcut', new Set(['link'])], // generally allowed but needs pair with "icon" + ['shortcut\u0020icon', new Set(['link'])], + ['stylesheet', new Set(['link'])], + ['tag', new Set(['area', 'a'])], +]); + +const pairs = new Map([ + ['shortcut', new Set(['icon'])], +]); + +/** + * Map between attributes and a mapping between valid values and a set of tags they are valid on + * @type {Map>>} + */ +const VALID_VALUES = new Map([ + ['rel', rel], +]); + +/** + * Map between attributes and a mapping between pair-values and a set of values they are valid with + * @type {Map>>} + */ +const VALID_PAIR_VALUES = new Map([ + ['rel', pairs], +]); + +/** + * The set of all possible HTML elements. Used for skipping custom types + * @type {Set} + */ +const HTML_ELEMENTS = new Set([ + 'a', + 'abbr', + 'acronym', + 'address', + 'applet', + 'area', + 'article', + 'aside', + 'audio', + 'b', + 'base', + 'basefont', + 'bdi', + 'bdo', + 'bgsound', + 'big', + 'blink', + 'blockquote', + 'body', + 'br', + 'button', + 'canvas', + 'caption', + 'center', + 'cite', + 'code', + 'col', + 'colgroup', + 'content', + 'data', + 'datalist', + 'dd', + 'del', + 'details', + 'dfn', + 'dialog', + 'dir', + 'div', + 'dl', + 'dt', + 'em', + 'embed', + 'fieldset', + 'figcaption', + 'figure', + 'font', + 'footer', + 'form', + 'frame', + 'frameset', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'head', + 'header', + 'hgroup', + 'hr', + 'html', + 'i', + 'iframe', + 'image', + 'img', + 'input', + 'ins', + 'kbd', + 'keygen', + 'label', + 'legend', + 'li', + 'link', + 'main', + 'map', + 'mark', + 'marquee', + 'math', + 'menu', + 'menuitem', + 'meta', + 'meter', + 'nav', + 'nobr', + 'noembed', + 'noframes', + 'noscript', + 'object', + 'ol', + 'optgroup', + 'option', + 'output', + 'p', + 'param', + 'picture', + 'plaintext', + 'portal', + 'pre', + 'progress', + 'q', + 'rb', + 'rp', + 'rt', + 'rtc', + 'ruby', + 's', + 'samp', + 'script', + 'section', + 'select', + 'shadow', + 'slot', + 'small', + 'source', + 'spacer', + 'span', + 'strike', + 'strong', + 'style', + 'sub', + 'summary', + 'sup', + 'svg', + 'table', + 'tbody', + 'td', + 'template', + 'textarea', + 'tfoot', + 'th', + 'thead', + 'time', + 'title', + 'tr', + 'track', + 'tt', + 'u', + 'ul', + 'var', + 'video', + 'wbr', + 'xmp', +]); + +/** +* Map between attributes and set of tags that the attribute is valid on +* @type {Map>} +*/ +const COMPONENT_ATTRIBUTE_MAP = new Map(); +COMPONENT_ATTRIBUTE_MAP.set('rel', new Set(['link', 'a', 'area', 'form'])); + +const messages = { + emptyIsMeaningless: 'An empty “{{attributeName}}” attribute is meaningless.', + neverValid: '“{{reportingValue}}” is never a valid “{{attributeName}}” attribute value.', + noEmpty: 'An empty “{{attributeName}}” attribute is meaningless.', + noMethod: 'The ”{{attributeName}}“ attribute cannot be a method.', + notAlone: '“{{reportingValue}}” must be directly followed by “{{missingValue}}”.', + notPaired: '“{{reportingValue}}” can not be directly followed by “{{secondValue}}” without “{{missingValue}}”.', + notValidFor: '“{{reportingValue}}” is not a valid “{{attributeName}}” attribute value for <{{elementName}}>.', + onlyMeaningfulFor: 'The ”{{attributeName}}“ attribute only has meaning on the tags: {{tagNames}}', + onlyStrings: '“{{attributeName}}” attribute only supports strings.', + spaceDelimited: '”{{attributeName}}“ attribute values should be space delimited.', +}; + +function splitIntoRangedParts(node, regex) { + const valueRangeStart = node.range[0] + 1; // the plus one is for the initial quote + + return Array.from(matchAll(node.value, regex), (match) => { + const start = match.index + valueRangeStart; + const end = start + match[0].length; + + return { + reportingValue: `${match[1]}`, + value: match[1], + range: [start, end], + }; + }); +} + +function checkLiteralValueNode(context, attributeName, node, parentNode, parentNodeName) { + if (typeof node.value !== 'string') { + report(context, messages.onlyStrings, 'onlyStrings', { + node, + data: { attributeName }, + fix(fixer) { + return fixer.remove(parentNode); + }, + }); + return; + } + + if (!node.value.trim()) { + report(context, messages.noEmpty, 'noEmpty', { + node, + data: { attributeName }, + fix(fixer) { + return fixer.remove(parentNode); + }, + }); + return; + } + + const singleAttributeParts = splitIntoRangedParts(node, /(\S+)/g); + for (const singlePart of singleAttributeParts) { + const allowedTags = VALID_VALUES.get(attributeName).get(singlePart.value); + const reportingValue = singlePart.reportingValue; + if (!allowedTags) { + report(context, messages.neverValid, 'neverValid', { + node, + data: { + attributeName, + reportingValue, + }, + fix(fixer) { + return fixer.removeRange(singlePart.range); + }, + }); + } else if (!allowedTags.has(parentNodeName)) { + report(context, messages.notValidFor, 'notValidFor', { + node, + data: { + attributeName, + reportingValue, + elementName: parentNodeName, + }, + fix(fixer) { + return fixer.removeRange(singlePart.range); + }, + }); + } + } + + const allowedPairsForAttribute = VALID_PAIR_VALUES.get(attributeName); + if (allowedPairsForAttribute) { + const pairAttributeParts = splitIntoRangedParts(node, /(?=(\b\S+\s*\S+))/g); + for (const pairPart of pairAttributeParts) { + for (const allowedPair of allowedPairsForAttribute) { + const pairing = allowedPair[0]; + const siblings = allowedPair[1]; + const attributes = pairPart.reportingValue.split('\u0020'); + const firstValue = attributes[0]; + const secondValue = attributes[1]; + if (firstValue === pairing) { + const lastValue = attributes[attributes.length - 1]; // in case of multiple white spaces + if (!siblings.has(lastValue)) { + const message = secondValue ? messages.notPaired : messages.notAlone; + const messageId = secondValue ? 'notPaired' : 'notAlone'; + report(context, message, messageId, { + node, + data: { + reportingValue: firstValue, + secondValue, + missingValue: Array.from(siblings).join(', '), + }, + }); + } + } + } + } + } + + const whitespaceParts = splitIntoRangedParts(node, /(\s+)/g); + for (const whitespacePart of whitespaceParts) { + if (whitespacePart.range[0] === (node.range[0] + 1) || whitespacePart.range[1] === (node.range[1] - 1)) { + report(context, messages.spaceDelimited, 'spaceDelimited', { + node, + data: { attributeName }, + fix(fixer) { + return fixer.removeRange(whitespacePart.range); + }, + }); + } else if (whitespacePart.value !== '\u0020') { + report(context, messages.spaceDelimited, 'spaceDelimited', { + node, + data: { attributeName }, + fix(fixer) { + return fixer.replaceTextRange(whitespacePart.range, '\u0020'); + }, + }); + } + } +} + +const DEFAULT_ATTRIBUTES = ['rel']; + +function checkAttribute(context, node) { + const attribute = node.name.name; + + function fix(fixer) { + return fixer.remove(node); + } + + const parentNodeName = node.parent.name.name; + if (!COMPONENT_ATTRIBUTE_MAP.has(attribute) || !COMPONENT_ATTRIBUTE_MAP.get(attribute).has(parentNodeName)) { + const tagNames = Array.from( + COMPONENT_ATTRIBUTE_MAP.get(attribute).values(), + (tagName) => `"<${tagName}>"` + ).join(', '); + report(context, messages.onlyMeaningfulFor, 'onlyMeaningfulFor', { + node, + data: { + attributeName: attribute, + tagNames, + }, + fix, + }); + return; + } + + if (!node.value) { + report(context, messages.emptyIsMeaningless, 'emptyIsMeaningless', { + node, + data: { attributeName: attribute }, + fix, + }); + return; + } + + if (node.value.type === 'Literal') { + return checkLiteralValueNode(context, attribute, node.value, node, parentNodeName); + } + + if (node.value.expression.type === 'Literal') { + return checkLiteralValueNode(context, attribute, node.value.expression, node, parentNodeName); + } + + if (node.value.type !== 'JSXExpressionContainer') { + return; + } + + if (node.value.expression.type === 'ObjectExpression') { + report(context, messages.onlyStrings, 'onlyStrings', { + node, + data: { attributeName: attribute }, + fix, + }); + return; + } + + if (node.value.expression.type === 'Identifier' && node.value.expression.name === 'undefined') { + report(context, messages.onlyStrings, 'onlyStrings', { + node, + data: { attributeName: attribute }, + fix, + }); + } +} + +function isValidCreateElement(node) { + return node.callee + && node.callee.type === 'MemberExpression' + && node.callee.object.name === 'React' + && node.callee.property.name === 'createElement' + && node.arguments.length > 0; +} + +function checkPropValidValue(context, node, value, attribute) { + const validTags = VALID_VALUES.get(attribute); + + if (value.type !== 'Literal') { + return; // cannot check non-literals + } + + const validTagSet = validTags.get(value.value); + if (!validTagSet) { + report(context, messages.neverValid, 'neverValid', { + node: value, + data: { + attributeName: attribute, + reportingValue: value.value, + }, + }); + return; + } + + if (!validTagSet.has(node.arguments[0].value)) { + report(context, messages.notValidFor, 'notValidFor', { + node: value, + data: { + attributeName: attribute, + reportingValue: value.raw, + elementName: node.arguments[0].value, + }, + }); + } +} + +/** + * + * @param {*} context + * @param {*} node + * @param {string} attribute + */ +function checkCreateProps(context, node, attribute) { + const propsArg = node.arguments[1]; + + if (!propsArg || propsArg.type !== 'ObjectExpression') { + return; // can't check variables, computed, or shorthands + } + + for (const prop of propsArg.properties) { + if (!prop.key || prop.key.type !== 'Identifier') { + // eslint-disable-next-line no-continue + continue; // cannot check computed keys + } + + if (prop.key.name !== attribute) { + // eslint-disable-next-line no-continue + continue; // ignore not this attribute + } + + if (!COMPONENT_ATTRIBUTE_MAP.get(attribute).has(node.arguments[0].value)) { + const tagNames = Array.from( + COMPONENT_ATTRIBUTE_MAP.get(attribute).values(), + (tagName) => `"<${tagName}>"` + ).join(', '); + + report(context, messages.onlyMeaningfulFor, 'onlyMeaningfulFor', { + node, + data: { + attributeName: attribute, + tagNames, + }, + }); + + // eslint-disable-next-line no-continue + continue; + } + + if (prop.method) { + report(context, messages.noMethod, 'noMethod', { + node: prop, + data: { + attributeName: attribute, + }, + }); + + // eslint-disable-next-line no-continue + continue; + } + + if (prop.shorthand || prop.computed) { + // eslint-disable-next-line no-continue + continue; // cannot check these + } + + if (prop.value.type === 'ArrayExpression') { + for (const value of prop.value.elements) { + checkPropValidValue(context, node, value, attribute); + } + + // eslint-disable-next-line no-continue + continue; + } + + checkPropValidValue(context, node, prop.value, attribute); + } +} + +module.exports = { + meta: { + fixable: 'code', + docs: { + description: 'Disallow usage of invalid attributes', + category: 'Possible Errors', + url: docsUrl('no-invalid-html-attribute'), + }, + messages, + schema: [{ + type: 'array', + uniqueItems: true, + items: { + enum: ['rel'], + }, + }], + }, + + create(context) { + return { + JSXAttribute(node) { + const attributes = new Set(context.options[0] || DEFAULT_ATTRIBUTES); + + // ignore attributes that aren't configured to be checked + if (!attributes.has(node.name.name)) { + return; + } + + // ignore non-HTML elements + if (!HTML_ELEMENTS.has(node.parent.name.name)) { + return; + } + + checkAttribute(context, node); + }, + + CallExpression(node) { + if (!isValidCreateElement(node)) { + return; + } + + const elemNameArg = node.arguments[0]; + + if (!elemNameArg || elemNameArg.type !== 'Literal') { + return; // can only check literals + } + + // ignore non-HTML elements + if (!HTML_ELEMENTS.has(elemNameArg.value)) { + return; + } + + const attributes = new Set(context.options[0] || DEFAULT_ATTRIBUTES); + + for (const attribute of attributes) { + checkCreateProps(context, node, attribute); + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-is-mounted.js b/node_modules/eslint-plugin-react/lib/rules/no-is-mounted.js new file mode 100644 index 000000000..c15b6e81a --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-is-mounted.js @@ -0,0 +1,55 @@ +/** + * @fileoverview Prevent usage of isMounted + * @author Joe Lencioni + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + noIsMounted: 'Do not use isMounted', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow usage of isMounted', + category: 'Best Practices', + recommended: true, + url: docsUrl('no-is-mounted'), + }, + + messages, + + schema: [], + }, + + create(context) { + return { + CallExpression(node) { + const callee = node.callee; + if (callee.type !== 'MemberExpression') { + return; + } + if (callee.object.type !== 'ThisExpression' || callee.property.name !== 'isMounted') { + return; + } + const ancestors = context.getAncestors(callee); + for (let i = 0, j = ancestors.length; i < j; i++) { + if (ancestors[i].type === 'Property' || ancestors[i].type === 'MethodDefinition') { + report(context, messages.noIsMounted, 'noIsMounted', { + node: callee, + }); + break; + } + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-multi-comp.js b/node_modules/eslint-plugin-react/lib/rules/no-multi-comp.js new file mode 100644 index 000000000..1e5aa66c8 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-multi-comp.js @@ -0,0 +1,79 @@ +/** + * @fileoverview Prevent multiple component definition per file + * @author Yannick Croissant + */ + +'use strict'; + +const Components = require('../util/Components'); +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + onlyOneComponent: 'Declare only one React component per file', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow multiple component definition per file', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('no-multi-comp'), + }, + + messages, + + schema: [{ + type: 'object', + properties: { + ignoreStateless: { + default: false, + type: 'boolean', + }, + }, + additionalProperties: false, + }], + }, + + create: Components.detect((context, components, utils) => { + const configuration = context.options[0] || {}; + const ignoreStateless = configuration.ignoreStateless || false; + + /** + * Checks if the component is ignored + * @param {Object} component The component being checked. + * @returns {Boolean} True if the component is ignored, false if not. + */ + function isIgnored(component) { + return ( + ignoreStateless && ( + /Function/.test(component.node.type) + || utils.isPragmaComponentWrapper(component.node) + ) + ); + } + + return { + 'Program:exit'() { + if (components.length() <= 1) { + return; + } + + const list = components.list(); + + Object.keys(list).filter((component) => !isIgnored(list[component])).forEach((component, i) => { + if (i >= 1) { + report(context, messages.onlyOneComponent, 'onlyOneComponent', { + node: list[component].node, + }); + } + }); + }, + }; + }), +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-namespace.js b/node_modules/eslint-plugin-react/lib/rules/no-namespace.js new file mode 100644 index 000000000..64bbc8d52 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-namespace.js @@ -0,0 +1,61 @@ +/** + * @fileoverview Enforce that namespaces are not used in React elements + * @author Yacine Hmito + */ + +'use strict'; + +const elementType = require('jsx-ast-utils/elementType'); +const docsUrl = require('../util/docsUrl'); +const isCreateElement = require('../util/isCreateElement'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + noNamespace: 'React component {{name}} must not be in a namespace, as React does not support them', +}; + +module.exports = { + meta: { + docs: { + description: 'Enforce that namespaces are not used in React elements', + category: 'Possible Errors', + recommended: false, + url: docsUrl('no-namespace'), + }, + + messages, + + schema: [], + }, + + create(context) { + return { + CallExpression(node) { + if (isCreateElement(node, context) && node.arguments.length > 0 && node.arguments[0].type === 'Literal') { + const name = node.arguments[0].value; + if (typeof name !== 'string' || name.indexOf(':') === -1) return undefined; + report(context, messages.noNamespace, 'noNamespace', { + node, + data: { + name, + }, + }); + } + }, + JSXOpeningElement(node) { + const name = elementType(node); + if (typeof name !== 'string' || name.indexOf(':') === -1) return undefined; + report(context, messages.noNamespace, 'noNamespace', { + node, + data: { + name, + }, + }); + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-redundant-should-component-update.js b/node_modules/eslint-plugin-react/lib/rules/no-redundant-should-component-update.js new file mode 100644 index 000000000..bf7601a2c --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-redundant-should-component-update.js @@ -0,0 +1,87 @@ +/** + * @fileoverview Flag shouldComponentUpdate when extending PureComponent + */ + +'use strict'; + +const astUtil = require('../util/ast'); +const componentUtil = require('../util/componentUtil'); +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + noShouldCompUpdate: '{{component}} does not need shouldComponentUpdate when extending React.PureComponent.', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow usage of shouldComponentUpdate when extending React.PureComponent', + category: 'Possible Errors', + recommended: false, + url: docsUrl('no-redundant-should-component-update'), + }, + + messages, + + schema: [], + }, + + create(context) { + /** + * Checks for shouldComponentUpdate property + * @param {ASTNode} node The AST node being checked. + * @returns {Boolean} Whether or not the property exists. + */ + function hasShouldComponentUpdate(node) { + const properties = astUtil.getComponentProperties(node); + return properties.some((property) => { + const name = astUtil.getPropertyName(property); + return name === 'shouldComponentUpdate'; + }); + } + + /** + * Get name of node if available + * @param {ASTNode} node The AST node being checked. + * @return {String} The name of the node + */ + function getNodeName(node) { + if (node.id) { + return node.id.name; + } + if (node.parent && node.parent.id) { + return node.parent.id.name; + } + return ''; + } + + /** + * Checks for violation of rule + * @param {ASTNode} node The AST node being checked. + */ + function checkForViolation(node) { + if (componentUtil.isPureComponent(node, context)) { + const hasScu = hasShouldComponentUpdate(node); + if (hasScu) { + const className = getNodeName(node); + report(context, messages.noShouldCompUpdate, 'noShouldCompUpdate', { + node, + data: { + component: className, + }, + }); + } + } + } + + return { + ClassDeclaration: checkForViolation, + ClassExpression: checkForViolation, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-render-return-value.js b/node_modules/eslint-plugin-react/lib/rules/no-render-return-value.js new file mode 100644 index 000000000..61818a92a --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-render-return-value.js @@ -0,0 +1,81 @@ +/** + * @fileoverview Prevent usage of the return value of React.render + * @author Dustan Kasten + */ + +'use strict'; + +const testReactVersion = require('../util/version').testReactVersion; +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + noReturnValue: 'Do not depend on the return value from {{node}}.render', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow usage of the return value of ReactDOM.render', + category: 'Best Practices', + recommended: true, + url: docsUrl('no-render-return-value'), + }, + + messages, + + schema: [], + }, + + create(context) { + // -------------------------------------------------------------------------- + // Public + // -------------------------------------------------------------------------- + + let calleeObjectName = /^ReactDOM$/; + if (testReactVersion(context, '>= 15.0.0')) { + calleeObjectName = /^ReactDOM$/; + } else if (testReactVersion(context, '^0.14.0')) { + calleeObjectName = /^React(DOM)?$/; + } else if (testReactVersion(context, '^0.13.0')) { + calleeObjectName = /^React$/; + } + + return { + CallExpression(node) { + const callee = node.callee; + const parent = node.parent; + if (callee.type !== 'MemberExpression') { + return; + } + + if ( + callee.object.type !== 'Identifier' + || !calleeObjectName.test(callee.object.name) + || callee.property.name !== 'render' + ) { + return; + } + + if ( + parent.type === 'VariableDeclarator' + || parent.type === 'Property' + || parent.type === 'ReturnStatement' + || parent.type === 'ArrowFunctionExpression' + || parent.type === 'AssignmentExpression' + ) { + report(context, messages.noReturnValue, 'noReturnValue', { + node: callee, + data: { + node: callee.object.name, + }, + }); + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-set-state.js b/node_modules/eslint-plugin-react/lib/rules/no-set-state.js new file mode 100644 index 000000000..b91d10814 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-set-state.js @@ -0,0 +1,85 @@ +/** + * @fileoverview Prevent usage of setState + * @author Mark Dalgleish + */ + +'use strict'; + +const Components = require('../util/Components'); +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + noSetState: 'Do not use setState', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow usage of setState', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('no-set-state'), + }, + + messages, + + schema: [], + }, + + create: Components.detect((context, components, utils) => { + /** + * Checks if the component is valid + * @param {Object} component The component to process + * @returns {Boolean} True if the component is valid, false if not. + */ + function isValid(component) { + return Boolean(component && !component.useSetState); + } + + /** + * Reports usages of setState for a given component + * @param {Object} component The component to process + */ + function reportSetStateUsages(component) { + let setStateUsage; + for (let i = 0, j = component.setStateUsages.length; i < j; i++) { + setStateUsage = component.setStateUsages[i]; + report(context, messages.noSetState, 'noSetState', { + node: setStateUsage, + }); + } + } + + return { + CallExpression(node) { + const callee = node.callee; + if ( + callee.type !== 'MemberExpression' + || callee.object.type !== 'ThisExpression' + || callee.property.name !== 'setState' + ) { + return; + } + const component = components.get(utils.getParentComponent()); + const setStateUsages = (component && component.setStateUsages) || []; + setStateUsages.push(callee); + components.set(node, { + useSetState: true, + setStateUsages, + }); + }, + + 'Program:exit'() { + const list = components.list(); + Object.keys(list).filter((component) => !isValid(list[component])).forEach((component) => { + reportSetStateUsages(list[component]); + }); + }, + }; + }), +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-string-refs.js b/node_modules/eslint-plugin-react/lib/rules/no-string-refs.js new file mode 100644 index 000000000..2decbbe6b --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-string-refs.js @@ -0,0 +1,119 @@ +/** + * @fileoverview Prevent string definitions for references and prevent referencing this.refs + * @author Tom Hastjarjanto + */ + +'use strict'; + +const componentUtil = require('../util/componentUtil'); +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + thisRefsDeprecated: 'Using this.refs is deprecated.', + stringInRefDeprecated: 'Using string literals in ref attributes is deprecated.', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow using string references', + category: 'Best Practices', + recommended: true, + url: docsUrl('no-string-refs'), + }, + + messages, + + schema: [{ + type: 'object', + properties: { + noTemplateLiterals: { + type: 'boolean', + }, + }, + additionalProperties: false, + }], + }, + + create(context) { + const detectTemplateLiterals = context.options[0] ? context.options[0].noTemplateLiterals : false; + /** + * Checks if we are using refs + * @param {ASTNode} node The AST node being checked. + * @returns {Boolean} True if we are using refs, false if not. + */ + function isRefsUsage(node) { + return !!( + (componentUtil.getParentES6Component(context) || componentUtil.getParentES5Component(context)) + && node.object.type === 'ThisExpression' + && node.property.name === 'refs' + ); + } + + /** + * Checks if we are using a ref attribute + * @param {ASTNode} node The AST node being checked. + * @returns {Boolean} True if we are using a ref attribute, false if not. + */ + function isRefAttribute(node) { + return !!( + node.type === 'JSXAttribute' + && node.name + && node.name.name === 'ref' + ); + } + + /** + * Checks if a node contains a string value + * @param {ASTNode} node The AST node being checked. + * @returns {Boolean} True if the node contains a string value, false if not. + */ + function containsStringLiteral(node) { + return !!( + node.value + && node.value.type === 'Literal' + && typeof node.value.value === 'string' + ); + } + + /** + * Checks if a node contains a string value within a jsx expression + * @param {ASTNode} node The AST node being checked. + * @returns {Boolean} True if the node contains a string value within a jsx expression, false if not. + */ + function containsStringExpressionContainer(node) { + return !!( + node.value + && node.value.type === 'JSXExpressionContainer' + && node.value.expression + && ((node.value.expression.type === 'Literal' && typeof node.value.expression.value === 'string') + || (node.value.expression.type === 'TemplateLiteral' && detectTemplateLiterals)) + ); + } + + return { + MemberExpression(node) { + if (isRefsUsage(node)) { + report(context, messages.thisRefsDeprecated, 'thisRefsDeprecated', { + node, + }); + } + }, + JSXAttribute(node) { + if ( + isRefAttribute(node) + && (containsStringLiteral(node) || containsStringExpressionContainer(node)) + ) { + report(context, messages.stringInRefDeprecated, 'stringInRefDeprecated', { + node, + }); + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-this-in-sfc.js b/node_modules/eslint-plugin-react/lib/rules/no-this-in-sfc.js new file mode 100644 index 000000000..9c1535ef0 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-this-in-sfc.js @@ -0,0 +1,46 @@ +/** + * @fileoverview Report "this" being used in stateless functional components. + */ + +'use strict'; + +const Components = require('../util/Components'); +const docsUrl = require('../util/docsUrl'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + noThisInSFC: 'Stateless functional components should not use `this`', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow `this` from being used in stateless functional components', + category: 'Possible Errors', + recommended: false, + url: docsUrl('no-this-in-sfc'), + }, + + messages, + + schema: [], + }, + + create: Components.detect((context, components, utils) => ({ + MemberExpression(node) { + if (node.object.type === 'ThisExpression') { + const component = components.get(utils.getParentStatelessComponent()); + if (!component || (component.node && component.node.parent && component.node.parent.type === 'Property')) { + return; + } + report(context, messages.noThisInSFC, 'noThisInSFC', { + node, + }); + } + }, + })), +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-typos.js b/node_modules/eslint-plugin-react/lib/rules/no-typos.js new file mode 100644 index 000000000..f1f727f02 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-typos.js @@ -0,0 +1,259 @@ +/** + * @fileoverview Prevent common casing typos + */ + +'use strict'; + +const PROP_TYPES = Object.keys(require('prop-types')); +const Components = require('../util/Components'); +const docsUrl = require('../util/docsUrl'); +const componentUtil = require('../util/componentUtil'); +const report = require('../util/report'); +const lifecycleMethods = require('../util/lifecycleMethods'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const STATIC_CLASS_PROPERTIES = ['propTypes', 'contextTypes', 'childContextTypes', 'defaultProps']; + +const messages = { + typoPropTypeChain: 'Typo in prop type chain qualifier: {{name}}', + typoPropType: 'Typo in declared prop type: {{name}}', + typoStaticClassProp: 'Typo in static class property declaration', + typoPropDeclaration: 'Typo in property declaration', + typoLifecycleMethod: 'Typo in component lifecycle method declaration: {{actual}} should be {{expected}}', + staticLifecycleMethod: 'Lifecycle method should be static: {{method}}', + noPropTypesBinding: '`\'prop-types\'` imported without a local `PropTypes` binding.', + noReactBinding: '`\'react\'` imported without a local `React` binding.', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow common typos', + category: 'Stylistic Issues', + recommended: false, + url: docsUrl('no-typos'), + }, + + messages, + + schema: [], + }, + + create: Components.detect((context, components, utils) => { + let propTypesPackageName = null; + let reactPackageName = null; + + function checkValidPropTypeQualifier(node) { + if (node.name !== 'isRequired') { + report(context, messages.typoPropTypeChain, 'typoPropTypeChain', { + node, + data: { name: node.name }, + }); + } + } + + function checkValidPropType(node) { + if (node.name && !PROP_TYPES.some((propTypeName) => propTypeName === node.name)) { + report(context, messages.typoPropType, 'typoPropType', { + node, + data: { name: node.name }, + }); + } + } + + function isPropTypesPackage(node) { + return ( + node.type === 'Identifier' + && node.name === propTypesPackageName + ) || ( + node.type === 'MemberExpression' + && node.property.name === 'PropTypes' + && node.object.name === reactPackageName + ); + } + + /* eslint-disable no-use-before-define */ + + function checkValidCallExpression(node) { + const callee = node.callee; + if (callee.type === 'MemberExpression' && callee.property.name === 'shape') { + checkValidPropObject(node.arguments[0]); + } else if (callee.type === 'MemberExpression' && callee.property.name === 'oneOfType') { + const args = node.arguments[0]; + if (args && args.type === 'ArrayExpression') { + args.elements.forEach((el) => { + checkValidProp(el); + }); + } + } + } + + function checkValidProp(node) { + if ((!propTypesPackageName && !reactPackageName) || !node) { + return; + } + + if (node.type === 'MemberExpression') { + if ( + node.object.type === 'MemberExpression' + && isPropTypesPackage(node.object.object) + ) { // PropTypes.myProp.isRequired + checkValidPropType(node.object.property); + checkValidPropTypeQualifier(node.property); + } else if ( + isPropTypesPackage(node.object) + && node.property.name !== 'isRequired' + ) { // PropTypes.myProp + checkValidPropType(node.property); + } else if (node.object.type === 'CallExpression') { + checkValidPropTypeQualifier(node.property); + checkValidCallExpression(node.object); + } + } else if (node.type === 'CallExpression') { + checkValidCallExpression(node); + } + } + + /* eslint-enable no-use-before-define */ + + function checkValidPropObject(node) { + if (node && node.type === 'ObjectExpression') { + node.properties.forEach((prop) => checkValidProp(prop.value)); + } + } + + function reportErrorIfPropertyCasingTypo(propertyValue, propertyKey, isClassProperty) { + const propertyName = propertyKey.name; + if (propertyName === 'propTypes' || propertyName === 'contextTypes' || propertyName === 'childContextTypes') { + checkValidPropObject(propertyValue); + } + STATIC_CLASS_PROPERTIES.forEach((CLASS_PROP) => { + if (propertyName && CLASS_PROP.toLowerCase() === propertyName.toLowerCase() && CLASS_PROP !== propertyName) { + const messageId = isClassProperty + ? 'typoStaticClassProp' + : 'typoPropDeclaration'; + report(context, messages[messageId], messageId, { + node: propertyKey, + }); + } + }); + } + + function reportErrorIfLifecycleMethodCasingTypo(node) { + const key = node.key; + let nodeKeyName = key.name; + if (key.type === 'Literal') { + nodeKeyName = key.value; + } + if (key.type === 'PrivateName' || (node.computed && typeof nodeKeyName !== 'string')) { + return; + } + + lifecycleMethods.static.forEach((method) => { + if (!node.static && nodeKeyName && nodeKeyName.toLowerCase() === method.toLowerCase()) { + report(context, messages.staticLifecycleMethod, 'staticLifecycleMethod', { + node, + data: { + method: nodeKeyName, + }, + }); + } + }); + + lifecycleMethods.instance.concat(lifecycleMethods.static).forEach((method) => { + if (nodeKeyName && method.toLowerCase() === nodeKeyName.toLowerCase() && method !== nodeKeyName) { + report(context, messages.typoLifecycleMethod, 'typoLifecycleMethod', { + node, + data: { actual: nodeKeyName, expected: method }, + }); + } + }); + } + + return { + ImportDeclaration(node) { + if (node.source && node.source.value === 'prop-types') { // import PropType from "prop-types" + if (node.specifiers.length > 0) { + propTypesPackageName = node.specifiers[0].local.name; + } else { + report(context, messages.noPropTypesBinding, 'noPropTypesBinding', { + node, + }); + } + } else if (node.source && node.source.value === 'react') { // import { PropTypes } from "react" + if (node.specifiers.length > 0) { + reactPackageName = node.specifiers[0].local.name; // guard against accidental anonymous `import "react"` + } else { + report(context, messages.noReactBinding, 'noReactBinding', { + node, + }); + } + if (node.specifiers.length >= 1) { + const propTypesSpecifier = node.specifiers.find((specifier) => ( + specifier.imported && specifier.imported.name === 'PropTypes' + )); + if (propTypesSpecifier) { + propTypesPackageName = propTypesSpecifier.local.name; + } + } + } + }, + + 'ClassProperty, PropertyDefinition'(node) { + if (!node.static || !componentUtil.isES6Component(node.parent.parent, context)) { + return; + } + + reportErrorIfPropertyCasingTypo(node.value, node.key, true); + }, + + MemberExpression(node) { + const propertyName = node.property.name; + + if ( + !propertyName + || STATIC_CLASS_PROPERTIES.map((prop) => prop.toLocaleLowerCase()).indexOf(propertyName.toLowerCase()) === -1 + ) { + return; + } + + const relatedComponent = utils.getRelatedComponent(node); + + if ( + relatedComponent + && (componentUtil.isES6Component(relatedComponent.node, context) || ( + relatedComponent.node.type !== 'ClassDeclaration' && utils.isReturningJSX(relatedComponent.node))) + && (node.parent && node.parent.type === 'AssignmentExpression' && node.parent.right) + ) { + reportErrorIfPropertyCasingTypo(node.parent.right, node.property, true); + } + }, + + MethodDefinition(node) { + if (!componentUtil.isES6Component(node.parent.parent, context)) { + return; + } + + reportErrorIfLifecycleMethodCasingTypo(node); + }, + + ObjectExpression(node) { + const component = componentUtil.isES5Component(node, context) && components.get(node); + + if (!component) { + return; + } + + node.properties.forEach((property) => { + if (property.type !== 'SpreadElement') { + reportErrorIfPropertyCasingTypo(property.value, property.key, false); + reportErrorIfLifecycleMethodCasingTypo(property); + } + }); + }, + }; + }), +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-unescaped-entities.js b/node_modules/eslint-plugin-react/lib/rules/no-unescaped-entities.js new file mode 100644 index 000000000..9aedd4765 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-unescaped-entities.js @@ -0,0 +1,133 @@ +/** + * @fileoverview HTML special characters should be escaped. + * @author Patrick Hayes + */ + +'use strict'; + +const docsUrl = require('../util/docsUrl'); +const jsxUtil = require('../util/jsx'); +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +// NOTE: '<' and '{' are also problematic characters, but they do not need +// to be included here because it is a syntax error when these characters are +// included accidentally. +const DEFAULTS = [{ + char: '>', + alternatives: ['>'], +}, { + char: '"', + alternatives: ['"', '“', '"', '”'], +}, { + char: '\'', + alternatives: [''', '‘', ''', '’'], +}, { + char: '}', + alternatives: ['}'], +}]; + +const messages = { + unescapedEntity: 'HTML entity, `{{entity}}` , must be escaped.', + unescapedEntityAlts: '`{{entity}}` can be escaped with {{alts}}.', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow unescaped HTML entities from appearing in markup', + category: 'Possible Errors', + recommended: true, + url: docsUrl('no-unescaped-entities'), + }, + + messages, + + schema: [{ + type: 'object', + properties: { + forbid: { + type: 'array', + items: { + oneOf: [{ + type: 'string', + }, { + type: 'object', + properties: { + char: { + type: 'string', + }, + alternatives: { + type: 'array', + uniqueItems: true, + items: { + type: 'string', + }, + }, + }, + }], + }, + }, + }, + additionalProperties: false, + }], + }, + + create(context) { + function reportInvalidEntity(node) { + const configuration = context.options[0] || {}; + const entities = configuration.forbid || DEFAULTS; + + // HTML entities are already escaped in node.value (as well as node.raw), + // so pull the raw text from context.getSourceCode() + for (let i = node.loc.start.line; i <= node.loc.end.line; i++) { + let rawLine = context.getSourceCode().lines[i - 1]; + let start = 0; + let end = rawLine.length; + if (i === node.loc.start.line) { + start = node.loc.start.column; + } + if (i === node.loc.end.line) { + end = node.loc.end.column; + } + rawLine = rawLine.substring(start, end); + for (let j = 0; j < entities.length; j++) { + for (let index = 0; index < rawLine.length; index++) { + const c = rawLine[index]; + if (typeof entities[j] === 'string') { + if (c === entities[j]) { + report(context, messages.unescapedEntity, 'unescapedEntity', { + node, + loc: { line: i, column: start + index }, + data: { + entity: entities[j], + }, + }); + } + } else if (c === entities[j].char) { + report(context, messages.unescapedEntityAlts, 'unescapedEntityAlts', { + node, + loc: { line: i, column: start + index }, + data: { + entity: entities[j].char, + alts: entities[j].alternatives.map((alt) => `\`${alt}\``).join(', '), + }, + }); + } + } + } + } + } + + return { + 'Literal, JSXText'(node) { + if (jsxUtil.isJSX(node.parent)) { + reportInvalidEntity(node); + } + }, + }; + }, +}; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-unknown-property.js b/node_modules/eslint-plugin-react/lib/rules/no-unknown-property.js new file mode 100644 index 000000000..af64a3346 --- /dev/null +++ b/node_modules/eslint-plugin-react/lib/rules/no-unknown-property.js @@ -0,0 +1,601 @@ +/** + * @fileoverview Prevent usage of unknown DOM property + * @author Yannick Croissant + */ + +'use strict'; + +const has = require('object.hasown/polyfill')(); +const docsUrl = require('../util/docsUrl'); +const testReactVersion = require('../util/version').testReactVersion; +const report = require('../util/report'); + +// ------------------------------------------------------------------------------ +// Constants +// ------------------------------------------------------------------------------ + +const DEFAULTS = { + ignore: [], +}; + +const DOM_ATTRIBUTE_NAMES = { + 'accept-charset': 'acceptCharset', + class: 'className', + 'http-equiv': 'httpEquiv', + crossorigin: 'crossOrigin', + for: 'htmlFor', + nomodule: 'noModule', +}; + +const ATTRIBUTE_TAGS_MAP = { + abbr: ['th', 'td'], + checked: ['input'], + // image is required for SVG support, all other tags are HTML. + crossOrigin: ['script', 'img', 'video', 'audio', 'link', 'image'], + // https://html.spec.whatwg.org/multipage/links.html#downloading-resources + download: ['a', 'area'], + fill: [ // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill + // Fill color + 'altGlyph', + 'circle', + 'ellipse', + 'g', + 'line', + 'mask', + 'path', + 'polygon', + 'polyline', + 'rect', + 'svg', + 'text', + 'textPath', + 'tref', + 'tspan', + 'use', + // Animation final state + 'animate', + 'animateColor', + 'animateMotion', + 'animateTransform', + 'set', + ], + focusable: ['svg'], + imageSizes: ['link'], + imageSrcSet: ['link'], + property: ['meta'], + viewBox: ['marker', 'pattern', 'svg', 'symbol', 'view'], + as: ['link'], + align: ['applet', 'caption', 'col', 'colgroup', 'hr', 'iframe', 'img', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr'], // deprecated, but known + valign: ['tr', 'td', 'th', 'thead', 'tbody', 'tfoot', 'colgroup', 'col'], // deprecated, but known + noModule: ['script'], + // Media events allowed only on audio and video tags, see https://github.com/facebook/react/blob/256aefbea1449869620fb26f6ec695536ab453f5/CHANGELOG.md#notable-enhancements + onAbort: ['audio', 'video'], + onCanPlay: ['audio', 'video'], + onCanPlayThrough: ['audio', 'video'], + onDurationChange: ['audio', 'video'], + onEmptied: ['audio', 'video'], + onEncrypted: ['audio', 'video'], + onEnded: ['audio', 'video'], + onError: ['audio', 'video', 'img', 'link', 'source', 'script', 'picture', 'iframe'], + onLoad: ['script', 'img', 'link', 'picture', 'iframe', 'object'], + onLoadedData: ['audio', 'video'], + onLoadedMetadata: ['audio', 'video'], + onLoadStart: ['audio', 'video'], + onPause: ['audio', 'video'], + onPlay: ['audio', 'video'], + onPlaying: ['audio', 'video'], + onProgress: ['audio', 'video'], + onRateChange: ['audio', 'video'], + onSeeked: ['audio', 'video'], + onSeeking: ['audio', 'video'], + onStalled: ['audio', 'video'], + onSuspend: ['audio', 'video'], + onTimeUpdate: ['audio', 'video'], + onVolumeChange: ['audio', 'video'], + onWaiting: ['audio', 'video'], + autoPictureInPicture: ['video'], + controls: ['audio', 'video'], + controlsList: ['audio', 'video'], + disablePictureInPicture: ['video'], + disableRemotePlayback: ['audio', 'video'], + loop: ['audio', 'video'], + muted: ['audio', 'video'], + playsInline: ['video'], + poster: ['video'], + preload: ['audio', 'video'], + scrolling: ['iframe'], +}; + +const SVGDOM_ATTRIBUTE_NAMES = { + 'accent-height': 'accentHeight', + 'alignment-baseline': 'alignmentBaseline', + 'arabic-form': 'arabicForm', + 'baseline-shift': 'baselineShift', + 'cap-height': 'capHeight', + 'clip-path': 'clipPath', + 'clip-rule': 'clipRule', + 'color-interpolation': 'colorInterpolation', + 'color-interpolation-filters': 'colorInterpolationFilters', + 'color-profile': 'colorProfile', + 'color-rendering': 'colorRendering', + 'dominant-baseline': 'dominantBaseline', + 'enable-background': 'enableBackground', + 'fill-opacity': 'fillOpacity', + 'fill-rule': 'fillRule', + 'flood-color': 'floodColor', + 'flood-opacity': 'floodOpacity', + 'font-family': 'fontFamily', + 'font-size': 'fontSize', + 'font-size-adjust': 'fontSizeAdjust', + 'font-stretch': 'fontStretch', + 'font-style': 'fontStyle', + 'font-variant': 'fontVariant', + 'font-weight': 'fontWeight', + 'glyph-name': 'glyphName', + 'glyph-orientation-horizontal': 'glyphOrientationHorizontal', + 'glyph-orientation-vertical': 'glyphOrientationVertical', + 'horiz-adv-x': 'horizAdvX', + 'horiz-origin-x': 'horizOriginX', + 'image-rendering': 'imageRendering', + 'letter-spacing': 'letterSpacing', + 'lighting-color': 'lightingColor', + 'marker-end': 'markerEnd', + 'marker-mid': 'markerMid', + 'marker-start': 'markerStart', + 'overline-position': 'overlinePosition', + 'overline-thickness': 'overlineThickness', + 'paint-order': 'paintOrder', + 'panose-1': 'panose1', + 'pointer-events': 'pointerEvents', + 'rendering-intent': 'renderingIntent', + 'shape-rendering': 'shapeRendering', + 'stop-color': 'stopColor', + 'stop-opacity': 'stopOpacity', + 'strikethrough-position': 'strikethroughPosition', + 'strikethrough-thickness': 'strikethroughThickness', + 'stroke-dasharray': 'strokeDasharray', + 'stroke-dashoffset': 'strokeDashoffset', + 'stroke-linecap': 'strokeLinecap', + 'stroke-linejoin': 'strokeLinejoin', + 'stroke-miterlimit': 'strokeMiterlimit', + 'stroke-opacity': 'strokeOpacity', + 'stroke-width': 'strokeWidth', + 'text-anchor': 'textAnchor', + 'text-decoration': 'textDecoration', + 'text-rendering': 'textRendering', + 'underline-position': 'underlinePosition', + 'underline-thickness': 'underlineThickness', + 'unicode-bidi': 'unicodeBidi', + 'unicode-range': 'unicodeRange', + 'units-per-em': 'unitsPerEm', + 'v-alphabetic': 'vAlphabetic', + 'v-hanging': 'vHanging', + 'v-ideographic': 'vIdeographic', + 'v-mathematical': 'vMathematical', + 'vector-effect': 'vectorEffect', + 'vert-adv-y': 'vertAdvY', + 'vert-origin-x': 'vertOriginX', + 'vert-origin-y': 'vertOriginY', + 'word-spacing': 'wordSpacing', + 'writing-mode': 'writingMode', + 'x-height': 'xHeight', + 'xlink:actuate': 'xlinkActuate', + 'xlink:arcrole': 'xlinkArcrole', + 'xlink:href': 'xlinkHref', + 'xlink:role': 'xlinkRole', + 'xlink:show': 'xlinkShow', + 'xlink:title': 'xlinkTitle', + 'xlink:type': 'xlinkType', + 'xml:base': 'xmlBase', + 'xml:lang': 'xmlLang', + 'xml:space': 'xmlSpace', +}; + +const DOM_PROPERTY_NAMES_ONE_WORD = [ + // Global attributes - can be used on any HTML/DOM element + // See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes + 'dir', 'draggable', 'hidden', 'id', 'lang', 'nonce', 'part', 'slot', 'style', 'title', 'translate', + // Element specific attributes + // See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes (includes global attributes too) + // To be considered if these should be added also to ATTRIBUTE_TAGS_MAP + 'accept', 'action', 'allow', 'alt', 'as', 'async', 'buffered', 'capture', 'challenge', 'cite', 'code', 'cols', + 'content', 'coords', 'csp', 'data', 'decoding', 'default', 'defer', 'disabled', 'form', + 'headers', 'height', 'high', 'href', 'icon', 'importance', 'integrity', 'kind', 'label', + 'language', 'loading', 'list', 'loop', 'low', 'manifest', 'max', 'media', 'method', 'min', 'multiple', 'muted', + 'name', 'open', 'optimum', 'pattern', 'ping', 'placeholder', 'poster', 'preload', 'profile', + 'rel', 'required', 'reversed', 'role', 'rows', 'sandbox', 'scope', 'seamless', 'selected', 'shape', 'size', 'sizes', + 'span', 'src', 'start', 'step', 'summary', 'target', 'type', 'value', 'width', 'wmode', 'wrap', + // SVG attributes + // See https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute + 'accumulate', 'additive', 'alphabetic', 'amplitude', 'ascent', 'azimuth', 'bbox', 'begin', + 'bias', 'by', 'clip', 'color', 'cursor', 'cx', 'cy', 'd', 'decelerate', 'descent', 'direction', + 'display', 'divisor', 'dur', 'dx', 'dy', 'elevation', 'end', 'exponent', 'fill', 'filter', + 'format', 'from', 'fr', 'fx', 'fy', 'g1', 'g2', 'hanging', 'height', 'hreflang', 'ideographic', + 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'local', 'mask', 'mode', + 'offset', 'opacity', 'operator', 'order', 'orient', 'orientation', 'origin', 'overflow', 'path', + 'ping', 'points', 'r', 'radius', 'rel', 'restart', 'result', 'rotate', 'rx', 'ry', 'scale', + 'seed', 'slope', 'spacing', 'speed', 'stemh', 'stemv', 'string', 'stroke', 'to', 'transform', + 'u1', 'u2', 'unicode', 'values', 'version', 'visibility', 'widths', 'x', 'x1', 'x2', 'xmlns', + 'y', 'y1', 'y2', 'z', + // OpenGraph meta tag attributes + 'property', + // React specific attributes + 'ref', 'key', 'children', + // Non-standard + 'results', 'security', + // Video specific + 'controls', +]; + +const DOM_PROPERTY_NAMES_TWO_WORDS = [ + // Global attributes - can be used on any HTML/DOM element + // See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes + 'accessKey', 'autoCapitalize', 'autoFocus', 'contentEditable', 'enterKeyHint', 'exportParts', + 'inputMode', 'itemID', 'itemRef', 'itemProp', 'itemScope', 'itemType', 'spellCheck', 'tabIndex', + // Element specific attributes + // See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes (includes global attributes too) + // To be considered if these should be added also to ATTRIBUTE_TAGS_MAP + 'acceptCharset', 'autoComplete', 'autoPlay', 'border', 'cellPadding', 'cellSpacing', 'classID', 'codeBase', + 'colSpan', 'contextMenu', 'dateTime', 'encType', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget', + 'frameBorder', 'hrefLang', 'httpEquiv', 'imageSizes', 'imageSrcSet', 'isMap', 'keyParams', 'keyType', 'marginHeight', 'marginWidth', + 'maxLength', 'mediaGroup', 'minLength', 'noValidate', 'onAnimationEnd', 'onAnimationIteration', 'onAnimationStart', + 'onBlur', 'onChange', 'onClick', 'onContextMenu', 'onCopy', 'onCompositionEnd', 'onCompositionStart', + 'onCompositionUpdate', 'onCut', 'onDoubleClick', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragExit', 'onDragLeave', + 'onError', 'onFocus', 'onInput', 'onKeyDown', 'onKeyPress', 'onKeyUp', 'onLoad', 'onWheel', 'onDragOver', + 'onDragStart', 'onDrop', 'onMouseDown', 'onMouseEnter', 'onMouseLeave', 'onMouseMove', 'onMouseOut', 'onMouseOver', + 'onMouseUp', 'onPaste', 'onScroll', 'onSelect', 'onSubmit', 'onToggle', 'onTransitionEnd', 'radioGroup', 'readOnly', 'referrerPolicy', + 'rowSpan', 'srcDoc', 'srcLang', 'srcSet', 'useMap', + // SVG attributes + // See https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute + 'crossOrigin', 'accentHeight', 'alignmentBaseline', 'arabicForm', 'attributeName', + 'attributeType', 'baseFrequency', 'baselineShift', 'baseProfile', 'calcMode', 'capHeight', + 'clipPathUnits', 'clipPath', 'clipRule', 'colorInterpolation', 'colorInterpolationFilters', + 'colorProfile', 'colorRendering', 'contentScriptType', 'contentStyleType', 'diffuseConstant', + 'dominantBaseline', 'edgeMode', 'enableBackground', 'fillOpacity', 'fillRule', 'filterRes', + 'filterUnits', 'floodColor', 'floodOpacity', 'fontFamily', 'fontSize', 'fontSizeAdjust', + 'fontStretch', 'fontStyle', 'fontVariant', 'fontWeight', 'glyphName', + 'glyphOrientationHorizontal', 'glyphOrientationVertical', 'glyphRef', 'gradientTransform', + 'gradientUnits', 'horizAdvX', 'horizOriginX', 'imageRendering', 'kernelMatrix', + 'kernelUnitLength', 'keyPoints', 'keySplines', 'keyTimes', 'lengthAdjust', 'letterSpacing', + 'lightingColor', 'limitingConeAngle', 'markerEnd', 'markerMid', 'markerStart', 'markerHeight', + 'markerUnits', 'markerWidth', 'maskContentUnits', 'maskUnits', 'mathematical', 'numOctaves', + 'overlinePosition', 'overlineThickness', 'panose1', 'paintOrder', 'pathLength', + 'patternContentUnits', 'patternTransform', 'patternUnits', 'pointerEvents', 'pointsAtX', + 'pointsAtY', 'pointsAtZ', 'preserveAlpha', 'preserveAspectRatio', 'primitiveUnits', + 'referrerPolicy', 'refX', 'refY', 'rendering-intent', 'repeatCount', 'repeatDur', + 'requiredExtensions', 'requiredFeatures', 'shapeRendering', 'specularConstant', + 'specularExponent', 'spreadMethod', 'startOffset', 'stdDeviation', 'stitchTiles', 'stopColor', + 'stopOpacity', 'strikethroughPosition', 'strikethroughThickness', 'strokeDasharray', + 'strokeDashoffset', 'strokeLinecap', 'strokeLinejoin', 'strokeMiterlimit', 'strokeOpacity', + 'strokeWidth', 'surfaceScale', 'systemLanguage', 'tableValues', 'targetX', 'targetY', + 'textAnchor', 'textDecoration', 'textRendering', 'textLength', 'transformOrigin', + 'underlinePosition', 'underlineThickness', 'unicodeBidi', 'unicodeRange', 'unitsPerEm', + 'vAlphabetic', 'vHanging', 'vIdeographic', 'vMathematical', 'vectorEffect', 'vertAdvY', + 'vertOriginX', 'vertOriginY', 'viewBox', 'viewTarget', 'wordSpacing', 'writingMode', 'xHeight', + 'xChannelSelector', 'xlinkActuate', 'xlinkArcrole', 'xlinkHref', 'xlinkRole', 'xlinkShow', + 'xlinkTitle', 'xlinkType', 'xmlBase', 'xmlLang', 'xmlnsXlink', 'xmlSpace', 'yChannelSelector', + 'zoomAndPan', + // Safari/Apple specific, no listing available + 'autoCorrect', // https://stackoverflow.com/questions/47985384/html-autocorrect-for-text-input-is-not-working + 'autoSave', // https://stackoverflow.com/questions/25456396/what-is-autosave-attribute-supposed-to-do-how-do-i-use-it + // React specific attributes https://reactjs.org/docs/dom-elements.html#differences-in-attributes + 'className', 'dangerouslySetInnerHTML', 'defaultValue', 'defaultChecked', 'htmlFor', + // Events' capture events + 'onBeforeInput', 'onChange', + 'onInvalid', 'onReset', 'onTouchCancel', 'onTouchEnd', 'onTouchMove', 'onTouchStart', 'suppressContentEditableWarning', 'suppressHydrationWarning', + 'onAbort', 'onCanPlay', 'onCanPlayThrough', 'onDurationChange', 'onEmptied', 'onEncrypted', 'onEnded', + 'onLoadedData', 'onLoadedMetadata', 'onLoadStart', 'onPause', 'onPlay', 'onPlaying', 'onProgress', 'onRateChange', + 'onSeeked', 'onSeeking', 'onStalled', 'onSuspend', 'onTimeUpdate', 'onVolumeChange', 'onWaiting', + 'onCopyCapture', 'onCutCapture', 'onPasteCapture', 'onCompositionEndCapture', 'onCompositionStartCapture', 'onCompositionUpdateCapture', + 'onFocusCapture', 'onBlurCapture', 'onChangeCapture', 'onBeforeInputCapture', 'onInputCapture', 'onResetCapture', 'onSubmitCapture', + 'onInvalidCapture', 'onLoadCapture', 'onErrorCapture', 'onKeyDownCapture', 'onKeyPressCapture', 'onKeyUpCapture', + 'onAbortCapture', 'onCanPlayCapture', 'onCanPlayThroughCapture', 'onDurationChangeCapture', 'onEmptiedCapture', 'onEncryptedCapture', + 'onEndedCapture', 'onLoadedDataCapture', 'onLoadedMetadataCapture', 'onLoadStartCapture', 'onPauseCapture', 'onPlayCapture', + 'onPlayingCapture', 'onProgressCapture', 'onRateChangeCapture', 'onSeekedCapture', 'onSeekingCapture', 'onStalledCapture', 'onSuspendCapture', + 'onTimeUpdateCapture', 'onVolumeChangeCapture', 'onWaitingCapture', 'onSelectCapture', 'onTouchCancelCapture', 'onTouchEndCapture', + 'onTouchMoveCapture', 'onTouchStartCapture', 'onScrollCapture', 'onWheelCapture', 'onAnimationEndCapture', 'onAnimationIteration', + 'onAnimationStartCapture', 'onTransitionEndCapture', + 'onAuxClick', 'onAuxClickCapture', 'onClickCapture', 'onContextMenuCapture', 'onDoubleClickCapture', + 'onDragCapture', 'onDragEndCapture', 'onDragEnterCapture', 'onDragExitCapture', 'onDragLeaveCapture', + 'onDragOverCapture', 'onDragStartCapture', 'onDropCapture', 'onMouseDown', 'onMouseDownCapture', + 'onMouseMoveCapture', 'onMouseOutCapture', 'onMouseOverCapture', 'onMouseUpCapture', + // Video specific + 'autoPictureInPicture', 'controlsList', 'disablePictureInPicture', 'disableRemotePlayback', +]; + +const DOM_PROPERTIES_IGNORE_CASE = ['charset', 'allowFullScreen', 'webkitAllowFullScreen', 'mozAllowFullScreen']; + +const ARIA_PROPERTIES = [ + // See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes + // Global attributes + 'aria-atomic', 'aria-braillelabel', 'aria-brailleroledescription', 'aria-busy', 'aria-controls', 'aria-current', + 'aria-describedby', 'aria-description', 'aria-details', + 'aria-disabled', 'aria-dropeffect', 'aria-errormessage', 'aria-flowto', 'aria-grabbed', 'aria-haspopup', + 'aria-hidden', 'aria-invalid', 'aria-keyshortcuts', 'aria-label', 'aria-labelledby', 'aria-live', + 'aria-owns', 'aria-relevant', 'aria-roledescription', + // Widget attributes + 'aria-autocomplete', 'aria-checked', 'aria-expanded', 'aria-level', 'aria-modal', 'aria-multiline', 'aria-multiselectable', + 'aria-orientation', 'aria-placeholder', 'aria-pressed', 'aria-readonly', 'aria-required', 'aria-selected', + 'aria-sort', 'aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext', + // Relationship attributes + 'aria-activedescendant', 'aria-colcount', 'aria-colindex', 'aria-colindextext', 'aria-colspan', + 'aria-posinset', 'aria-rowcount', 'aria-rowindex', 'aria-rowindextext', 'aria-rowspan', 'aria-setsize', +]; + +const REACT_ON_PROPS = [ + 'onGotPointerCapture', + 'onGotPointerCaptureCapture', + 'onLostPointerCapture', + 'onLostPointerCapture', + 'onLostPointerCaptureCapture', + 'onPointerCancel', + 'onPointerCancelCapture', + 'onPointerDown', + 'onPointerDownCapture', + 'onPointerEnter', + 'onPointerEnterCapture', + 'onPointerLeave', + 'onPointerLeaveCapture', + 'onPointerMove', + 'onPointerMoveCapture', + 'onPointerOut', + 'onPointerOutCapture', + 'onPointerOver', + 'onPointerOverCapture', + 'onPointerUp', + 'onPointerUpCapture', +]; + +function getDOMPropertyNames(context) { + const ALL_DOM_PROPERTY_NAMES = DOM_PROPERTY_NAMES_TWO_WORDS.concat(DOM_PROPERTY_NAMES_ONE_WORD); + // this was removed in React v16.1+, see https://github.com/facebook/react/pull/10823 + if (!testReactVersion(context, '>= 16.1.0')) { + return ALL_DOM_PROPERTY_NAMES.concat('allowTransparency'); + } + // these were added in React v16.4.0, see https://reactjs.org/blog/2018/05/23/react-v-16-4.html and https://github.com/facebook/react/pull/12507 + if (testReactVersion(context, '>= 16.4.0')) { + return ALL_DOM_PROPERTY_NAMES.concat(REACT_ON_PROPS); + } + return ALL_DOM_PROPERTY_NAMES; +} + +// ------------------------------------------------------------------------------ +// Helpers +// ------------------------------------------------------------------------------ + +/** + * Checks if a node's parent is a JSX tag that is written with lowercase letters, + * and is not a custom web component. Custom web components have a hyphen in tag name, + * or have an `is="some-elem"` attribute. + * + * Note: does not check if a tag's parent against a list of standard HTML/DOM tags. For example, + * a ``'s child would return `true` because "fake" is written only with lowercase letters + * without a hyphen and does not have a `is="some-elem"` attribute. + * + * @param {Object} childNode - JSX element being tested. + * @returns {boolean} Whether or not the node name match the JSX tag convention. + */ +function isValidHTMLTagInJSX(childNode) { + const tagConvention = /^[a-z][^-]*$/; + if (tagConvention.test(childNode.parent.name.name)) { + return !childNode.parent.attributes.some((attrNode) => ( + attrNode.type === 'JSXAttribute' + && attrNode.name.type === 'JSXIdentifier' + && attrNode.name.name === 'is' + // To learn more about custom web components and `is` attribute, + // see https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-customized-builtin-example + + )); + } + return false; +} + +/** + * Checks if an attribute name is a valid `data-*` attribute: + * if the name starts with "data-" and has alphanumeric words (browsers require lowercase, but React and TS lowercase them), + * not start with any casing of "xml", and separated by hyphens (-) (which is also called "kebab case" or "dash case"), + * then the attribute is a valid data attribute. + * + * @param {String} name - Attribute name to be tested + * @returns {boolean} Result + */ +function isValidDataAttribute(name) { + return /^data(-[^:]*)*$/.test(name) && !/^data-xml/i.test(name); +} + +/** + * Checks if an attribute name is a standard aria attribute by compering it to a list + * of standard aria property names + * + * @param {String} name - Attribute name to be tested + * @returns {Boolean} Result + */ + +function isValidAriaAttribute(name) { + return ARIA_PROPERTIES.some((element) => element === name); +} + +/** + * Checks if the attribute name is included in the attributes that are excluded + * from the camel casing. + * + * // returns true + * @example isCaseIgnoredAttribute('charSet') + * + * Note - these exclusions are not made by React core team, but `eslint-plugin-react` community. + * + * @param {String} name - Attribute name to be tested + * @returns {Boolean} Result + */ + +function isCaseIgnoredAttribute(name) { + return DOM_PROPERTIES_IGNORE_CASE.some((element) => element.toLowerCase() === name.toLowerCase()); +} + +/** + * Extracts the tag name for the JSXAttribute + * @param {JSXAttribute} node - JSXAttribute being tested. + * @returns {String|null} tag name + */ +function getTagName(node) { + if (node && node.parent && node.parent.name && node.parent.name) { + return node.parent.name.name; + } + return null; +} + +/** + * Test wether the tag name for the JSXAttribute is + * something like + * @param {JSXAttribute} node - JSXAttribute being tested. + * @returns {Boolean} result + */ +function tagNameHasDot(node) { + return !!( + node.parent + && node.parent.name + && node.parent.name.type === 'JSXMemberExpression' + ); +} + +/** + * Get the standard name of the attribute. + * @param {String} name - Name of the attribute. + * @param {String} context - eslint context + * @returns {String | undefined} The standard name of the attribute, or undefined if no standard name was found. + */ +function getStandardName(name, context) { + if (has(DOM_ATTRIBUTE_NAMES, name)) { + return DOM_ATTRIBUTE_NAMES[name]; + } + if (has(SVGDOM_ATTRIBUTE_NAMES, name)) { + return SVGDOM_ATTRIBUTE_NAMES[name]; + } + const names = getDOMPropertyNames(context); + // Let's find a possible attribute match with a case-insensitive search. + return names.find((element) => element.toLowerCase() === name.toLowerCase()); +} + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +const messages = { + invalidPropOnTag: 'Invalid property \'{{name}}\' found on tag \'{{tagName}}\', but it is only allowed on: {{allowedTags}}', + unknownPropWithStandardName: 'Unknown property \'{{name}}\' found, use \'{{standardName}}\' instead', + unknownProp: 'Unknown property \'{{name}}\' found', +}; + +module.exports = { + meta: { + docs: { + description: 'Disallow usage of unknown DOM property', + category: 'Possible Errors', + recommended: true, + url: docsUrl('no-unknown-property'), + }, + fixable: 'code', + + messages, + + schema: [{ + type: 'object', + properties: { + ignore: { + type: 'array', + items: { + type: 'string', + }, + }, + }, + additionalProperties: false, + }], + }, + + create(context) { + function getIgnoreConfig() { + return (context.options[0] && context.options[0].ignore) || DEFAULTS.ignore; + } + + return { + JSXAttribute(node) { + const ignoreNames = getIgnoreConfig(); + const name = context.getSourceCode().getText(node.name); + if (ignoreNames.indexOf(name) >= 0) { + return; + } + + // Ignore tags like + if (tagNameHasDot(node)) { + return; + } + + if (isValidDataAttribute(name)) { return; } + + if (isValidAriaAttribute(name)) { return; } + + if (isCaseIgnoredAttribute(name)) { return; } + + const tagName = getTagName(node); + + if (tagName === 'fbt') { return; } // fbt nodes are bonkers, let's not go there + + if (!isValidHTMLTagInJSX(node)) { return; } + + // Let's dive deeper into tags that are HTML/DOM elements (`