jellyfin-expo/.eslintrc.json
2022-03-23 13:54:47 -04:00

161 lines
5.3 KiB
JSON

{
"env": {
"react-native/react-native": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:promise/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:eslint-comments/recommended"
],
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2020,
"sourceType": "module"
},
"plugins": [
"react",
"react-native",
"promise",
"import",
"eslint-comments"
],
"settings": {
"react": {
"version": "detect"
},
"jest": {
"version": "detect"
}
},
"rules": {
"react/prop-types": ["error"],
"jsx-quotes": ["error", "prefer-single"],
"react-native/no-unused-styles": ["error"],
"react-native/split-platform-components": ["error"],
"react-native/no-color-literals": ["error"],
"react-native/no-raw-text": ["error"],
"import/order": ["error", {
"alphabetize": { "order": "asc", "caseInsensitive": true },
"newlines-between": "always-and-inside-groups"
}],
"array-bracket-spacing": ["error", "always", { "objectsInArrays": false, "arraysInArrays": false }],
"array-callback-return": ["error"],
"arrow-spacing": ["error"],
"block-spacing": ["error"],
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"comma-dangle": ["error", "never"],
"comma-spacing": ["error"],
"curly": ["error", "multi-line"],
"default-case-last": ["error"],
"dot-location": ["error", "property"],
"eol-last": ["error"],
"indent": ["error", "tab", { "SwitchCase": 1 }],
"key-spacing": ["error"],
"keyword-spacing": ["error"],
"max-params": ["error", { "max": 7 }],
"max-statements-per-line": ["error"],
"no-duplicate-imports": ["error"],
"no-empty-function": ["error"],
"no-floating-decimal": ["error"],
"no-multi-spaces": ["error"],
"no-multiple-empty-lines": ["error", { "max": 1 }],
"no-nested-ternary": ["error"],
"no-redeclare": ["error"],
"no-return-await": ["error"],
"no-sequences": ["error"],
"no-shadow": ["error"],
"no-throw-literal": ["error"],
"no-trailing-spaces": ["error"],
"no-unreachable": ["error"],
"no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true, "allowTaggedTemplates": true }],
"no-unused-vars": ["error"],
"no-var": ["error"],
"no-void": ["error"],
"object-curly-spacing": ["error", "always"],
"one-var": ["error", "never"],
"padded-blocks": ["error", "never"],
"prefer-const": ["error", { "destructuring": "all" }],
"quote-props": ["error", "as-needed"],
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": false }],
"radix": ["error"],
"semi": ["error"],
"space-before-blocks": ["error"],
"space-before-function-paren": ["error", { "anonymous": "never", "named": "never", "asyncArrow": "always" }],
"space-in-parens": ["error"],
"space-infix-ops": ["error"],
"yoda": ["error"]
},
"ignorePatterns": [ "coverage" ],
"overrides": [
{
"files": [ "./**/*.js" ],
"globals": {
"AbortController": "readonly",
"URL": "readonly",
"URLSearchParams": "readonly"
}
},
{
"files": [ "jest.setup.js", "./**/*.test.js" ],
"plugins": [ "jest" ],
"env": {
"jest/globals": true
},
"globals": {
"fetch": "readonly"
},
"extends": [
"plugin:jest/recommended",
"plugin:jest/style"
],
"rules": {
"jest/consistent-test-it": ["error"],
"jest/lowercase-name": ["error", { "ignoreTopLevelDescribe": true }],
"jest/require-top-level-describe": ["error"]
}
},
{
"files": [ "./assets/**/*.staticjs" ],
"extends": [
"plugin:compat/recommended"
],
"globals": {
"postExpoEvent": "readonly"
},
"env": {
"react-native/react-native": false,
"browser": true,
"es6": true
}
},
{
"files": [
"./**/*.ts",
"./**/*.tsx"
],
"parser": "@typescript-eslint/parser",
"plugins": [ "@typescript-eslint" ],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:promise/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:eslint-comments/recommended"
]
}
]
}