From 7f1ce374e0f1311743e2b8023e6242a79e03eb01 Mon Sep 17 00:00:00 2001 From: ylemkimon Date: Mon, 13 Aug 2018 11:26:46 +0900 Subject: [PATCH] Lint against function polyfills that may be expensive (#1597) * Lint against polyfills that may be expensive * Exclude test file from source code linting --- .eslintrc | 8 +++++--- package.json | 1 + yarn.lock | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.eslintrc b/.eslintrc index ac6c841d..7c3af076 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,7 +1,8 @@ { "parser": "babel-eslint", "plugins": [ - "flowtype" + "flowtype", + "transform-runtime-aliasing" ], "extends": [ "eslint:recommended", @@ -72,9 +73,10 @@ }, "overrides": [{ "files": ["katex.js", "src/**/*.js", "contrib/**/*.js"], - "excludedFiles": "unicodeMake.js", + "excludedFiles": ["*-spec.js", "unicodeMake.js"], "rules": { - "no-restricted-syntax": [2, "ForOfStatement", "ClassDeclaration[superClass]", "ClassExpression[superClass]"] + "no-restricted-syntax": [2, "ForOfStatement", "ClassDeclaration[superClass]", "ClassExpression[superClass]"], + "transform-runtime-aliasing/no-transform-runtime-aliasing": 2 } }], "env": { diff --git a/package.json b/package.json index faf24b7d..7830d4e8 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "eslint": "^5.0.0", "eslint-plugin-flowtype": "^2.40.1", "eslint-plugin-react": "^7.10.0", + "eslint-plugin-transform-runtime-aliasing": "^0.1.1", "file-loader": "^1.1.11", "flow-bin": "^0.78.0", "husky": "^1.0.0-rc.8", diff --git a/yarn.lock b/yarn.lock index b7b26069..5871aa97 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2407,6 +2407,10 @@ eslint-plugin-react@^7.10.0: jsx-ast-utils "^2.0.1" prop-types "^15.6.2" +eslint-plugin-transform-runtime-aliasing@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-transform-runtime-aliasing/-/eslint-plugin-transform-runtime-aliasing-0.1.1.tgz#1f496a2e4a0ebf7cad8486ae70c034bda06ac0f3" + eslint-scope@3.7.1: version "3.7.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8"