またこういうことを言うとアレだ。 no-param-reassign ルールなのだが、その名前とは裏腹に、実際には2つの異なる問題をテリトリーとしている。公式の例より:
またこういうことを言うとアレだ。 no-param-reassign ルールなのだが、その名前とは裏腹に、実際には2つの異なる問題をテリトリーとしている。公式の例より:
タイトル通り。vscodeとvuejsを使ってのlintの設定をprettierなしでやってみた。 tl;dr 環境 問題点 手順 .vueの構文チェックその1 vscode上での自動フォーマット .vueの構文チェックその2 rulesをカスタマイズ <template>のカスタマイズ <script>をカスタマイズ まとめ。 おまけ tl;dr 対象ファイルとpackage.jsonと.eslintrc.jsの対応表👇 構文チェック・自動フォーマット 対象ファイル npmライブラリ(package.json) .eslintrc.jsでのextends .vue(<template>) eslint-plugin-vue plugin:vue/recommended .vue(<script>) eslint eslint:recommended . js eslint eslint
何もしないでそのままでも十分かもしれない。 先にまとめ 最近の react-scripts は ESLint を含んでいるので別途インストール不要 設定は .eslintrc.js を作成して extends: ['react-app'] する Airbnb のルール設定を使う場合はもうちょい頑張る 元々 create-react-app してない場合も同じ Airbnb ルール利用時の手順概要 ESLint 初期化 ESLint の設定を更新 コードを recommended な状態へ対応 想定環境 Node.js v10.16 react-scripts v3.1 TypeScript v3.5 ESLint v6.1 @typescript-eslint/eslint-plugin v1.13 React アプリの準備 create-react-app でテンプレートから作成します。
追記: 2019/05/01 最近の@typescript-eslint/eslint-plugin, Prettierのアップデートによって、正式にTypeScript 3.4対応されました。一通り普通に動いてる感じ。 これまで自分で使っていて問題になったのがパフォーマンス。ESLint単体やTSLintに比べて、プロジェクトによるだろうけど2倍以上遅い。体感で結構辛い。 Poor performance on some projects · Issue #389 · typescript-eslint/typescript-eslint これはTypeScriptのパーサーを通す部分の構造上の問題が原因なので、簡単には直せなそうな気配。 とりあえず、個人的には型を必要とするルールにそこまでの価値を感じていないので、該当ルールを無効にしてparserOptions > projectを削
Comparing eslint-config-airbnb vs. eslint-config-google vs. standard Here we compare between eslint-config-airbnb, eslint-config-google and standard. In this comparison we will focus on the latest versions of those packages. The current versions are eslint-config-airbnb 19.0.4, eslint-config-google 0.14.0 and standard 17.1.0. eslint-config-airbnb, Airbnb's ESLint config, following our styleguide.
Note: this guide assumes that you are familiar with Create React App, so it’s supposed you already have a local project ready to go and you know all the basics. 1. Extend ESLint configuration with AirBnB’s linting rules and PrettierAirBnB created a real popular Javascript Style Guide. Using it in your projects will ensure your code has a level of clarity that makes reading and maintaining easier f
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く