Skip to content

Commit

Permalink
feat: add eslint config airbnb, typescript, prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
toshi-toma committed Jun 16, 2019
1 parent 15be1c9 commit d1785a0
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -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"],
},
};

0 comments on commit d1785a0

Please sign in to comment.