Skip to content

Commit

Permalink
upgrade linting rulesets
Browse files Browse the repository at this point in the history
  • Loading branch information
pavjacko committed Jun 27, 2023
1 parent 908cd56 commit f68e119
Show file tree
Hide file tree
Showing 10 changed files with 1,183 additions and 1,543 deletions.
121 changes: 2 additions & 119 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,123 +1,6 @@
module.exports = {
extends: ['@flexn/eslint-config', 'prettier'],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx']
}
}
'import/core-modules': ['@flexn/eslint-config'],
},
parser: '@babel/eslint-parser',
extends: ['airbnb'],
env: {
node: true,
browser: true,
es6: true,
jest: true,
mocha: true
},
parserOptions: {
requireConfigFile: false,
ecmaFeatures: {
experimentalObjectRestSpread: true
},
babelOptions: {
presets: ['@babel/preset-react']
}
},
plugins: ['jest', 'detox', 'mocha'],
rules: {
//= ===========
'function-paren-newline': 'off',
'arrow-parens': 'off',
'no-multiple-empty-lines': 'off',
'function-call-argument-newline': 'off',
'default-param-last': 'off',
'no-promise-executor-return': 'off',
'react/destructuring-assignment': 'off',
'react/function-component-definition': 'off',
'max-classes-per-file': 'off',
'import/no-relative-packages': 'off',
'import/extensions': 'off',
'react/no-unstable-nested-components': 'off',
'react/jsx-curly-brace-presence': 'off',
'react/jsx-props-no-spreading': 'off',
'react/jsx-wrap-multilines': 'off',
'prefer-object-spread': 'off',
'react/jsx-no-constructed-context-values': 'off',
'react/prop-types': 'off',
//= ===========
'no-unused-vars': ['error'],
'arrow-body-style': ['warn', 'as-needed'],
'import/no-cycle': ['warn'],
camelcase: 'off',
'class-methods-use-this': 'off',
'consistent-return': 0,
indent: ['error', 4, { SwitchCase: 1 }],
'new-cap': ['error', { capIsNew: false }],
'no-duplicate-imports': 'off',
'no-param-reassign': [
'error',
{ ignorePropertyModificationsFor: ['el', 'ref', 'event'] }
],
'no-plusplus': 'off',
'no-shadow': [
'error',
{ builtinGlobals: false, hoist: 'functions', allow: ['describe'] }
],
'no-use-before-define': 0,
'no-unused-expressions': ['error', { allowShortCircuit: true }],
'nonblock-statement-body-position': 0,
'react/jsx-filename-extension': ['error', { extensions: ['.js'] }],
'react/jsx-indent': ['error', 4],
'react/jsx-indent-props': ['error', 4],
'react/require-extension': 'off',
'react/sort-comp': [
'error',
{
order: [
'type-annotations',
'static-methods',
'lifecycle',
'/^on.+$/',
'/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/',
'everything-else',
'/^render.+$/',
'render'
]
}
],
'object-curly-newline': [
'error',
{
ObjectExpression: {
minProperties: 6,
multiline: true,
consistent: true
},
ObjectPattern: {
minProperties: 6,
multiline: true,
consistent: true
}
}
],
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-duplicates': 'error',
'import/no-named-as-default': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'jsx-a11y/no-noninteractive-tabindex': 'off',
'jsx-a11y/media-has-caption': 'off',
'jsx-a11y/mouse-events-have-key-events': 'off',
'comma-dangle': ['error', 'only-multiline'],
'no-underscore-dangle': 'off',
'mocha/no-exclusive-tests': 'error',
'prefer-destructuring': ['error', { object: true, array: false }],
'prefer-promise-reject-errors': 'off',
'max-len': [
'warn',
{ code: 120, ignoreComments: true, ignoreStrings: true }
],
'linebreak-style': ['error', process.platform === 'win32' ? 'windows' : 'unix']
}
};
21 changes: 21 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
lib
dist
node_modules
.expo
.next
.vscode

appConfigs
platformBuilds
platformAssets
renative.local.json
renative.private.json
renative.build.json
renative.runtime.json
rnv-config.local.json
metro.config.local.js

coverage
build

