From 91abddebe26572ee80253fddaa2232a51d15b310 Mon Sep 17 00:00:00 2001 From: Hayden Bleasel Date: Tue, 28 May 2024 00:01:08 -0400 Subject: [PATCH 1/3] Add eslint-plugin-compat --- eslint.config.mjs | 10 +++++----- package.json | 4 ++++ pnpm-lock.yaml | 39 ++++++++++++++++++++++++++++++++++++++- rules/compat.mjs | 5 +++++ test/test.tsx | 10 ++++++++++ 5 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 rules/compat.mjs diff --git a/eslint.config.mjs b/eslint.config.mjs index ba41e7c..028befd 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -17,6 +17,7 @@ import unusedImports from 'eslint-plugin-unused-imports'; // import tailwindcss from 'eslint-plugin-tailwindcss'; import * as importTypescriptResolver from 'eslint-import-resolver-typescript'; import html from 'eslint-plugin-html'; +import compat from 'eslint-plugin-compat'; import eslintPrettier from 'eslint-config-prettier'; import * as typescriptParser from '@typescript-eslint/parser'; @@ -39,10 +40,7 @@ import storybookRules from './rules/storybook.mjs'; // import tailwindcssRules from './rules/tailwindcss.mjs'; import unusedImportsRules from './rules/unused-imports.mjs'; import sonarjsRules from './rules/sonarjs.mjs'; - -// Patch AudioWorkletGlobalScope -const browserGlobals = { ...globals.browser }; -delete browserGlobals['AudioWorkletGlobalScope ']; +import compatRules from './rules/compat.mjs'; const config = [ importPlugin.configs.typescript, @@ -50,7 +48,7 @@ const config = [ languageOptions: { sourceType: 'module', globals: { - ...browserGlobals, + ...globals.browser, ...globals.node, }, parserOptions: { @@ -83,6 +81,7 @@ const config = [ 'unused-imports': unusedImports, // tailwindcss, sonarjs, + compat, }, rules: { ...eslintRules, @@ -98,6 +97,7 @@ const config = [ ...unusedImportsRules, // ...tailwindcssRules, ...sonarjsRules, + ...compatRules, }, settings: { diff --git a/package.json b/package.json index f5cdaa2..550af2d 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,14 @@ { + "browserslist": [ + "defaults" + ], "dependencies": { "@next/eslint-plugin-next": "^14.2.3", "@typescript-eslint/eslint-plugin": "^7.11.0", "@typescript-eslint/parser": "^7.11.0", "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "^3.6.1", + "eslint-plugin-compat": "^4.2.0", "eslint-plugin-cypress": "^3.2.0", "eslint-plugin-html": "^8.1.1", "eslint-plugin-import": "^2.29.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b2d4237..2a4255b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,6 +23,9 @@ importers: eslint-import-resolver-typescript: specifier: ^3.6.1 version: 3.6.1(@typescript-eslint/parser@7.11.0(eslint@8.56.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@8.56.0) + eslint-plugin-compat: + specifier: ^4.2.0 + version: 4.2.0(eslint@8.56.0) eslint-plugin-cypress: specifier: ^3.2.0 version: 3.2.0(eslint@8.56.0) @@ -590,6 +593,9 @@ packages: '@jridgewell/trace-mapping@0.3.19': resolution: {integrity: sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==} + '@mdn/browser-compat-data@5.5.29': + resolution: {integrity: sha512-NHdG3QOiAsxh8ygBSKMa/WaNJwpNt87uVqW+S2RlnSqgeRdk+L3foNWTX6qd0I3NHSlCFb47rgopeNCJtRDY5A==} + '@next/eslint-plugin-next@14.2.3': resolution: {integrity: sha512-L3oDricIIjgj1AVnRdRor21gI7mShlSwU/1ZGHmqM3LzHhXXhdkrfeNY5zif25Bi5Dd7fiJHsbhoZCHfXYvlAw==} @@ -985,6 +991,9 @@ packages: resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} engines: {node: '>= 0.4'} + ast-metadata-inferer@0.8.0: + resolution: {integrity: sha512-jOMKcHht9LxYIEQu+RVd22vtgrPaVCtDRQ/16IGmurdzxvYbDd5ynxjnyrzLnieG96eTcAyaoj/wN/4/1FyyeA==} + ast-types-flow@0.0.8: resolution: {integrity: sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==} @@ -1438,6 +1447,12 @@ packages: eslint-import-resolver-webpack: optional: true + eslint-plugin-compat@4.2.0: + resolution: {integrity: sha512-RDKSYD0maWy5r7zb5cWQS+uSPc26mgOzdORJ8hxILmWM7S/Ncwky7BcAtXVY5iRbKjBdHsWU8Yg7hfoZjtkv7w==} + engines: {node: '>=14.x'} + peerDependencies: + eslint: ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 + eslint-plugin-cypress@3.2.0: resolution: {integrity: sha512-HaxMz6BoU4ay+K4WrG9ZJC1NdX06FqSlAwtRDStjM0ORFT7zCNPNuRJ+kUPc17Rt2AMUBSqeD9L0zTR3uZhPpw==} peerDependencies: @@ -2296,6 +2311,9 @@ packages: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} + lodash.memoize@4.1.2: + resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} + lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} @@ -3777,6 +3795,8 @@ snapshots: '@jridgewell/resolve-uri': 3.1.1 '@jridgewell/sourcemap-codec': 1.4.15 + '@mdn/browser-compat-data@5.5.29': {} + '@next/eslint-plugin-next@14.2.3': dependencies: glob: 10.3.10 @@ -4234,6 +4254,10 @@ snapshots: is-array-buffer: 3.0.4 is-shared-array-buffer: 1.0.3 + ast-metadata-inferer@0.8.0: + dependencies: + '@mdn/browser-compat-data': 5.5.29 + ast-types-flow@0.0.8: {} astral-regex@2.0.0: {} @@ -4822,6 +4846,17 @@ snapshots: transitivePeerDependencies: - supports-color + eslint-plugin-compat@4.2.0(eslint@8.56.0): + dependencies: + '@mdn/browser-compat-data': 5.5.29 + ast-metadata-inferer: 0.8.0 + browserslist: 4.22.1 + caniuse-lite: 1.0.30001546 + eslint: 8.56.0 + find-up: 5.0.0 + lodash.memoize: 4.1.2 + semver: 7.6.2 + eslint-plugin-cypress@3.2.0(eslint@8.56.0): dependencies: eslint: 8.56.0 @@ -5943,6 +5978,8 @@ snapshots: dependencies: p-locate: 5.0.0 + lodash.memoize@4.1.2: {} + lodash.merge@4.6.2: {} lodash.sortby@4.7.0: {} @@ -6849,7 +6886,7 @@ snapshots: dependencies: browserslist: 4.22.1 escalade: 3.1.1 - picocolors: 1.0.0 + picocolors: 1.0.1 uri-js@4.4.1: dependencies: diff --git a/rules/compat.mjs b/rules/compat.mjs new file mode 100644 index 0000000..ff57661 --- /dev/null +++ b/rules/compat.mjs @@ -0,0 +1,5 @@ +const config = { + 'compat/compat': 'warn', +}; + +export default config; diff --git a/test/test.tsx b/test/test.tsx index 5cd25ee..34603a6 100644 --- a/test/test.tsx +++ b/test/test.tsx @@ -15,3 +15,13 @@ if (true) { } else { z(); } + +fetch('google.com'); + +// Instantiate PaymentRequest +const req = new PaymentRequest(); + +// Instantiate IntersectionObserver +const observer = new IntersectionObserver(() => {}); + +const foo = Object.values({}); \ No newline at end of file From 4c7a9048a99f5f77e84c924b1a30a06a9c2e821d Mon Sep 17 00:00:00 2001 From: Hayden Bleasel Date: Tue, 28 May 2024 00:09:16 -0400 Subject: [PATCH 2/3] Rework into src folder to dogfood builds --- eslint.config.mjs | 189 +-------------------- pnpm-lock.yaml | 172 +++++++++++++++++-- prettier.config.mjs | 15 +- src/eslint.config.mjs | 188 ++++++++++++++++++++ src/prettier.config.mjs | 14 ++ {rules => src/rules}/compat.mjs | 0 {rules => src/rules}/cypress.mjs | 0 {rules => src/rules}/eslint-typescript.mjs | 0 {rules => src/rules}/eslint.mjs | 0 {rules => src/rules}/import.mjs | 0 {rules => src/rules}/jest.mjs | 0 {rules => src/rules}/jsx-a11y.mjs | 0 {rules => src/rules}/n.mjs | 0 {rules => src/rules}/next.mjs | 0 {rules => src/rules}/prettier.mjs | 0 {rules => src/rules}/promise.mjs | 0 {rules => src/rules}/react.mjs | 0 {rules => src/rules}/reactHooks.mjs | 0 {rules => src/rules}/sonarjs.mjs | 0 {rules => src/rules}/storybook.mjs | 0 {rules => src/rules}/tailwindcss.mjs | 0 {rules => src/rules}/typescript.mjs | 0 {rules => src/rules}/unused-imports.mjs | 0 src/stylelint.config.mjs | 36 ++++ stylelint.config.mjs | 37 +--- tsconfig.json | 2 +- tsup.config.ts | 2 +- 27 files changed, 401 insertions(+), 254 deletions(-) create mode 100644 src/eslint.config.mjs create mode 100644 src/prettier.config.mjs rename {rules => src/rules}/compat.mjs (100%) rename {rules => src/rules}/cypress.mjs (100%) rename {rules => src/rules}/eslint-typescript.mjs (100%) rename {rules => src/rules}/eslint.mjs (100%) rename {rules => src/rules}/import.mjs (100%) rename {rules => src/rules}/jest.mjs (100%) rename {rules => src/rules}/jsx-a11y.mjs (100%) rename {rules => src/rules}/n.mjs (100%) rename {rules => src/rules}/next.mjs (100%) rename {rules => src/rules}/prettier.mjs (100%) rename {rules => src/rules}/promise.mjs (100%) rename {rules => src/rules}/react.mjs (100%) rename {rules => src/rules}/reactHooks.mjs (100%) rename {rules => src/rules}/sonarjs.mjs (100%) rename {rules => src/rules}/storybook.mjs (100%) rename {rules => src/rules}/tailwindcss.mjs (100%) rename {rules => src/rules}/typescript.mjs (100%) rename {rules => src/rules}/unused-imports.mjs (100%) create mode 100644 src/stylelint.config.mjs diff --git a/eslint.config.mjs b/eslint.config.mjs index 028befd..9e349a3 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,188 +1 @@ -/* eslint-disable n/no-unpublished-import, n/no-extraneous-import, import/no-extraneous-dependencies, id-length */ - -import react from 'eslint-plugin-react'; -import reactHooks from 'eslint-plugin-react-hooks'; -import typescript from '@typescript-eslint/eslint-plugin'; -import jsxA11y from 'eslint-plugin-jsx-a11y'; -import * as importPlugin from 'eslint-plugin-import'; -import jest from 'eslint-plugin-jest'; -import promise from 'eslint-plugin-promise'; -import n from 'eslint-plugin-n'; -import next from '@next/eslint-plugin-next'; -import globals from 'globals'; -import prettier from 'eslint-plugin-prettier'; -import cypress from 'eslint-plugin-cypress'; -import storybook from 'eslint-plugin-storybook'; -import unusedImports from 'eslint-plugin-unused-imports'; -// import tailwindcss from 'eslint-plugin-tailwindcss'; -import * as importTypescriptResolver from 'eslint-import-resolver-typescript'; -import html from 'eslint-plugin-html'; -import compat from 'eslint-plugin-compat'; - -import eslintPrettier from 'eslint-config-prettier'; -import * as typescriptParser from '@typescript-eslint/parser'; -import sonarjs from 'eslint-plugin-sonarjs'; - -import eslintRules from './rules/eslint.mjs'; -import reactRules from './rules/react.mjs'; -import reactHooksRules from './rules/reactHooks.mjs'; -import typescriptRules from './rules/typescript.mjs'; -import jsxA11yRules from './rules/jsx-a11y.mjs'; -import importRules from './rules/import.mjs'; -import jestRules from './rules/jest.mjs'; -import promiseRules from './rules/promise.mjs'; -import nRules from './rules/n.mjs'; -import nextRules from './rules/next.mjs'; -import prettierRules from './rules/prettier.mjs'; -import eslintTypescriptRules from './rules/eslint-typescript.mjs'; -import cypressRules from './rules/cypress.mjs'; -import storybookRules from './rules/storybook.mjs'; -// import tailwindcssRules from './rules/tailwindcss.mjs'; -import unusedImportsRules from './rules/unused-imports.mjs'; -import sonarjsRules from './rules/sonarjs.mjs'; -import compatRules from './rules/compat.mjs'; - -const config = [ - importPlugin.configs.typescript, - { - languageOptions: { - sourceType: 'module', - globals: { - ...globals.browser, - ...globals.node, - }, - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - ecmaFeatures: { - jsx: true, - }, - }, - }, - files: [ - '**/*.js', - '**/*.jsx', - '**/*.ts', - '**/*.tsx', - '**/*.json', - '**/*.mjs', - '**/*.cjs', - '**/*.html', - ], - plugins: { - prettier, - react, - 'react-hooks': reactHooks, - 'jsx-a11y': jsxA11y, - import: importPlugin, - promise, - n, - '@next/next': next, - 'unused-imports': unusedImports, - // tailwindcss, - sonarjs, - compat, - }, - rules: { - ...eslintRules, - ...reactRules, - ...reactHooksRules, - ...jsxA11yRules, - ...importRules, - ...promiseRules, - ...nRules, - ...nextRules, - ...prettierRules, - ...eslintPrettier.rules, - ...unusedImportsRules, - // ...tailwindcssRules, - ...sonarjsRules, - ...compatRules, - }, - - settings: { - react: { - version: 'detect', - }, - - // https://github.com/import-js/eslint-plugin-import/issues/2556#issuecomment-1419518561 - 'import/parsers': { - espree: ['.js', '.cjs', '.mjs', '.jsx', '.ts', '.tsx'], - }, - 'import/resolver': { - typescript: true, - node: true, - }, - }, - }, - { - files: ['**/*.ts', '**/*.tsx'], - languageOptions: { - parser: typescriptParser, - parserOptions: { - project: './tsconfig.json', - }, - }, - plugins: { - '@typescript-eslint': typescript, - 'import/typescript': importTypescriptResolver, - }, - rules: { - ...eslintTypescriptRules, - ...typescriptRules, - }, - }, - { - files: ['**/*.test.js', '**/*.test.jsx', 'tests/**/*.js', 'tests/**/*.jsx'], - languageOptions: { - globals: { - ...globals.jest, - }, - }, - plugins: { - jest, - }, - rules: { - ...jestRules, - }, - }, - { - files: ['**/*.cy.js', '**/*.cy.jsx'], - languageOptions: { - globals: { - ...globals.cypress, - }, - }, - plugins: { - cypress, - }, - rules: { - ...cypressRules, - }, - }, - { - files: [ - '**/*.stories.js', - '**/*.stories.jsx', - '**/*.stories.ts', - '**/*.stories.tsx', - ], - plugins: { - storybook, - }, - rules: { - ...storybookRules, - }, - }, - { - files: ['**/*.html'], - plugins: { - html, - }, - settings: { - 'html/javascript-tag-names': ['script', 'Script'], - }, - }, -]; - -export default config; +export { default } from './dist/eslint.config.mjs'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2a4255b..c880360 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -579,20 +579,35 @@ packages: resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} engines: {node: '>=6.0.0'} + '@jridgewell/gen-mapping@0.3.5': + resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} + engines: {node: '>=6.0.0'} + '@jridgewell/resolve-uri@3.1.1': resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} engines: {node: '>=6.0.0'} + '@jridgewell/resolve-uri@3.1.2': + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + '@jridgewell/set-array@1.1.2': resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} engines: {node: '>=6.0.0'} + '@jridgewell/set-array@1.2.1': + resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} + engines: {node: '>=6.0.0'} + '@jridgewell/sourcemap-codec@1.4.15': resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} '@jridgewell/trace-mapping@0.3.19': resolution: {integrity: sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==} + '@jridgewell/trace-mapping@0.3.25': + resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} + '@mdn/browser-compat-data@5.5.29': resolution: {integrity: sha512-NHdG3QOiAsxh8ygBSKMa/WaNJwpNt87uVqW+S2RlnSqgeRdk+L3foNWTX6qd0I3NHSlCFb47rgopeNCJtRDY5A==} @@ -1064,6 +1079,10 @@ packages: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + browserslist@4.22.1: resolution: {integrity: sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -1108,8 +1127,8 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} - caniuse-lite@1.0.30001546: - resolution: {integrity: sha512-zvtSJwuQFpewSyRrI3AsftF6rM0X80mZkChIt1spBGEvRglCrjTniXvinc8JKRoqTwXAgvqTImaN9igfSMtUBw==} + caniuse-lite@1.0.30001624: + resolution: {integrity: sha512-0dWnQG87UevOCPYaOR49CBcLBwoZLpws+k6W37nLjWUhumP1Isusj0p2u+3KhjNloRWK9OKMgjBBzPujQHw4nA==} chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} @@ -1127,6 +1146,10 @@ packages: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} engines: {node: '>= 8.10.0'} + chokidar@3.6.0: + resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} + engines: {node: '>= 8.10.0'} + ci-info@3.9.0: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} engines: {node: '>=8'} @@ -1667,6 +1690,10 @@ packages: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -1761,6 +1788,11 @@ packages: engines: {node: '>=16 || 14 >=14.17'} hasBin: true + glob@10.4.1: + resolution: {integrity: sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==} + engines: {node: '>=16 || 14 >=14.18'} + hasBin: true + glob@7.1.6: resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==} deprecated: Glob versions prior to v9 are no longer supported @@ -2082,6 +2114,10 @@ packages: resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==} engines: {node: '>=14'} + jackspeak@3.1.2: + resolution: {integrity: sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==} + engines: {node: '>=14'} + jest-changed-files@29.7.0: resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -2296,6 +2332,10 @@ packages: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} + lilconfig@3.1.1: + resolution: {integrity: sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==} + engines: {node: '>=14'} + lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} @@ -2369,6 +2409,10 @@ packages: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} + micromatch@4.0.7: + resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} + engines: {node: '>=8.6'} + mimic-fn@2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} @@ -2574,6 +2618,18 @@ packages: ts-node: optional: true + postcss-load-config@4.0.2: + resolution: {integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==} + engines: {node: '>= 14'} + peerDependencies: + postcss: '>=8.0.9' + ts-node: '>=9.0.0' + peerDependenciesMeta: + postcss: + optional: true + ts-node: + optional: true + postcss-nested@6.0.1: resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==} engines: {node: '>=12.0'} @@ -2767,6 +2823,10 @@ packages: resolution: {integrity: sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw==} hasBin: true + resolve@1.22.8: + resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} + hasBin: true + resolve@2.0.0-next.5: resolution: {integrity: sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==} hasBin: true @@ -2983,6 +3043,11 @@ packages: engines: {node: '>=8'} hasBin: true + sucrase@3.35.0: + resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} + engines: {node: '>=16 || 14 >=14.17'} + hasBin: true + supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -3248,6 +3313,11 @@ packages: resolution: {integrity: sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==} engines: {node: '>= 14'} + yaml@2.4.2: + resolution: {integrity: sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==} + engines: {node: '>= 14'} + hasBin: true + yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} @@ -3784,10 +3854,20 @@ snapshots: '@jridgewell/sourcemap-codec': 1.4.15 '@jridgewell/trace-mapping': 0.3.19 + '@jridgewell/gen-mapping@0.3.5': + dependencies: + '@jridgewell/set-array': 1.2.1 + '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/trace-mapping': 0.3.25 + '@jridgewell/resolve-uri@3.1.1': {} + '@jridgewell/resolve-uri@3.1.2': {} + '@jridgewell/set-array@1.1.2': {} + '@jridgewell/set-array@1.2.1': {} + '@jridgewell/sourcemap-codec@1.4.15': {} '@jridgewell/trace-mapping@0.3.19': @@ -3795,6 +3875,11 @@ snapshots: '@jridgewell/resolve-uri': 3.1.1 '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/trace-mapping@0.3.25': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.4.15 + '@mdn/browser-compat-data@5.5.29': {} '@next/eslint-plugin-next@14.2.3': @@ -4349,9 +4434,13 @@ snapshots: dependencies: fill-range: 7.0.1 + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + browserslist@4.22.1: dependencies: - caniuse-lite: 1.0.30001546 + caniuse-lite: 1.0.30001624 electron-to-chromium: 1.4.544 node-releases: 2.0.13 update-browserslist-db: 1.0.13(browserslist@4.22.1) @@ -4390,7 +4479,7 @@ snapshots: camelcase@6.3.0: {} - caniuse-lite@1.0.30001546: {} + caniuse-lite@1.0.30001624: {} chalk@2.4.2: dependencies: @@ -4417,6 +4506,18 @@ snapshots: optionalDependencies: fsevents: 2.3.3 + chokidar@3.6.0: + dependencies: + anymatch: 3.1.3 + braces: 3.0.3 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 + ci-info@3.9.0: {} cjs-module-lexer@1.2.3: {} @@ -4851,7 +4952,7 @@ snapshots: '@mdn/browser-compat-data': 5.5.29 ast-metadata-inferer: 0.8.0 browserslist: 4.22.1 - caniuse-lite: 1.0.30001546 + caniuse-lite: 1.0.30001624 eslint: 8.56.0 find-up: 5.0.0 lodash.memoize: 4.1.2 @@ -5157,6 +5258,10 @@ snapshots: dependencies: to-regex-range: 5.0.1 + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + find-up@4.1.0: dependencies: locate-path: 5.0.0 @@ -5261,6 +5366,14 @@ snapshots: minipass: 7.1.2 path-scurry: 1.11.1 + glob@10.4.1: + dependencies: + foreground-child: 3.1.1 + jackspeak: 3.1.2 + minimatch: 9.0.4 + minipass: 7.1.2 + path-scurry: 1.11.1 + glob@7.1.6: dependencies: fs.realpath: 1.0.0 @@ -5593,6 +5706,12 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 + jackspeak@3.1.2: + dependencies: + '@isaacs/cliui': 8.0.2 + optionalDependencies: + '@pkgjs/parseargs': 0.11.0 + jest-changed-files@29.7.0: dependencies: execa: 5.1.1 @@ -5966,6 +6085,8 @@ snapshots: lilconfig@2.1.0: {} + lilconfig@3.1.1: {} + lines-and-columns@1.2.4: {} load-tsconfig@0.2.5: {} @@ -6025,6 +6146,11 @@ snapshots: braces: 3.0.2 picomatch: 2.3.1 + micromatch@4.0.7: + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + mimic-fn@2.1.0: {} minimatch@3.1.2: @@ -6199,7 +6325,7 @@ snapshots: postcss: 8.4.38 postcss-value-parser: 4.2.0 read-cache: 1.0.0 - resolve: 1.22.6 + resolve: 1.22.8 postcss-js@4.0.1(postcss@8.4.38): dependencies: @@ -6213,10 +6339,10 @@ snapshots: optionalDependencies: postcss: 8.4.32 - postcss-load-config@4.0.1(postcss@8.4.38): + postcss-load-config@4.0.2(postcss@8.4.38): dependencies: - lilconfig: 2.1.0 - yaml: 2.3.4 + lilconfig: 3.1.1 + yaml: 2.4.2 optionalDependencies: postcss: 8.4.38 @@ -6359,6 +6485,12 @@ snapshots: path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 + resolve@1.22.8: + dependencies: + is-core-module: 2.13.1 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + resolve@2.0.0-next.5: dependencies: is-core-module: 2.13.1 @@ -6660,6 +6792,16 @@ snapshots: pirates: 4.0.6 ts-interface-checker: 0.1.13 + sucrase@3.35.0: + dependencies: + '@jridgewell/gen-mapping': 0.3.5 + commander: 4.1.1 + glob: 10.4.1 + lines-and-columns: 1.2.4 + mz: 2.7.0 + pirates: 4.0.6 + ts-interface-checker: 0.1.13 + supports-color@5.5.0: dependencies: has-flag: 3.0.0 @@ -6698,7 +6840,7 @@ snapshots: dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 - chokidar: 3.5.3 + chokidar: 3.6.0 didyoumean: 1.2.2 dlv: 1.1.3 fast-glob: 3.3.2 @@ -6706,18 +6848,18 @@ snapshots: is-glob: 4.0.3 jiti: 1.21.0 lilconfig: 2.1.0 - micromatch: 4.0.5 + micromatch: 4.0.7 normalize-path: 3.0.0 object-hash: 3.0.0 picocolors: 1.0.1 postcss: 8.4.38 postcss-import: 15.1.0(postcss@8.4.38) postcss-js: 4.0.1(postcss@8.4.38) - postcss-load-config: 4.0.1(postcss@8.4.38) + postcss-load-config: 4.0.2(postcss@8.4.38) postcss-nested: 6.0.1(postcss@8.4.38) postcss-selector-parser: 6.1.0 - resolve: 1.22.6 - sucrase: 3.34.0 + resolve: 1.22.8 + sucrase: 3.35.0 transitivePeerDependencies: - ts-node @@ -6998,6 +7140,8 @@ snapshots: yaml@2.3.4: {} + yaml@2.4.2: {} + yargs-parser@21.1.1: {} yargs@17.7.2: diff --git a/prettier.config.mjs b/prettier.config.mjs index 08603a2..1e23a78 100644 --- a/prettier.config.mjs +++ b/prettier.config.mjs @@ -1,14 +1 @@ -/** @type {import('prettier').Config} */ -const config = { - tabWidth: 2, - useTabs: false, - semi: true, - singleQuote: true, - trailingComma: 'es5', - bracketSpacing: true, - arrowParens: 'always', - proseWrap: 'never', - printWidth: 80, -}; - -export default config; +export { default } from './dist/prettier.config.mjs'; diff --git a/src/eslint.config.mjs b/src/eslint.config.mjs new file mode 100644 index 0000000..028befd --- /dev/null +++ b/src/eslint.config.mjs @@ -0,0 +1,188 @@ +/* eslint-disable n/no-unpublished-import, n/no-extraneous-import, import/no-extraneous-dependencies, id-length */ + +import react from 'eslint-plugin-react'; +import reactHooks from 'eslint-plugin-react-hooks'; +import typescript from '@typescript-eslint/eslint-plugin'; +import jsxA11y from 'eslint-plugin-jsx-a11y'; +import * as importPlugin from 'eslint-plugin-import'; +import jest from 'eslint-plugin-jest'; +import promise from 'eslint-plugin-promise'; +import n from 'eslint-plugin-n'; +import next from '@next/eslint-plugin-next'; +import globals from 'globals'; +import prettier from 'eslint-plugin-prettier'; +import cypress from 'eslint-plugin-cypress'; +import storybook from 'eslint-plugin-storybook'; +import unusedImports from 'eslint-plugin-unused-imports'; +// import tailwindcss from 'eslint-plugin-tailwindcss'; +import * as importTypescriptResolver from 'eslint-import-resolver-typescript'; +import html from 'eslint-plugin-html'; +import compat from 'eslint-plugin-compat'; + +import eslintPrettier from 'eslint-config-prettier'; +import * as typescriptParser from '@typescript-eslint/parser'; +import sonarjs from 'eslint-plugin-sonarjs'; + +import eslintRules from './rules/eslint.mjs'; +import reactRules from './rules/react.mjs'; +import reactHooksRules from './rules/reactHooks.mjs'; +import typescriptRules from './rules/typescript.mjs'; +import jsxA11yRules from './rules/jsx-a11y.mjs'; +import importRules from './rules/import.mjs'; +import jestRules from './rules/jest.mjs'; +import promiseRules from './rules/promise.mjs'; +import nRules from './rules/n.mjs'; +import nextRules from './rules/next.mjs'; +import prettierRules from './rules/prettier.mjs'; +import eslintTypescriptRules from './rules/eslint-typescript.mjs'; +import cypressRules from './rules/cypress.mjs'; +import storybookRules from './rules/storybook.mjs'; +// import tailwindcssRules from './rules/tailwindcss.mjs'; +import unusedImportsRules from './rules/unused-imports.mjs'; +import sonarjsRules from './rules/sonarjs.mjs'; +import compatRules from './rules/compat.mjs'; + +const config = [ + importPlugin.configs.typescript, + { + languageOptions: { + sourceType: 'module', + globals: { + ...globals.browser, + ...globals.node, + }, + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + ecmaFeatures: { + jsx: true, + }, + }, + }, + files: [ + '**/*.js', + '**/*.jsx', + '**/*.ts', + '**/*.tsx', + '**/*.json', + '**/*.mjs', + '**/*.cjs', + '**/*.html', + ], + plugins: { + prettier, + react, + 'react-hooks': reactHooks, + 'jsx-a11y': jsxA11y, + import: importPlugin, + promise, + n, + '@next/next': next, + 'unused-imports': unusedImports, + // tailwindcss, + sonarjs, + compat, + }, + rules: { + ...eslintRules, + ...reactRules, + ...reactHooksRules, + ...jsxA11yRules, + ...importRules, + ...promiseRules, + ...nRules, + ...nextRules, + ...prettierRules, + ...eslintPrettier.rules, + ...unusedImportsRules, + // ...tailwindcssRules, + ...sonarjsRules, + ...compatRules, + }, + + settings: { + react: { + version: 'detect', + }, + + // https://github.com/import-js/eslint-plugin-import/issues/2556#issuecomment-1419518561 + 'import/parsers': { + espree: ['.js', '.cjs', '.mjs', '.jsx', '.ts', '.tsx'], + }, + 'import/resolver': { + typescript: true, + node: true, + }, + }, + }, + { + files: ['**/*.ts', '**/*.tsx'], + languageOptions: { + parser: typescriptParser, + parserOptions: { + project: './tsconfig.json', + }, + }, + plugins: { + '@typescript-eslint': typescript, + 'import/typescript': importTypescriptResolver, + }, + rules: { + ...eslintTypescriptRules, + ...typescriptRules, + }, + }, + { + files: ['**/*.test.js', '**/*.test.jsx', 'tests/**/*.js', 'tests/**/*.jsx'], + languageOptions: { + globals: { + ...globals.jest, + }, + }, + plugins: { + jest, + }, + rules: { + ...jestRules, + }, + }, + { + files: ['**/*.cy.js', '**/*.cy.jsx'], + languageOptions: { + globals: { + ...globals.cypress, + }, + }, + plugins: { + cypress, + }, + rules: { + ...cypressRules, + }, + }, + { + files: [ + '**/*.stories.js', + '**/*.stories.jsx', + '**/*.stories.ts', + '**/*.stories.tsx', + ], + plugins: { + storybook, + }, + rules: { + ...storybookRules, + }, + }, + { + files: ['**/*.html'], + plugins: { + html, + }, + settings: { + 'html/javascript-tag-names': ['script', 'Script'], + }, + }, +]; + +export default config; diff --git a/src/prettier.config.mjs b/src/prettier.config.mjs new file mode 100644 index 0000000..08603a2 --- /dev/null +++ b/src/prettier.config.mjs @@ -0,0 +1,14 @@ +/** @type {import('prettier').Config} */ +const config = { + tabWidth: 2, + useTabs: false, + semi: true, + singleQuote: true, + trailingComma: 'es5', + bracketSpacing: true, + arrowParens: 'always', + proseWrap: 'never', + printWidth: 80, +}; + +export default config; diff --git a/rules/compat.mjs b/src/rules/compat.mjs similarity index 100% rename from rules/compat.mjs rename to src/rules/compat.mjs diff --git a/rules/cypress.mjs b/src/rules/cypress.mjs similarity index 100% rename from rules/cypress.mjs rename to src/rules/cypress.mjs diff --git a/rules/eslint-typescript.mjs b/src/rules/eslint-typescript.mjs similarity index 100% rename from rules/eslint-typescript.mjs rename to src/rules/eslint-typescript.mjs diff --git a/rules/eslint.mjs b/src/rules/eslint.mjs similarity index 100% rename from rules/eslint.mjs rename to src/rules/eslint.mjs diff --git a/rules/import.mjs b/src/rules/import.mjs similarity index 100% rename from rules/import.mjs rename to src/rules/import.mjs diff --git a/rules/jest.mjs b/src/rules/jest.mjs similarity index 100% rename from rules/jest.mjs rename to src/rules/jest.mjs diff --git a/rules/jsx-a11y.mjs b/src/rules/jsx-a11y.mjs similarity index 100% rename from rules/jsx-a11y.mjs rename to src/rules/jsx-a11y.mjs diff --git a/rules/n.mjs b/src/rules/n.mjs similarity index 100% rename from rules/n.mjs rename to src/rules/n.mjs diff --git a/rules/next.mjs b/src/rules/next.mjs similarity index 100% rename from rules/next.mjs rename to src/rules/next.mjs diff --git a/rules/prettier.mjs b/src/rules/prettier.mjs similarity index 100% rename from rules/prettier.mjs rename to src/rules/prettier.mjs diff --git a/rules/promise.mjs b/src/rules/promise.mjs similarity index 100% rename from rules/promise.mjs rename to src/rules/promise.mjs diff --git a/rules/react.mjs b/src/rules/react.mjs similarity index 100% rename from rules/react.mjs rename to src/rules/react.mjs diff --git a/rules/reactHooks.mjs b/src/rules/reactHooks.mjs similarity index 100% rename from rules/reactHooks.mjs rename to src/rules/reactHooks.mjs diff --git a/rules/sonarjs.mjs b/src/rules/sonarjs.mjs similarity index 100% rename from rules/sonarjs.mjs rename to src/rules/sonarjs.mjs diff --git a/rules/storybook.mjs b/src/rules/storybook.mjs similarity index 100% rename from rules/storybook.mjs rename to src/rules/storybook.mjs diff --git a/rules/tailwindcss.mjs b/src/rules/tailwindcss.mjs similarity index 100% rename from rules/tailwindcss.mjs rename to src/rules/tailwindcss.mjs diff --git a/rules/typescript.mjs b/src/rules/typescript.mjs similarity index 100% rename from rules/typescript.mjs rename to src/rules/typescript.mjs diff --git a/rules/unused-imports.mjs b/src/rules/unused-imports.mjs similarity index 100% rename from rules/unused-imports.mjs rename to src/rules/unused-imports.mjs diff --git a/src/stylelint.config.mjs b/src/stylelint.config.mjs new file mode 100644 index 0000000..4b88321 --- /dev/null +++ b/src/stylelint.config.mjs @@ -0,0 +1,36 @@ +/** @type {import('stylelint').Config} */ +const config = { + plugins: ['stylelint-prettier'], + extends: ['stylelint-config-standard', 'stylelint-config-idiomatic-order'], + rules: { + 'at-rule-no-unknown': [ + true, + { + ignoreAtRules: [ + 'tailwind', + 'apply', + 'layer', + 'variants', + 'responsive', + 'screen', + ], + }, + ], + 'declaration-property-value-no-unknown': true, + 'no-descending-specificity': null, + 'declaration-block-no-redundant-longhand-properties': [ + true, + { + ignoreShorthands: ['/flex/'], + }, + ], + 'selector-pseudo-class-no-unknown': [ + true, + { + ignorePseudoClasses: ['global'], + }, + ], + }, +}; + +export default config; diff --git a/stylelint.config.mjs b/stylelint.config.mjs index 4b88321..e360940 100644 --- a/stylelint.config.mjs +++ b/stylelint.config.mjs @@ -1,36 +1 @@ -/** @type {import('stylelint').Config} */ -const config = { - plugins: ['stylelint-prettier'], - extends: ['stylelint-config-standard', 'stylelint-config-idiomatic-order'], - rules: { - 'at-rule-no-unknown': [ - true, - { - ignoreAtRules: [ - 'tailwind', - 'apply', - 'layer', - 'variants', - 'responsive', - 'screen', - ], - }, - ], - 'declaration-property-value-no-unknown': true, - 'no-descending-specificity': null, - 'declaration-block-no-redundant-longhand-properties': [ - true, - { - ignoreShorthands: ['/flex/'], - }, - ], - 'selector-pseudo-class-no-unknown': [ - true, - { - ignorePseudoClasses: ['global'], - }, - ], - }, -}; - -export default config; +export { default } from './dist/stylelint.config.mjs'; diff --git a/tsconfig.json b/tsconfig.json index 05cc11e..8e480b8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,6 +15,6 @@ "jsx": "react-jsx", "noEmit": true }, - "include": ["src", "test", "tsup.config.ts", "*.config.mjs"], + "include": ["src", "test", "tsup.config.ts"], "exclude": ["node_modules", "dist"] } diff --git a/tsup.config.ts b/tsup.config.ts index 3d3ecf3..f4edcfb 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'tsup'; export default defineConfig({ - entry: ['*.config.mjs'], + entry: ['src/*.config.mjs'], sourcemap: false, minify: true, dts: true, From 5464c35a7d4118529e307ffb055960cdbe1fbe5a Mon Sep 17 00:00:00 2001 From: Hayden Bleasel Date: Tue, 28 May 2024 00:10:55 -0400 Subject: [PATCH 3/3] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index d4d1bc1..db3164d 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Ultracite is a robust linting preset for modern TypeScript apps. It's comprised ### ESLint -Ultracite uses [ESLint](https://eslint.org/) to enforce code quality and type safety. It includes a wide range of rules to ensure your code is consistent and error-free. Ultracite combines with pre-defined rulesets for ESLint, as well as the following plugins: [Import](https://www.npmjs.com/package/eslint-plugin-import), [jsx-a11y](https://www.npmjs.com/package/eslint-plugin-jsx-a11y), [React](https://www.npmjs.com/package/eslint-plugin-react), [React Hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks), [jest](https://www.npmjs.com/package/eslint-plugin-jest), [promise](https://www.npmjs.com/package/eslint-plugin-promise), [n](https://www.npmjs.com/package/eslint-plugin-n), [Typescript](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin), [Prettier](https://www.npmjs.com/package/eslint-plugin-prettier), [Next.js](https://nextjs.org/docs/basic-features/eslint#eslint-plugin), [Cypress](https://www.npmjs.com/package/eslint-plugin-cypress), [HTML](https://www.npmjs.com/package/eslint-plugin-html) and [SonarJS](https://www.npmjs.com/package/eslint-plugin-sonarjs). +Ultracite uses [ESLint](https://eslint.org/) to enforce code quality and type safety. It includes a wide range of rules to ensure your code is consistent and error-free. Ultracite combines with pre-defined rulesets for ESLint, as well as the following plugins: [Import](https://www.npmjs.com/package/eslint-plugin-import), [jsx-a11y](https://www.npmjs.com/package/eslint-plugin-jsx-a11y), [React](https://www.npmjs.com/package/eslint-plugin-react), [React Hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks), [jest](https://www.npmjs.com/package/eslint-plugin-jest), [promise](https://www.npmjs.com/package/eslint-plugin-promise), [n](https://www.npmjs.com/package/eslint-plugin-n), [Typescript](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin), [Prettier](https://www.npmjs.com/package/eslint-plugin-prettier), [Next.js](https://nextjs.org/docs/basic-features/eslint#eslint-plugin), [Cypress](https://www.npmjs.com/package/eslint-plugin-cypress), [HTML](https://www.npmjs.com/package/eslint-plugin-html), [SonarJS](https://www.npmjs.com/package/eslint-plugin-sonarjs) and [Compat](https://www.npmjs.com/package/eslint-plugin-compat). ### Prettier @@ -137,5 +137,4 @@ If you see any errors, it could be related to peer dependencies or changes in de - https://github.com/ota-meshi/eslint-plugin-yml - https://github.com/mdx-js/eslint-mdx/tree/master/packages/eslint-plugin-mdx - https://github.com/eslint/eslint-plugin-markdown -- https://github.com/amilajack/eslint-plugin-compat - https://github.com/sindresorhus/eslint-plugin-unicorn