Skip to content

Commit 8c8bf38

Browse files
committed
[workflow/test] Added sonar config
1 parent 915ffd1 commit 8c8bf38

File tree

5 files changed

+25
-19
lines changed

5 files changed

+25
-19
lines changed

.eslintrc.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
module.exports = {
22
root: true,
33
extends: ['@react-native', 'plugin:testing-library/react'],
4-
ignorePatterns: ['*.js', '*.ts', '*.tsx', 'jest.*', 'metro.config.js', '.eslintrc.js'],
5-
overrides: [
6-
{
7-
files: ['src/**/*.{js,jsx,ts,tsx}'],
8-
rules: {
9-
'object-curly-spacing': ['error', 'always'],
10-
'unused-imports/no-unused-imports': 'error',
11-
},
12-
},
13-
],
4+
ignorePatterns: ['.eslintrc.js', '**/*.test.tsx', '**/*.test.ts'],
145
env: { jest: true },
156
parserOptions: {
167
sourceType: 'module',
@@ -19,4 +10,11 @@ module.exports = {
1910
project: './tsconfig.json',
2011
},
2112
plugins: ['unused-imports'],
13+
rules: {
14+
'object-curly-spacing': ['error', 'always'],
15+
'unused-imports/no-unused-imports': 'error',
16+
complexity: ['error', 8],
17+
'import/extensions': 0,
18+
'react/jsx-filename-extension': [2, { extensions: ['.tsx'] }],
19+
},
2220
};

App.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import React from 'react';
2-
import {SafeAreaView, ScrollView} from 'react-native';
3-
import {
4-
Container,
5-
ThemeProvider,
6-
} from './src/packages/react-native-material-elements';
2+
import { SafeAreaView, ScrollView } from 'react-native';
3+
import { Container, ThemeProvider } from './src/packages/react-native-material-elements';
74

85
function App(): React.JSX.Element {
96
return (

Component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react';
2-
import {Box, useTheme} from './src/packages/react-native-material-elements/src';
2+
import { Box, useTheme } from './src/packages/react-native-material-elements/src';
33

44
export const Component = () => {
5-
const {theme} = useTheme();
5+
const { theme } = useTheme();
66

77
console.log(theme.colors.scan);
88

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* @format
33
*/
44

5-
import {AppRegistry} from 'react-native';
5+
import { AppRegistry } from 'react-native';
66
import App from './App';
7-
import {name as appName} from './app.json';
7+
import { name as appName } from './app.json';
88

99
AppRegistry.registerComponent(appName, () => App);

sonar-project.properties

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
sonar.projectKey=material-elements_react-native-material-elements
2+
sonar.organization=material-elements
3+
4+
sonar.coverage.exclusions=**/android/**/*.*,**/ios/**/*.*,**/*.test.ts,**/*test.ts,**/*.test.tsx,**/*test.tsx,**/tests/**,**/specs/**
5+
6+
sonar.exclusions=**/android/**/*.*,**/ios/**/*.*
7+
8+
sonar.javascript.file.suffixes=.js,.jsx
9+
sonar.typescript.file.suffixes=.ts,.tsx
10+
11+
sonar.javascript.lcov.reportPaths=coverage/lcov.info

0 commit comments

Comments
 (0)