From 04fd6a82bc4fc4695b19499ae2fcfe372072f5a6 Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Sun, 12 Nov 2023 18:24:24 +0100 Subject: [PATCH] Upgrade to latest ESLint config + react-scripts - https://github.com/upleveled/eslint-config-upleveled/pull/301 - https://github.com/upleveled/create-react-app/pull/3 --- .eslintignore | 6 --- .eslintrc.cjs | 6 --- eslint.config.js | 1 + package.json | 3 +- pnpm-lock.yaml | 102 +++++++++++++++++++++++++++++------------------ tsconfig.json | 1 - 6 files changed, 67 insertions(+), 52 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.cjs create mode 100644 eslint.config.js diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index f92fa625..00000000 --- a/.eslintignore +++ /dev/null @@ -1,6 +0,0 @@ -.eslintrc.js -*.config.js -build - -# Next.js build folder -.next diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 6ee35d95..00000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,6 +0,0 @@ -/** @type {import('@typescript-eslint/utils').TSESLint.Linter.Config} */ -const config = { - extends: ['upleveled'], -}; - -module.exports = config; diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..3697aa95 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1 @@ +export { default } from 'eslint-config-upleveled'; diff --git a/package.json b/package.json index 966f3911..bc8dac3f 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "preflight-test-project-react-passing", "version": "0.1.0", "private": true, + "type": "module", "scripts": { "build": "react-scripts build", "eject": "react-scripts eject", @@ -37,7 +38,7 @@ "@types/react-dom": "18.2.15", "@types/testing-library__jest-dom": "5.14.9", "eslint": "8.53.0", - "eslint-config-upleveled": "6.2.0", + "eslint-config-upleveled": "7.0.0-2", "expect": "29.7.0", "stylelint": "15.11.0", "stylelint-config-upleveled": "1.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dd909ef3..9771a87f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -50,8 +50,8 @@ devDependencies: specifier: 8.53.0 version: 8.53.0 eslint-config-upleveled: - specifier: 6.2.0 - version: 6.2.0(@babel/eslint-parser@7.22.15)(@next/eslint-plugin-next@14.0.1)(@types/eslint@8.44.6)(@types/node@20.9.0)(@types/react-dom@18.2.15)(@types/react@18.2.37)(@typescript-eslint/eslint-plugin@6.10.0)(@typescript-eslint/parser@6.10.0)(eslint-import-resolver-typescript@3.6.1)(eslint-plugin-import@2.29.0)(eslint-plugin-jsx-a11y@6.8.0)(eslint-plugin-jsx-expressions@1.3.1)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.33.2)(eslint-plugin-security@1.7.1)(eslint-plugin-sonarjs@0.22.0)(eslint-plugin-testing-library@6.1.0)(eslint-plugin-unicorn@49.0.0)(eslint-plugin-upleveled@2.1.9)(eslint@8.53.0)(typescript@5.2.2) + specifier: 7.0.0-2 + version: 7.0.0-2(@babel/eslint-parser@7.23.3)(@next/eslint-plugin-next@14.0.2)(@types/eslint@8.44.7)(@types/node@20.9.0)(@types/react-dom@18.2.15)(@types/react@18.2.37)(@typescript-eslint/eslint-plugin@6.10.0)(@typescript-eslint/parser@6.10.0)(eslint-import-resolver-typescript@3.6.1)(eslint-plugin-import@2.29.0)(eslint-plugin-jsx-a11y@6.8.0)(eslint-plugin-jsx-expressions@1.3.1)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.33.2)(eslint-plugin-security@1.7.1)(eslint-plugin-sonarjs@0.23.0)(eslint-plugin-testing-library@6.1.2)(eslint-plugin-unicorn@49.0.0)(eslint-plugin-upleveled@2.1.9)(eslint@8.53.0)(globals@13.23.0)(typescript@5.2.2) expect: specifier: 29.7.0 version: 29.7.0 @@ -126,8 +126,8 @@ packages: transitivePeerDependencies: - supports-color - /@babel/eslint-parser@7.22.15(@babel/core@7.21.4)(eslint@8.53.0): - resolution: {integrity: sha512-yc8OOBIQk1EcRrpizuARSQS0TWAcOMpEJ1aafhNznaeYkeL+OhqnDObGFylB8ka8VFF/sZc+S4RzHyO+3LjQxg==} + /@babel/eslint-parser@7.23.3(@babel/core@7.21.4)(eslint@8.53.0): + resolution: {integrity: sha512-9bTuNlyx7oSstodm1cR1bECj4fkiknsDa1YniISkJemMY3DGhJNYBECbe6QD/q54mp2J8VO66jW3/7uP//iFCw==} engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0} peerDependencies: '@babel/core': ^7.11.0 @@ -268,7 +268,7 @@ packages: '@babel/helper-module-imports': 7.21.4 '@babel/helper-simple-access': 7.20.2 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/helper-validator-identifier': 7.22.20 + '@babel/helper-validator-identifier': 7.22.5 '@babel/template': 7.20.7 '@babel/traverse': 7.21.4 '@babel/types': 7.21.4 @@ -338,10 +338,18 @@ packages: resolution: {integrity: sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==} engines: {node: '>=6.9.0'} + /@babel/helper-validator-identifier@7.19.1: + resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} + engines: {node: '>=6.9.0'} + /@babel/helper-validator-identifier@7.22.20: resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} engines: {node: '>=6.9.0'} + /@babel/helper-validator-identifier@7.22.5: + resolution: {integrity: sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==} + engines: {node: '>=6.9.0'} + /@babel/helper-validator-option@7.21.0: resolution: {integrity: sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==} engines: {node: '>=6.9.0'} @@ -372,7 +380,7 @@ packages: resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-validator-identifier': 7.22.20 + '@babel/helper-validator-identifier': 7.19.1 chalk: 2.4.2 js-tokens: 4.0.0 @@ -1439,7 +1447,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/helper-string-parser': 7.19.4 - '@babel/helper-validator-identifier': 7.22.20 + '@babel/helper-validator-identifier': 7.22.5 to-fast-properties: 2.0.0 /@csstools/css-parser-algorithms@2.3.2(@csstools/css-tokenizer@2.2.1): @@ -1828,8 +1836,8 @@ packages: resolution: {integrity: sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==} dev: false - /@next/eslint-plugin-next@14.0.1: - resolution: {integrity: sha512-bLjJMwXdzvhnQOnxvHoTTUh/+PYk6FF/DCgHi4BXwXCINer+o1ZYfL9aVeezj/oI7wqGJOqwGIXrlBvPbAId3w==} + /@next/eslint-plugin-next@14.0.2: + resolution: {integrity: sha512-APrYFsXfAhnysycqxHcpg6Y4i7Ukp30GzVSZQRKT3OczbzkqGjt33vNhScmgoOXYBU1CfkwgtXmNxdiwv1jKmg==} dependencies: glob: 7.1.7 dev: true @@ -2191,12 +2199,12 @@ packages: /@types/eslint-scope@3.7.4: resolution: {integrity: sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==} dependencies: - '@types/eslint': 8.44.6 + '@types/eslint': 8.44.7 '@types/estree': 1.0.1 dev: false - /@types/eslint@8.44.6: - resolution: {integrity: sha512-P6bY56TVmX8y9J87jHNgQh43h6VVU+6H7oN7hgvivV81K2XY8qJZ5vqPy/HdUoVIelii2kChYVzQanlswPWVFw==} + /@types/eslint@8.44.7: + resolution: {integrity: sha512-f5ORu2hcBbKei97U73mf+l9t4zTGl74IqZ0GQk4oVea/VS8tQZYkUveSYojk+frraAVYId0V2WC9O4PTNru2FQ==} dependencies: '@types/estree': 1.0.1 '@types/json-schema': 7.0.12 @@ -3402,7 +3410,7 @@ packages: /call-bind@1.0.2: resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} dependencies: - function-bind: 1.1.2 + function-bind: 1.1.1 get-intrinsic: 1.2.1 /callsites@3.1.0: @@ -4390,20 +4398,20 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - /eslint-config-upleveled@6.2.0(@babel/eslint-parser@7.22.15)(@next/eslint-plugin-next@14.0.1)(@types/eslint@8.44.6)(@types/node@20.9.0)(@types/react-dom@18.2.15)(@types/react@18.2.37)(@typescript-eslint/eslint-plugin@6.10.0)(@typescript-eslint/parser@6.10.0)(eslint-import-resolver-typescript@3.6.1)(eslint-plugin-import@2.29.0)(eslint-plugin-jsx-a11y@6.8.0)(eslint-plugin-jsx-expressions@1.3.1)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.33.2)(eslint-plugin-security@1.7.1)(eslint-plugin-sonarjs@0.22.0)(eslint-plugin-testing-library@6.1.0)(eslint-plugin-unicorn@49.0.0)(eslint-plugin-upleveled@2.1.9)(eslint@8.53.0)(typescript@5.2.2): - resolution: {integrity: sha512-0Ms5oxFG5zQRB/fasyTiaAKdGX+SypLJ/q6IXF8B+abRNVeSGwd3dY187JSrA1aPFmH0AXI5k0wnok2G2CvhIg==} + /eslint-config-upleveled@7.0.0-2(@babel/eslint-parser@7.23.3)(@next/eslint-plugin-next@14.0.2)(@types/eslint@8.44.7)(@types/node@20.9.0)(@types/react-dom@18.2.15)(@types/react@18.2.37)(@typescript-eslint/eslint-plugin@6.10.0)(@typescript-eslint/parser@6.10.0)(eslint-import-resolver-typescript@3.6.1)(eslint-plugin-import@2.29.0)(eslint-plugin-jsx-a11y@6.8.0)(eslint-plugin-jsx-expressions@1.3.1)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.33.2)(eslint-plugin-security@1.7.1)(eslint-plugin-sonarjs@0.23.0)(eslint-plugin-testing-library@6.1.2)(eslint-plugin-unicorn@49.0.0)(eslint-plugin-upleveled@2.1.9)(eslint@8.53.0)(globals@13.23.0)(typescript@5.2.2): + resolution: {integrity: sha512-YsXTLdDCJWH9ggYa3luSsjC11ECqsFzwAYKmEBFOueWUyitHDlc2cIRvIFna7Vgkyz9sifVS1WZUoRRtKWnpKg==} engines: {node: '>=18.0.0'} hasBin: true peerDependencies: - '@babel/eslint-parser': ^7.22.15 - '@next/eslint-plugin-next': ^14.0.1 - '@types/eslint': ^8.44.6 - '@types/node': '>=20.8.10' - '@types/react': ^18.2.34 - '@types/react-dom': ^18.2.14 - '@typescript-eslint/eslint-plugin': ^6.9.1 - '@typescript-eslint/parser': ^6.9.1 - eslint: ^8.52.0 + '@babel/eslint-parser': ^7.23.3 + '@next/eslint-plugin-next': ^14.0.2 + '@types/eslint': ^8.44.7 + '@types/node': '>=20.9.0' + '@types/react': ^18.2.37 + '@types/react-dom': ^18.2.15 + '@typescript-eslint/eslint-plugin': ^6.10.0 + '@typescript-eslint/parser': ^6.10.0 + eslint: ^8.53.0 eslint-import-resolver-typescript: ^3.6.1 eslint-plugin-import: ^2.29.0 eslint-plugin-jsx-a11y: ^6.8.0 @@ -4411,15 +4419,16 @@ packages: eslint-plugin-react: ^7.33.2 eslint-plugin-react-hooks: ^4.6.0 eslint-plugin-security: ^1.7.1 - eslint-plugin-sonarjs: ^0.22.0 - eslint-plugin-testing-library: ^6.1.0 + eslint-plugin-sonarjs: ^0.23.0 + eslint-plugin-testing-library: ^6.1.2 eslint-plugin-unicorn: ^49.0.0 eslint-plugin-upleveled: ^2.1.9 + globals: ^13.23.0 typescript: ^5.2.2 dependencies: - '@babel/eslint-parser': 7.22.15(@babel/core@7.21.4)(eslint@8.53.0) - '@next/eslint-plugin-next': 14.0.1 - '@types/eslint': 8.44.6 + '@babel/eslint-parser': 7.23.3(@babel/core@7.21.4)(eslint@8.53.0) + '@next/eslint-plugin-next': 14.0.2 + '@types/eslint': 8.44.7 '@types/node': 20.9.0 '@types/react': 18.2.37 '@types/react-dom': 18.2.15 @@ -4433,10 +4442,11 @@ packages: eslint-plugin-react: 7.33.2(eslint@8.53.0) eslint-plugin-react-hooks: 4.6.0(eslint@8.53.0) eslint-plugin-security: 1.7.1 - eslint-plugin-sonarjs: 0.22.0(eslint@8.53.0) - eslint-plugin-testing-library: 6.1.0(eslint@8.53.0)(typescript@5.2.2) + eslint-plugin-sonarjs: 0.23.0(eslint@8.53.0) + eslint-plugin-testing-library: 6.1.2(eslint@8.53.0)(typescript@5.2.2) eslint-plugin-unicorn: 49.0.0(eslint@8.53.0) eslint-plugin-upleveled: 2.1.9(eslint@8.53.0) + globals: 13.23.0 typescript: 5.2.2 dev: true @@ -4623,8 +4633,8 @@ packages: safe-regex: 2.1.1 dev: true - /eslint-plugin-sonarjs@0.22.0(eslint@8.53.0): - resolution: {integrity: sha512-LJz+TCosMOBLkbAsNk6Q1lCgmK6qNO5RCqtOAle1DCnqqnmxoSTPHakZ1R7Gcnjhw5n7VDcAwuqefmpd4XXPLQ==} + /eslint-plugin-sonarjs@0.23.0(eslint@8.53.0): + resolution: {integrity: sha512-z44T3PBf9W7qQ/aR+NmofOTyg6HLhSEZOPD4zhStqBpLoMp8GYhFksuUBnCxbnf1nfISpKBVkQhiBLFI/F4Wlg==} engines: {node: '>=14'} peerDependencies: eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -4632,8 +4642,8 @@ packages: eslint: 8.53.0 dev: true - /eslint-plugin-testing-library@6.1.0(eslint@8.53.0)(typescript@5.2.2): - resolution: {integrity: sha512-r7kE+az3tbp8vyRwfyAGZ6V/xw+XvdWFPicIo6jbOPZoossOFDeHizARqPGV6gEkyF8hyCFhhH3mlQOGS3N5Sg==} + /eslint-plugin-testing-library@6.1.2(eslint@8.53.0)(typescript@5.2.2): + resolution: {integrity: sha512-Ra16FeBlonfbScOIdZEta9o+OxtwDqiUt+4UCpIM42TuatyLdtfU/SbwnIzPcAszrbl58PGwyZ9YGU9dwIo/tA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0, npm: '>=6'} peerDependencies: eslint: ^7.5.0 || ^8.0.0 @@ -5101,6 +5111,9 @@ packages: requiresBuild: true optional: true + /function-bind@1.1.1: + resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + /function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} @@ -5123,7 +5136,7 @@ packages: /get-intrinsic@1.2.1: resolution: {integrity: sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==} dependencies: - function-bind: 1.1.2 + function-bind: 1.1.1 has: 1.0.3 has-proto: 1.0.1 has-symbols: 1.0.3 @@ -5224,6 +5237,13 @@ packages: dependencies: type-fest: 0.20.2 + /globals@13.23.0: + resolution: {integrity: sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==} + engines: {node: '>=8'} + dependencies: + type-fest: 0.20.2 + dev: true + /globalthis@1.0.3: resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} engines: {node: '>= 0.4'} @@ -5310,7 +5330,7 @@ packages: resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} engines: {node: '>= 0.4.0'} dependencies: - function-bind: 1.1.2 + function-bind: 1.1.1 /hasown@2.0.0: resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==} @@ -5618,6 +5638,12 @@ packages: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} + /is-core-module@2.13.0: + resolution: {integrity: sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==} + dependencies: + has: 1.0.3 + dev: true + /is-core-module@2.13.1: resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} dependencies: @@ -6444,7 +6470,7 @@ packages: engines: {node: '>=10'} dependencies: hosted-git-info: 4.1.0 - is-core-module: 2.13.1 + is-core-module: 2.13.0 semver: 7.5.4 validate-npm-package-license: 3.0.4 dev: true diff --git a/tsconfig.json b/tsconfig.json index 846c0438..418720ee 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig", "extends": "eslint-config-upleveled/tsconfig.base.json", "include": [ - "**/.eslintrc.cjs", "**/*.ts", "**/*.tsx", "**/*.js",