Skip to content

Commit

Permalink
Merge pull request #6 from open-rpc/eslint-and-share-stuff
Browse files Browse the repository at this point in the history
feat: use shared files and update to eslint
  • Loading branch information
BelfordZ authored Nov 29, 2024
2 parents c7699c9 + 47f1bf4 commit fcce050
Show file tree
Hide file tree
Showing 15 changed files with 1,963 additions and 1,547 deletions.
29 changes: 29 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'react', 'react-hooks'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'prettier'
],
env: {
browser: true,
node: true,
jest: true
},
settings: {
react: {
version: 'detect'
}
},
rules: {
'react/prop-types': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'no-console': ['warn', { allow: ['warn', 'error'] }]
}
};
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "avoid"
}
30 changes: 19 additions & 11 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
module.exports = {
"clearMocks": true,
"coverageDirectory": "../coverage",
"resetMocks": true,
"restoreMocks": true,
"rootDir": "./src",
"testEnvironment": "jsdom",
"testPathIgnorePatterns": ["./build"],
"preset": "ts-jest",
"transformIgnorePatterns": ['^.+\\.js$'],
"moduleNameMapper": {
"\\.(css|less|sass|scss)$": "jest-transform-css",
preset: 'ts-jest',
testEnvironment: 'jsdom',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'.+\\.(css|styl|less|sass|scss)$': 'jest-transform-css'
},
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
coveragePathIgnorePatterns: [
'/node_modules/',
'/build/',
'/dist/',
'/package/'
],
setupFilesAfterEnv: [],
globals: {
'ts-jest': {
tsconfig: './tsconfig.json'
}
}
};
Loading

0 comments on commit fcce050

Please sign in to comment.