Skip to content

Commit

Permalink
Add typescript support
Browse files Browse the repository at this point in the history
  • Loading branch information
mortnod committed Jul 8, 2019
1 parent 2f2d9fa commit 14c2d8d
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 4 deletions.
13 changes: 10 additions & 3 deletions javascript/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
const jsRules = require('./rules');
const jsRules = require("./rules");

module.exports = {
extends: ['airbnb-base', 'plugin:import/errors', 'plugin:import/warnings'],
parser: 'babel-eslint',
extends: ["airbnb-base", "plugin:import/errors", "plugin:import/warnings"],
parser: "babel-eslint",
settings: {
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"]
}
}
},
rules: jsRules
};
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
},
"homepage": "https://github.com/otovo/eslint-config-otovo#readme",
"peerDependencies": {
"@typescript-eslint/eslint-plugin": "^1.11.0",
"@typescript-eslint/parser": "^1.11.0",
"babel-eslint": "^10.0.2",
"eslint": "^6.0.1",
"eslint-config-airbnb": "^17.1.1",
Expand All @@ -37,5 +39,6 @@
},
"devDependencies": {
"np": "^5.0.3"
}
},
"dependencies": {}
}
6 changes: 6 additions & 0 deletions prettier-typescript/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
extends: [
"prettier/@typescript-eslint" // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
]
};
10 changes: 10 additions & 0 deletions typescript/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
extends: [
"plugin:@typescript-eslint/recommended" // Uses the recommended rules from the @typescript-eslint/eslint-plugin
],
rules: {
"@typescript-eslint/indent": ["error", 2],
"@typescript-eslint/camelcase": false
}
};
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,13 @@ escape-string-regexp@^2.0.0:
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344"
integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==

eslint-plugin-flowtype@^3.11.1:
version "3.11.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.11.1.tgz#1aae15a10dbcd5aecc89897f810f2e9fcc18a5e3"
integrity sha512-4NiaaGZuz9iEGRTK8j4lkA/scibOXSYaYoHbsTtgLOxxqQCkbWV3xt8ETqILKg7DAYDqB69z1H5U71UmtdF9hw==
dependencies:
lodash "^4.17.11"

esprima@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
Expand Down

0 comments on commit 14c2d8d

Please sign in to comment.