Bug 1610923 - Point npm run testmc to use mach to avoid error with linting r=thecount

Add various linters supported by mach and remove eslint dependency.

Differential Revision: https://phabricator.services.mozilla.com/D60895

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ed Lee 2020-01-31 07:33:54 +00:00
Родитель d174b45f2d
Коммит 33e7d3e2d1
6 изменённых файлов: 11 добавлений и 989 удалений

Просмотреть файл

@ -48,7 +48,6 @@ browser/extensions/pdfjs/content/web
browser/components/pocket/content/panels/js/tmpl.js
# Ignore newtab files
# Kept in sync with browser/components/newtab/.eslintignore
browser/components/newtab/data/
browser/components/newtab/logs/

Просмотреть файл

@ -1,3 +0,0 @@
data/
logs/
vendor/

Просмотреть файл

@ -15,8 +15,6 @@ module.exports = {
"import", // require("eslint-plugin-import")
"react", // require("eslint-plugin-react")
"jsx-a11y", // require("eslint-plugin-jsx-a11y")
// Temporarily disabled since they aren't vendored into in mozilla central yet
// "react-hooks", // require("react-hooks")
],
"settings": {
"react": {
@ -33,11 +31,6 @@ module.exports = {
"plugin:prettier/recommended", // require("eslint-plugin-prettier")
"prettier/react", // require("eslint-config-prettier")
],
"globals": {
// Remove this when m-c updates their eslint: See https://github.com/mozilla/activity-stream/pull/4219
"RPMSendAsyncMessage": true,
"NewTabPagePreloading": true,
},
"overrides": [
{
// These files use fluent-dom to insert content
@ -73,8 +66,6 @@ module.exports = {
}
],
"rules": {
// "react-hooks/rules-of-hooks": 2,
"fetch-options/no-fetch-credentials": 2,
"react/jsx-boolean-value": [2, "always"],

959
browser/components/newtab/package-lock.json сгенерированный

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -21,7 +21,6 @@
"@babel/plugin-proposal-async-generator-functions": "7.2.0",
"@babel/preset-react": "7.0.0",
"acorn": "6.1.1",
"babel-eslint": "10.0.3",
"babel-loader": "8.0.6",
"babel-plugin-jsm-to-commonjs": "0.5.0",
"babel-plugin-jsm-to-esmodules": "0.6.0",
@ -30,17 +29,6 @@
"cpx": "1.5.0",
"enzyme": "3.9.0",
"enzyme-adapter-react-16": "1.13.2",
"eslint": "6.2.2",
"eslint-config-prettier": "4.2.0",
"eslint-plugin-fetch-options": "0.0.5",
"eslint-plugin-html": "6.0.0",
"eslint-plugin-import": "2.17.3",
"eslint-plugin-jsx-a11y": "6.2.1",
"eslint-plugin-mozilla": "2.1.0",
"eslint-plugin-no-unsanitized": "3.0.2",
"eslint-plugin-prettier": "3.0.1",
"eslint-plugin-react": "7.13.0",
"eslint-plugin-react-hooks": "1.6.0",
"istanbul-instrumenter-loader": "3.0.1",
"joi-browser": "13.4.0",
"karma": "4.1.0",
@ -90,6 +78,8 @@
"main": "bootstrap.js",
"repository": "mozilla/activity-stream",
"config": {
"mc_root": "../../..",
"newtab_path": "browser/components/newtab",
"mc_dir": "../mozilla-central"
},
"scripts": {
@ -130,8 +120,10 @@
"tddmc": "karma start karma.mc.config.js --tdd",
"debugcoverage": "open logs/coverage/index.html",
"lint": "npm-run-all lint:*",
"lint:eslint-check": "eslint --cache --print-config AboutNewTabService.jsm | eslint-config-prettier-check",
"lint:eslint": "eslint --cache --ext=.js,.jsm,.jsx .",
"lint:codespell": "(cd $npm_package_config_mc_root && ./mach lint -l codespell $npm_package_config_newtab_path)",
"lint:eslint": "(cd $npm_package_config_mc_root && ./mach lint -l eslint $npm_package_config_newtab_path)",
"lint:l10n": "(cd $npm_package_config_mc_root && ./mach lint -l l10n --warnings browser/locales/en-US/browser/newtab)",
"lint:license": "(cd $npm_package_config_mc_root && ./mach lint -l license $npm_package_config_newtab_path)",
"lint:sasslint": "sass-lint -v -q",
"test": "npm run testmc",
"tdd": "npm run tddmc",

Просмотреть файл

@ -66,10 +66,12 @@ scripts:
debugcoverage: open logs/coverage/index.html
# lint: Run eslint and sass-lint
# lint: Run various linters with mach or local dev dependencies
lint:
eslint-check: eslint --cache --print-config AboutNewTabService.jsm | eslint-config-prettier-check
eslint: eslint --cache --ext=.js,.jsm,.jsx .
codespell: (cd $npm_package_config_mc_root && ./mach lint -l codespell $npm_package_config_newtab_path)
eslint: (cd $npm_package_config_mc_root && ./mach lint -l eslint $npm_package_config_newtab_path)
l10n: (cd $npm_package_config_mc_root && ./mach lint -l l10n --warnings browser/locales/en-US/browser/newtab)
license: (cd $npm_package_config_mc_root && ./mach lint -l license $npm_package_config_newtab_path)
sasslint: sass-lint -v -q
# test: Run all tests once