Skip to content

Commit da0bdc6

Browse files
authored
Merge pull request #1165 from terrestris/update-dependencies
Update all dependencies (except React)
2 parents 5457a71 + 9189bb5 commit da0bdc6

File tree

9 files changed

+3593
-5460
lines changed

9 files changed

+3593
-5460
lines changed

.eslintrc.js

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

eslint.config.mjs

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
import reactPlugin from 'eslint-plugin-react';
2+
import importPlugin from 'eslint-plugin-import';
3+
import reactHooksPlugin from 'eslint-plugin-react-hooks';
4+
import reactRefreshPlugin from 'eslint-plugin-react-refresh';
5+
import stylisticPlugin from '@stylistic/eslint-plugin'
6+
7+
import tsEslint from 'typescript-eslint';
8+
import eslint from '@eslint/js';
9+
import globals from 'globals';
10+
11+
import eslintTerrestris from '@terrestris/eslint-config-typescript';
12+
13+
export default tsEslint.config({
14+
extends: [
15+
eslint.configs.recommended,
16+
...tsEslint.configs.recommended,
17+
...tsEslint.configs.stylistic,
18+
importPlugin.flatConfigs.recommended
19+
],
20+
files: [
21+
'src/**/*.{js,mjs,cjs,ts,jsx,tsx}'
22+
],
23+
plugins: {
24+
react: reactPlugin,
25+
'@stylistic': stylisticPlugin,
26+
'react-hooks': reactHooksPlugin,
27+
'react-refresh': reactRefreshPlugin
28+
},
29+
languageOptions: {
30+
globals: globals.browser,
31+
ecmaVersion: 'latest',
32+
parserOptions: {
33+
project: true,
34+
tsconfigRootDir: import.meta.dirname
35+
}
36+
},
37+
rules: {
38+
...eslintTerrestris.rules,
39+
...reactHooksPlugin.configs.recommended.rules,
40+
'max-len': [
41+
'warn',
42+
{
43+
'code': 160
44+
}
45+
],
46+
47+
'@typescript-eslint/no-empty-function': 'off',
48+
'@typescript-eslint/no-unused-vars': 'warn',
49+
'@typescript-eslint/member-ordering': 'off',
50+
'@typescript-eslint/consistent-type-definitions': 'off',
51+
52+
'no-unused-vars': 'warn',
53+
'arrow-spacing': 'warn',
54+
'comma-spacing': 'warn',
55+
'comma-dangle': 'warn',
56+
'eol-last': 'warn',
57+
'no-multi-spaces': 'warn',
58+
'no-multiple-empty-lines': ['warn', {
59+
max: 1
60+
}],
61+
'object-property-newline': 'warn',
62+
'object-curly-newline': ['warn', {
63+
consistent: true,
64+
minProperties: 2
65+
}],
66+
'space-before-function-paren': ['warn', {
67+
anonymous: 'always',
68+
named: 'never',
69+
asyncArrow: 'always'
70+
}],
71+
72+
'react/jsx-max-props-per-line': ['warn', {
73+
maximum: 1
74+
}],
75+
'react/jsx-closing-tag-location': ['warn'],
76+
'react/jsx-closing-bracket-location': ['warn'],
77+
78+
'import/no-unresolved': 'off',
79+
'import/named': 'off',
80+
'import/order': ['warn', {
81+
groups: [
82+
'builtin',
83+
'external',
84+
'parent',
85+
'sibling',
86+
'index',
87+
'object'
88+
],
89+
'pathGroups': [{
90+
pattern: 'react',
91+
group: 'external',
92+
position: 'before'
93+
}, {
94+
pattern: '@terrestris/**',
95+
group: 'external',
96+
position: 'after'
97+
}],
98+
'pathGroupsExcludedImportTypes': ['react'],
99+
'newlines-between': 'always-and-inside-groups',
100+
'alphabetize': {
101+
order: 'asc',
102+
caseInsensitive: true
103+
}
104+
}]
105+
},
106+
settings: {
107+
react: {
108+
version: 'detect'
109+
}
110+
}
111+
});

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = {
1111
transformIgnorePatterns: [
1212
'<rootDir>/node_modules/(?!(ol|antd|@babel|jest-runtime|(rc-*[a-z]*)|@ant-design|@terrestris|' +
1313
'query-string|decode-uri-component|filter-obj|split-on-first|color-space|color-rgba|color-parse|shpjs|' +
14-
'@camptocamp/inkmap|d3-selection))'
14+
'@camptocamp/inkmap|d3-selection|geostyler-openlayers-parser|geostyler-style))'
1515
],
1616
moduleNameMapper: {
1717
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':

jest.setup.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
import '@testing-library/jest-dom';
22

3+
import {
4+
TextDecoder,
5+
TextEncoder
6+
} from 'util';
7+
8+
Object.assign(global, {
9+
TextDecoder,
10+
TextEncoder
11+
});
12+
313
// https://react.i18next.com/misc/testing
414
jest.mock('react-i18next', () => ({
515
// this mock makes sure any components using the translate hook can use it without a warning being shown

0 commit comments

Comments
 (0)