.vercel
3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('@flexn/prettier-config'),
};
42 changes: 17 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "renative-wrapper",
"name": "@flexn/renative-monorepo",
"version": "0.37.0-rc.5",
"description": "🚀🚀🚀 Unified Development Platform. Bootstrap, Develop & Deploy `iOS`, `tvOS`, `Android`, `Android TV`, `Fire TV`, `Android Wear`, `Web`, `Tizen TV`, `Tizen Watch`, `Tizen Mobile`, `LG webOS`, `macOS/OSX`, `Windows`, `KaiOS`, `FirefoxOS`, `Firefox TV`, `Linux` and `Chromecast` platforms",
"keywords": [
Expand Down Expand Up @@ -60,7 +60,9 @@
"scripts": {
"bootstrap": "yarn run link:rnv && npx lerna bootstrap && yarn build",
"bootstrap-clean": "rm -rf ./node_modules; npx lerna clean --yes && yarn bootstrap",
"build": "npx lerna run --parallel --concurrency 1 build",
"build": "lerna run build",
"watch-alt": "npx lerna run compile & npx lerna watch -- lerna run compile",
"watch": "npx lerna exec yarn watch --parallel",
"build:clean": "npx lerna run --parallel --concurrency 1 build:clean",
"deploy-all": "yarn build && yarn test && yarn deploy-prepare && npm run git-commit-tag",
"deploy-prepare": "rnv hooks run -x prePublish -r",
Expand All @@ -82,46 +84,37 @@
"postinstall": "npx lerna link --force-local && npx jetify",
"prepare": "husky install",
"test": "jest",
"tsc": "lerna run --parallel tsc",
"watch": "npx lerna run --parallel --concurrency 2 watch"
},
"dependencies": {
"deepmerge": "3.2.0",
"simple-git": "3.12.0"
"tsc": "lerna run --parallel tsc"
},
"devDependencies": {
"@flexn/eslint-config": "0.1.5",
"@flexn/prettier-config": "0.1.4",
"@flexn/typescript": "0.3.0",
"@babel/eslint-parser": "7.17.0",
"@babel/plugin-transform-runtime": "7.8.3",
"@babel/preset-react": "7.16.7",
"@babel/runtime": "7.12.5",
"@flexn/typescript": "0.1.4",
"@types/jest": "^27.0.2",
"@types/node": "^16.11.7",
"@types/jest": "~27.0.2",
"@types/node": "~16.11.7",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"babel-jest": "26.6.3",
"babel-plugin-module-resolver": "3.2.0",
"babel-plugin-polyfill-corejs2": "0.2.2",
"eslint": "8.10.0",
"eslint-config-airbnb": "19.0.4",
"eslint-plugin-detox": "1.0.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jest": "23.8.2",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-mocha": "6.3.0",
"eslint-plugin-prettier": "3.0.1",
"eslint-plugin-react": "7.29.3",
"eslint-plugin-react-hooks": "4.3.0",
"eslint-config-prettier": "8.8.0",
"husky": "^7.0.0",
"jest": "27.5.1",
"lerna": "5.4.2",
"lerna": "6.6.2",
"lint-staged": "12.3.4",
"prettier": "1.17.1",
"pretty-quick": "1.11.0",
"rnv": "0.37.0-rc.5",
"ts-jest": "^27.0.7",
"ttab": "^0.7.2",
"typescript": "4.9.5"
"typescript": "4.9.5",
"prettier": "2.3.1",
"eslint": "8.40.0",
"deepmerge": "3.2.0",
"simple-git": "3.12.0"
},
"engines": {
"node": ">=16.0.0",
Expand Down Expand Up @@ -151,7 +144,6 @@
"@expo/next-adapter",
"@expo/webpack-config",
"@expo/**",
"reantive-app",
"execa"
]
},
Expand Down
1 change: 1 addition & 0 deletions packages/rnv/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"outDir": "./dist",
"rootDir": "./src",
"allowJs": true,
"resolveJsonModule": false
},
"include": [
"./src/**/*",
Expand Down
1 change: 1 addition & 0 deletions packages/sdk-android/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"outDir": "./dist",
"rootDir": "./src",
"allowJs": true,
"resolveJsonModule": false
},
"include": [
"./src/**/*",
Expand Down
3 changes: 3 additions & 0 deletions packages/template-starter/appConfigs/base/renative.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
},
"fontSources": [
"{{resolvePackage(react-native-vector-icons)}}/Fonts"
],
"assetSources": [
"{{resolvePackage(@flexn/assets-renative-outline)}}/assets"
]
},
"platforms": {
Expand Down
1 change: 1 addition & 0 deletions packages/template-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"tsc": "tsc --noEmit --composite false"
},
"devDependencies": {
"@flexn/assets-renative-outline": "0.2.0",
"@flexn/graybox": "0.21.2-alpha.16",
"@lightningjs/cli": "2.8.0",
"@lightningjs/sdk": "4.8.3",
Expand Down
8 changes: 4 additions & 4 deletions packages/template-starter/renative.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
],
"packageTemplate": {
"devDependencies": {
"typescript": "4.5.4",
"@types/react": "18.0.11",
"@types/react-dom": "18.0.5",
"@types/react-native": "0.67.2"
"typescript": "4.9.5",
"@types/react": "18.2.6",
"@types/react-dom": "~18.2.4",
"@types/react-native": "~0.67.2"
},
"browserslist": {
"production": [
Expand Down
Loading

0 comments on commit f68e119

Please sign in to comment.