Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "0.2",
"ignorePaths": [
".eslintrc.js",
"eslint.config.js",
".gitignore",
"*.lock",
"*.snap",
Expand Down
103 changes: 0 additions & 103 deletions .eslintrc.js

This file was deleted.

7 changes: 0 additions & 7 deletions .prettierrc.js

This file was deleted.

7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"jsxSingleQuote": true,
"printWidth": 100
}
2 changes: 1 addition & 1 deletion Develop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ This is a new [**React Native**](https://reactnative.dev) project, bootstrapped

# Getting Started

>**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
> **Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.

## Step 1: Start the Metro Server

Expand Down
2 changes: 1 addition & 1 deletion Example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ This is a new [**React Native**](https://reactnative.dev) project, bootstrapped

# Getting Started

>**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
> **Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.

## Step 1: Start the Metro Server

Expand Down
234 changes: 234 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
import js from '@eslint/js'
import globals from 'globals'
import tseslint from 'typescript-eslint'
import eslintPluginReactRefresh from 'eslint-plugin-react-refresh'
import eslintPluginReactHooks from 'eslint-plugin-react-hooks'
import eslintPluginReact from 'eslint-plugin-react'
import eslintPluginJSDoc from 'eslint-plugin-jsdoc'
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
import eslintPluginImport from 'eslint-plugin-import'
import eslintPluginFunctional from 'eslint-plugin-functional'
import eslintPluginUnusedImports from 'eslint-plugin-unused-imports'

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: {
...globals.browser,
...globals.jest,
...globals.node,
},
parserOptions: {
project: ['./tsconfig.json'],
tsconfigRootDir: import.meta.dirname,
},
},
settings: {
react: {
version: 'detect',
},
},
plugins: {
'react-refresh': eslintPluginReactRefresh,
'react-hooks': eslintPluginReactHooks,
react: eslintPluginReact,
jsdoc: eslintPluginJSDoc,
unicorn: eslintPluginUnicorn,
import: eslintPluginImport,
functional: eslintPluginFunctional,
'unused-imports': eslintPluginUnusedImports,
},
rules: {
...eslintPluginReactHooks.configs.recommended.rules,
...eslintPluginReactRefresh.configs.recommended.rules,
...eslintPluginReact.configs.recommended.rules,
...eslintPluginJSDoc.configs.recommended.rules,
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
'@typescript-eslint/no-confusing-void-expression': [
'error',
{
ignoreArrowShorthand: true,
ignoreVoidOperator: true,
},
],
'@typescript-eslint/no-invalid-this': 'error',
'@typescript-eslint/no-invalid-void-type': 'error',
'@typescript-eslint/no-loop-func': 'error',
'@typescript-eslint/no-loss-of-precision': 'error',
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
'@typescript-eslint/no-unused-expressions': 'error',
'@typescript-eslint/no-use-before-define': [
'error',
{
variables: false,
},
],
'@typescript-eslint/prefer-enum-initializers': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/prefer-reduce-type-parameter': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/prefer-ts-expect-error': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/return-await': 'error',
'@typescript-eslint/strict-boolean-expressions': 'error',
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/member-ordering': 'error',
'@typescript-eslint/method-signature-style': ['error', 'method'],
'@typescript-eslint/consistent-indexed-object-style': 'error',
'@typescript-eslint/require-await': 'error',
'@typescript-eslint/no-inferrable-types': 'error',
'functional/prefer-readonly-type': [
'error',
{
allowLocalMutation: true,
allowMutableReturnType: true,
ignoreClass: true,
},
],
'unused-imports/no-unused-imports': 'error',
'import/no-duplicates': 'error',
'import/exports-last': 'error',
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
['parent', 'sibling'],
'object',
'type',
'index',
],

pathGroups: [
{
pattern: '{react,react-dom/**}',
group: 'external',
position: 'before',
},
{
pattern: '@/**',
group: 'internal',
},
{
pattern: '.',
group: 'index',
},
{
pattern: './App',
group: 'index',
},
],

pathGroupsExcludedImportTypes: ['react'],
'newlines-between': 'always',

alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'unicorn/no-useless-spread': 'error',
'unicorn/no-null': 'error',
'react/react-in-jsx-scope': 'off',
'react/jsx-no-useless-fragment': 'error',
'react/jsx-handler-names': [
'error',
{
eventHandlerPrefix: 'handle',
eventHandlerPropPrefix: 'on',
},
],
'no-invalid-this': 'off',
'no-loop-func': 'off',
'no-loss-of-precision': 'off',
'no-redeclare': 'off',
'no-shadow': 'off',
'no-throw-literal': 'error',
'no-unused-expressions': 'off',
'no-return-await': 'off',
'sort-imports': [
'error',
{
ignoreCase: true,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
allowSeparatedGroups: true,
},
],
'linebreak-style': ['error', 'unix'],
'nonblock-statement-body-position': ['error', 'beside'],
'no-console': [
'error',
{
allow: ['debug', 'warn', 'error'],
},
],
'prefer-destructuring': [
'error',
{
VariableDeclarator: {
array: false,
object: true,
},

AssignmentExpression: {
array: true,
object: true,
},
},
{
enforceForRenamedProperties: false,
},
],
'require-await': 'off',
'max-depth': 'error',
'object-shorthand': 'error',
'no-unneeded-ternary': 'error',
camelcase: [
'error',
{
properties: 'never',
allow: ['_UNSTABLE'],
},
],
quotes: [
'error',
'single',
{
avoidEscape: true,
},
],
curly: ['error', 'multi-line', 'consistent'],
eqeqeq: [
'error',
'always',
{
null: 'ignore',
},
],
complexity: 'error',
indent: ['error', 2, { SwitchCase: 1 }],
semi: 'off',
'no-empty-function': 'off',
},
},
)
4 changes: 2 additions & 2 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
pre-commit:
parallel: true
commands:
Pretty:
Prettier:
root: "src/"
run: npx prettier --check {staged_files}
ESLint:
exclude: 'Develop|Example'
glob: 'src/**/*.{js,jsx,ts,tsx}'
run: npx eslint -c .eslintrc.js {staged_files}
run: npx eslint -c eslint.config.js {staged_files}
CSpell:
run: npx cspell --gitignore --show-suggestions --no-must-find-files {staged_files}
Loading
Loading