Skip to content

Commit

Permalink
Merge pull request #75 from Clever/tslint-to-eslint
Browse files Browse the repository at this point in the history
TSlint to ESlint
  • Loading branch information
ulziibay authored Apr 24, 2023
2 parents 7949d1a + 86bc1ff commit 5439be2
Show file tree
Hide file tree
Showing 8 changed files with 5,909 additions and 1,623 deletions.
124 changes: 124 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
module.exports = {
env: {
browser: true,
jasmine: true,
jest: true,
mocha: true,
node: true,
},
extends: [
// https://github.com/eslint/eslint
"eslint:recommended",
// https://github.com/yannickcr/eslint-plugin-react
"plugin:react/recommended",
// https://github.com/facebook/react/tree/master/packages/eslint-plugin-react-hooks
"plugin:react-hooks/recommended",
// https: //github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
// https://github.com/prettier/eslint-config-prettier
"prettier",
"prettier/@typescript-eslint",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 13,
sourceType: "module",
project: "./tsconfig.json",
},
plugins: ["react", "react-hooks", "@typescript-eslint"],
rules: {
camelcase: "off",
"comma-dangle": ["error", "always-multiline"],
eqeqeq: ["error", "smart"],
"global-require": "off",
"import/no-unresolved": "off",
indent: "off",
"key-spacing": ["error", { mode: "minimum" }],
"max-len": [
"error",
{
code: 115,
ignorePattern: "^import",
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreUrls: true,
},
],
"new-cap": [
"error",
{
capIsNewExceptions: ["immutable.OrderedMap", "OrderedMap"],
newIsCapExceptions: ["kayvee.logger"],
},
],
"newline-per-chained-call": "off",
"no-console": "off",
"no-multi-spaces": [
"error",
{
exceptions: {
ImportDeclaration: true,
VariableDeclarator: true,
},
},
],
"no-param-reassign": [
"error",
{
props: false,
},
],
"no-restricted-syntax": [
"error",
{
message: "Prefer useTypedDispatch to get a typed version of dispatch.",
selector: "CallExpression[callee.name='useDispatch']",
},
],
"no-underscore-dangle": "off",
"no-unused-vars": "off",
"no-var": "off",
quotes: ["error", "double", "avoid-escape"],
"react/display-name": "off",
"react/jsx-indent": "off",
"react/no-did-update-set-state": "off",
"react/prop-types": "off",
"react/sort-comp": "off",
"vars-on-top": "off",
"@typescript-eslint/ban-ts-comment": [
"error",
{
"ts-ignore": false,
},
],
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-empty-function": ["error", { allow: ["arrowFunctions"] }],
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": ["error", { args: "none" }],
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-var-requires": "off",
},
overrides: [
{
files: ["*.ts", "*.tsx"],
rules: {
"no-undef": "off",
},
},
],
settings: {
"import/resolver": "webpack",
react: {
version: "detect",
},
},
};
44 changes: 0 additions & 44 deletions .eslintrc.yml

This file was deleted.

1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ format-check:
(echo -e "❌ \033[0;31m Prettier found discrepancies in the above files. Run 'make format' to fix.\033[0m" && false)

lint: format-check
./node_modules/.bin/tslint $(TS_FILES)
./node_modules/.bin/eslint $(TS_FILES)

test/tests.json:
Expand Down
2 changes: 1 addition & 1 deletion lib/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function handlerData(handlers, ...args) {
const handler_data = h(...args);
_.extend(data, handler_data);
} catch (e) {
// ignore invalid handler
// swallow invalid handler
}
});
return data;
Expand Down
Loading

0 comments on commit 5439be2

Please sign in to comment.