Skip to content

Commit

Permalink
Merge pull request #5 from Countly/styling
Browse files Browse the repository at this point in the history
Styling
  • Loading branch information
ArtursKadikis authored Jan 19, 2023
2 parents d74dc61 + 5e3dd04 commit 67c40e6
Show file tree
Hide file tree
Showing 11 changed files with 17,951 additions and 1,822 deletions.
1 change: 1 addition & 0 deletions CountlyRNExample/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
4 changes: 0 additions & 4 deletions CountlyRNExample/.eslintrc.js

This file was deleted.

123 changes: 123 additions & 0 deletions CountlyRNExample/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"env": {
"react-native/react-native": true
},
"extends": ["plugin:react/recommended", "prettier", "eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 8,
"sourceType": "module"
},
"parser": "@typescript-eslint/parser",
"plugins": ["react", "react-native", "@typescript-eslint"],
"root": true,
"rules": {
//JavaScript rules

// allow .js files to contain JSX code
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".tsx"] }],

// prevent eslint to complain about the "styles" variable being used before it was defined
"no-use-before-define": ["error", { "variables": false }],

// ignore errors for the react-navigation package
"react/prop-types": ["error", { "ignore": ["navigation", "navigation.navigate"] }],
"no-var": "warn",
"curly": ["error", "all"],

//TypeScript related rules
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": "warn",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-comment": "error", //???
"@typescript-eslint/ban-types": "error",
"@typescript-eslint/class-literal-property-style": "warn",
"@typescript-eslint/consistent-generic-constructors": "warn",
"@typescript-eslint/consistent-indexed-object-style": "warn",
"@typescript-eslint/consistent-type-assertions": "warn",
"@typescript-eslint/consistent-type-definitions": "warn",
"@typescript-eslint/consistent-type-exports": "warn",
"@typescript-eslint/consistent-type-imports": "warn",
"@typescript-eslint/explicit-function-return-type": "warn",
"@typescript-eslint/explicit-member-accessibility": "warn",
"@typescript-eslint/explicit-module-boundary-types": "warn",
"@typescript-eslint/member-ordering": "warn", //???
"@typescript-eslint/method-signature-style": "warn",
//"@typescript-eslint/naming-convention": "warn"
"@typescript-eslint/no-base-to-string": "warn",
"@typescript-eslint/no-confusing-non-null-assertion": "warn",
"@typescript-eslint/no-confusing-void-expression": "warn",
"@typescript-eslint/no-duplicate-enum-values": "warn",
"@typescript-eslint/no-dynamic-delete": "warn",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-extra-non-null-assertion": "error",
"@typescript-eslint/no-extraneous-class": "warn",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-invalid-void-type": "warn",
"@typescript-eslint/no-meaningless-void-operator": "warn",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "warn",
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-redundant-type-constituents": "warn",
"@typescript-eslint/no-require-imports": "warn",
"@typescript-eslint/no-this-alias": "error",
"@typescript-eslint/no-type-alias": "warn",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "warn",
"@typescript-eslint/no-unnecessary-condition": "warn",
"@typescript-eslint/no-unnecessary-qualifier": "warn",
"@typescript-eslint/no-unnecessary-type-arguments": "warn",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-unnecessary-type-constraint": "error",
"@typescript-eslint/no-unsafe-argument": "error",
"@typescript-eslint/no-unsafe-assignment": "error",
"@typescript-eslint/no-unsafe-call": "error",
"@typescript-eslint/no-unsafe-declaration-merging": "warn",
"@typescript-eslint/no-unsafe-member-access": "error",
"@typescript-eslint/no-unsafe-return": "error",
"@typescript-eslint/no-useless-empty-export": "warn",
"@typescript-eslint/non-nullable-type-assertion-style": "warn",
"@typescript-eslint/parameter-properties": "warn",
"@typescript-eslint/prefer-as-const": "error",
"@typescript-eslint/prefer-enum-initializers": "warn",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "warn",
"@typescript-eslint/prefer-literal-enum-member": "warn",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/prefer-nullish-coalescing": "warn",
"@typescript-eslint/prefer-optional-chain": "warn",
"@typescript-eslint/prefer-readonly": "warn",
"@typescript-eslint/prefer-readonly-parameter-types": "warn",
"@typescript-eslint/prefer-reduce-type-parameter": "warn",
"@typescript-eslint/prefer-regexp-exec": "warn",
"@typescript-eslint/prefer-return-this-type": "warn",
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
"@typescript-eslint/prefer-ts-expect-error": "warn",
"@typescript-eslint/promise-function-async": "warn",
"@typescript-eslint/require-array-sort-compare": "warn",
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/restrict-template-expressions": "error",
"@typescript-eslint/sort-type-constituents": "warn",
"@typescript-eslint/strict-boolean-expressions": "warn",
"@typescript-eslint/switch-exhaustiveness-check": "warn",
"@typescript-eslint/triple-slash-reference": "error",
"@typescript-eslint/typedef": "warn",
"@typescript-eslint/unbound-method": "error",
"@typescript-eslint/unified-signatures": "warn",

"@typescript-eslint/no-use-before-define": "warn",
"@typescript-eslint/no-var-requires": "error",

// Note: you must disable the base rule as it can report incorrect errors
"object-curly-spacing": "off",
"@typescript-eslint/object-curly-spacing": "warn"
}
}
7 changes: 0 additions & 7 deletions CountlyRNExample/.prettierrc.js

This file was deleted.

14 changes: 14 additions & 0 deletions CountlyRNExample/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"quoteProps": "preserve",
"singleQuote": true,
"semi": true,
"printWidth": 300,
"useTabs": false,
"tabWidth": 4,
"trailingComma": "es5",
"endOfLine": "lf"
}
11 changes: 11 additions & 0 deletions CountlyRNExample/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"cSpell.words": ["Countly"],
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
Loading

0 comments on commit 67c40e6

Please sign in to comment.