質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Firebase

Firebaseは、Googleが提供するBasSサービスの一つ。リアルタイム通知可能、並びにアクセス制御ができるオブジェクトデータベース機能を備えます。さらに認証機能、アプリケーションのログ解析機能などの利用も可能です。

TypeScript

TypeScriptは、マイクロソフトによって開発された フリーでオープンソースのプログラミング言語です。 TypeScriptは、JavaScriptの構文の拡張であるので、既存の JavaScriptのコードにわずかな修正を加えれば動作します。

Q&A

解決済

1回答

6418閲覧

Firebaseでデプロイ時に@typescript-eslintが一意ではないというエラーが発生してしまう。

pontarou3

総合スコア18

Firebase

Firebaseは、Googleが提供するBasSサービスの一つ。リアルタイム通知可能、並びにアクセス制御ができるオブジェクトデータベース機能を備えます。さらに認証機能、アプリケーションのログ解析機能などの利用も可能です。

TypeScript

TypeScriptは、マイクロソフトによって開発された フリーでオープンソースのプログラミング言語です。 TypeScriptは、JavaScriptの構文の拡張であるので、既存の JavaScriptのコードにわずかな修正を加えれば動作します。

1グッド

3クリップ

投稿2020/09/27 06:30

編集2020/09/28 07:03

「@typescript-eslintというプラグインが重複している」といわれておりますが、どこのどのコードを削除すればいいかわかりません。

現在、初めてFirebaseにてReactのアプリケーション構築を学習しています。
以下のエラー文の解決ができず、先にすすめていない状況です。

エラー文(ターミナル)

ESLint: 7.10.0 ESLint couldn't determine the plugin "@typescript-eslint" uniquely. - /Users/tarou//test/chatbot-demo/functions/node_modules/@typescript-eslint/eslint-plugin/dist/index.js (loaded in ".eslintrc.js") - (loaded in "../package.json » eslint-config-react-app#overrides[0]") Please remove the "plugins" setting from either config or remove either plugin installation. If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! functions@ lint: `eslint 'src/**/*'` npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the functions@ lint script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/tarou/.npm/_logs/2020-09-27T04_11_32_364Z-debug.log Error: functions predeploy error: Command terminated with non-zero exit code2

.eslint.jsファイル↓

module.exports = { env: { browser: true, es6: true, node: true, }, extends: [ "plugin:import/errors", "plugin:import/warnings", ], parser: "@typescript-eslint/parser", parserOptions: { project: "tsconfig.json", sourceType: "module", }, plugins: [ "@typescript-eslint", "import", ], rules: { "@typescript-eslint/adjacent-overload-signatures": "error", "@typescript-eslint/no-empty-function": "error", "@typescript-eslint/no-empty-interface": "warn", "@typescript-eslint/no-floating-promises": "error", "@typescript-eslint/no-namespace": "error", "@typescript-eslint/no-unnecessary-type-assertion": "error", "@typescript-eslint/prefer-for-of": "warn", "@typescript-eslint/triple-slash-reference": "error", "@typescript-eslint/unified-signatures": "warn", "comma-dangle": "warn", "constructor-super": "error", eqeqeq: ["warn", "always"], "import/no-deprecated": "warn", "import/no-extraneous-dependencies": "error", "import/no-unassigned-import": "warn", "no-cond-assign": "error", "no-duplicate-case": "error", "no-duplicate-imports": "error", "no-empty": [ "error", { allowEmptyCatch: true, }, ], "no-invalid-this": "error", "no-new-wrappers": "error", "no-param-reassign": "error", "no-redeclare": "error", "no-sequences": "error", "no-shadow": [ "error", { hoist: "all", }, ], "no-throw-literal": "error", "no-unsafe-finally": "error", "no-unused-labels": "error", "no-var": "warn", "no-void": "error", "prefer-const": "warn", }, settings: { jsdoc: { tagNamePreference: { returns: "return", }, }, }, };

ググっても同じような事例をみつけられず、、、迷走してしまっています。

仮設と試したこと

・プラグインが2つあるので削除すればよさそう?
・@typescript-eslintという場所を探せばいいのでは?

package.jsonにあった。

"@typescript-eslint/eslint-plugin": "^3.9.1", "@typescript-eslint/parser": "^3.8.0",

でもどっちを削除すればいいのか?
または、このファイルではない?

Firebaseを初めて使用するため、安易にデプロイするのはよくないかも?
っと思い、質問に至りました。

環境補足

nodeバージョン:v12.18.3

その他package.json情報

{ "name": "functions", "scripts": { "lint": "eslint 'src/**/*'", "build": "tsc", "serve": "npm run build && firebase emulators:start --only functions", "shell": "npm run build && firebase functions:shell", "start": "npm run shell", "deploy": "firebase deploy --only functions", "logs": "firebase functions:log" }, "engines": { "node": "10" }, "main": "lib/index.js", "dependencies": { "firebase-admin": "^8.10.0", "firebase-functions": "^3.6.1" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^3.9.1", "@typescript-eslint/parser": "^3.8.0", "eslint": "^7.6.0", "eslint-plugin-import": "^2.22.0", "typescript": "^3.8.0", "firebase-functions-test": "^0.2.0" }, "private": true }

もし詳しい方がいらっしゃいましたら、ご教授いただけますと幸いです。

最後までみていただきありがとうございます。

yoshi6318👍を押しています

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

自分も同じエラーハマりました!
教えてもらってとりあえずできたので参考にしてください。

プロジェクトルートにあるpackage.jsonの下記の部分を削除したらdeployできました!

json

1 "eslintConfig": { 2 "extends": "react-app" // ← 消す 3 },

投稿2020/09/29 03:26

編集2020/09/29 03:27
daisuke80001

総合スコア15

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

pontarou3

2020/09/29 03:52

ありがとうございます! おっしゃる通りズバっと解決しました! 実は、夜ググりまくっていましたら、 jsonにかかれていた"react-app"を .eslintrc.jsのextendsに移植してエラー回避されていらっしゃる方の動画をみつけまして、 https://www.youtube.com/watch?v=JXS9RN1qjec こちらを参考にしてみたところ、うまくいきました! 解決後に別のエラーの対処のため、回答がおくれてしまいました。申し訳ございませんm(_ _)m アドバイスいただき、ありがとうございました!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問