From d1785a08877c9ecd2225604abf4cfae4c8254adc Mon Sep 17 00:00:00 2001 From: toshi-toma Date: Sun, 16 Jun 2019 16:54:25 +0900 Subject: [PATCH] feat: add eslint config airbnb, typescript, prettier --- index.js | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 0000000..71f3d14 --- /dev/null +++ b/index.js @@ -0,0 +1,53 @@ +module.exports = { + root: true, + parser: "@typescript-eslint/parser", + parserOptions: { + "sourceType": "module", + "project": "./tsconfig.json", + "ecmaFeatures": { + "jsx": true + } + }, + env: { + browser: true, + es6: true + }, + extends: [ + "airbnb", + "plugin:@typescript-eslint/recommended", + "prettier", + "prettier/react", + "prettier/@typescript-eslint", + ], + plugins: [ + "react", + "jsx-a11y", + "import", + "prettier", + "@typescript-eslint", + ], + globals: {}, + rules: { + // prettier + "prettier/prettier": ["error"], + // TypeScript + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/explicit-member-accessibility": "off", + "@typescript-eslint/no-object-literal-type-assertion": "off", + "@typescript-eslint/prefer-interface": "off", + "@typescript-eslint/camelcase": "off", + "@typescript-eslint/explicit-function-return-type": "off", + // React + "react/jsx-filename-extension": ["error", { extensions: [".jsx", ".tsx"] }], + }, + settings: { + // Append 'ts' extensions to Airbnb 'import/resolver' setting + "import/resolver": { + node: { + extensions: [".mjs", ".js", ".ts", ".json"], + }, + }, + // Append 'ts' extensions to Airbnb 'import/extensions' setting + "import/extensions": [".js", ".ts", ".mjs", ".jsx", ".tsx"], + }, +}; \ No newline at end of file