Skip to content

Commit 1699ff1

Browse files
committed
bump eslint and prettier
1 parent 14c8d80 commit 1699ff1

15 files changed

Lines changed: 22462 additions & 54412 deletions

File tree

.eslintignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 15 deletions
This file was deleted.

.prettierignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,14 @@
22
/node_modules/
33
package.json
44
/test-results/
5+
6+
# build outputs
7+
dist/
8+
build/
9+
10+
# react native ios/android
11+
android/
12+
ios/
13+
14+
# git metadata
15+
.git/

.prettierrc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
{
22
"trailingComma": "es5",
3-
"singleQuote": true
3+
"singleQuote": true,
4+
"semi": true,
5+
"printWidth": 80,
6+
"tabWidth": 2,
7+
"bracketSpacing": true,
8+
"arrowParens": "avoid",
9+
"endOfLine": "lf"
410
}

__mocks__/react-native.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable import/no-commonjs */
21
module.exports = {
32
Platform: {
43
select(selection) {

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = function(api) {
1+
module.exports = function (api) {
22
api.cache(true);
33
return {
44
presets: ['module:metro-react-native-babel-preset'],

eslint.config.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
const { FlatCompat } = require('@eslint/eslintrc');
2+
const path = require('path');
3+
4+
const compat = new FlatCompat({ baseDirectory: path.resolve(process.cwd()) });
5+
6+
const babelParser = require('@babel/eslint-parser');
7+
8+
module.exports = [
9+
// load recommended configs via compat
10+
...compat.extends(
11+
'plugin:react/recommended',
12+
'plugin:react-native/all',
13+
'plugin:import/recommended',
14+
'plugin:prettier/recommended',
15+
'prettier'
16+
),
17+
18+
// ignore files (replaces .eslintignore)
19+
{ ignores: ['node_modules/**', 'build/**', 'docs/**', 'examples/**'] },
20+
21+
// custom rules from previous .eslintrc
22+
{
23+
languageOptions: {
24+
parser: babelParser,
25+
parserOptions: {
26+
requireConfigFile: false,
27+
ecmaVersion: 2020,
28+
sourceType: 'module',
29+
ecmaFeatures: { jsx: true },
30+
},
31+
},
32+
rules: {
33+
'class-methods-use-this': 'off',
34+
'import/namespace': 'off',
35+
'import/no-namespace': 'off',
36+
'react-native/no-color-literals': 'off',
37+
'react/prop-types': 'off',
38+
},
39+
},
40+
// react settings
41+
{
42+
settings: {
43+
react: { version: 'detect' },
44+
},
45+
},
46+
];

0 commit comments

Comments
 (0)