diff --git a/.changeset/purple-coins-dream.md b/.changeset/purple-coins-dream.md new file mode 100644 index 0000000..3f85464 --- /dev/null +++ b/.changeset/purple-coins-dream.md @@ -0,0 +1,10 @@ +--- +'eslint-config-widen-playwright': major +'eslint-config-widen-typescript': major +'eslint-config-widen-react': major +'eslint-config-widen-base': major +'eslint-config-widen-jest': major +--- + +Create separate packages for each component. Allows users to import only the +dependencies that they need, rather than all of them. diff --git a/packages/eslint-config-widen-base/README.md b/packages/eslint-config-widen-base/README.md new file mode 100644 index 0000000..684b8c1 --- /dev/null +++ b/packages/eslint-config-widen-base/README.md @@ -0,0 +1,29 @@ +# eslint-config-widen-base + +Widen's shared ESLint config base module + +## Installation + +```bash +yarn add -D eslint eslint-plugin-widen eslint-config-widen-base eslint-plugin-sort @babel/{core,eslint-parser} +``` + +## Usage + +In your `eslint.config.mjs` file, add the following entries to your extends +list. + +```js +import base from 'eslint-config-widen-base' + +export default [ + ...base, + ...[ + // you can specify what to ignore by using the `ignores` key before any other rule + // this will filter out things we dont want this to run on + { ignores: ['*.test.*'] }, + // you can also override rules by specifying the rule and the new value + { files: ['*.spec.js'], rules: { 'no-unused-vars': 'off' } }, + ], +] +``` diff --git a/packages/eslint-config-widen-base/package.json b/packages/eslint-config-widen-base/package.json new file mode 100644 index 0000000..9dc51f5 --- /dev/null +++ b/packages/eslint-config-widen-base/package.json @@ -0,0 +1,29 @@ +{ + "author": "Widen", + "dependencies": { + "eslint-config-prettier": "^9.1.0" + }, + "description": "Widen's shared ESLint base config.", + "exports": { + ".": "./lib/base.js" + }, + "files": [ + "lib" + ], + "type": "module", + "homepage": "https://github.com/Widen/eslint-config/tree/master/packages/eslint-config-widen-base#readme", + "license": "ISC", + "name": "eslint-config-widen-base", + "peerDependencies": { + "@babel/eslint-parser": "^7.22.15", + "eslint": ">= 9", + "eslint-plugin-sort": ">= 3", + "eslint-plugin-widen": ">=3.0.0" + }, + "repository": { + "directory": "packages/eslint-config-widen-base", + "type": "git", + "url": "https://github.com/Widen/eslint-config" + }, + "version": "1.0.0" +} diff --git a/packages/eslint-config-widen-base/src/base.ts b/packages/eslint-config-widen-base/src/base.ts new file mode 100644 index 0000000..e544d9e --- /dev/null +++ b/packages/eslint-config-widen-base/src/base.ts @@ -0,0 +1,96 @@ +import babelParser from '@babel/eslint-parser' +import js from '@eslint/js' +import prettier from 'eslint-plugin-prettier' +import sort from 'eslint-plugin-sort' +import widen from 'eslint-plugin-widen' +import sharedGlobals from './sharedGlobals.js' + +export default [ + { + languageOptions: { + globals: sharedGlobals, + parser: babelParser, + parserOptions: { + requireConfigFile: false, + }, + }, + plugins: { + prettier, + sort, + widen, + }, + rules: { + 'default-param-last': 'error', + 'dot-notation': 'error', + eqeqeq: [ + 'error', + 'always', + { + null: 'ignore', + }, + ], + 'no-console': ['error', { allow: ['error'] }], + 'no-dupe-args': 'error', + 'no-duplicate-imports': 'error', + 'no-else-return': 'error', + 'no-empty': ['error', { allowEmptyCatch: true }], + 'no-extra-bind': 'error', + 'no-param-reassign': 'error', + 'no-return-await': 'error', + 'no-template-curly-in-string': 'error', + 'no-unneeded-ternary': 'error', + 'no-unused-expressions': 'off', + 'no-unused-vars': [ + 'error', + { + ignoreRestSiblings: true, + varsIgnorePattern: '^_', + }, + ], + 'no-useless-computed-key': 'error', + 'no-var': 'error', + 'object-shorthand': 'error', + 'prefer-const': [ + 'error', + { + destructuring: 'all', + }, + ], + 'require-await': 'error', + 'sort/exports': [ + 'warn', + { + groups: [ + { order: 6, type: 'default' }, + { order: 5, type: 'sourceless' }, + { order: 2, regex: '^@widen\\/' }, + { order: 4, regex: '^\\.+' }, + { order: 1, type: 'dependency' }, + { order: 3, type: 'other' }, + ], + }, + ], + 'sort/imports': [ + 'warn', + { + groups: [ + { order: 1, type: 'side-effect' }, + { order: 3, regex: '^@widen\\/' }, + { order: 5, regex: '^\\.+' }, + { order: 2, type: 'dependency' }, + { order: 4, type: 'other' }, + ], + }, + ], + }, + }, + js.configs.recommended, + { + plugins: { + prettier, + }, + rules: { + ...prettier.configs.recommended.rules, + }, + }, +] diff --git a/packages/eslint-config-widen-base/src/sharedGlobals.ts b/packages/eslint-config-widen-base/src/sharedGlobals.ts new file mode 100644 index 0000000..41f3480 --- /dev/null +++ b/packages/eslint-config-widen-base/src/sharedGlobals.ts @@ -0,0 +1,14 @@ +import globals from 'globals' + +// delete an invalid global that causes error because of the trailing space +const browser = globals.browser +delete browser['AudioWorkletGlobalScope '] + +const sharedGlobals = { + ...browser, + ...globals.es6, + ...globals.node, + ...globals.jest, +} + +export default sharedGlobals diff --git a/packages/eslint-config-widen-base/src/types.d.ts b/packages/eslint-config-widen-base/src/types.d.ts new file mode 100644 index 0000000..67a6d29 --- /dev/null +++ b/packages/eslint-config-widen-base/src/types.d.ts @@ -0,0 +1,3 @@ +declare module 'globals' +declare module 'eslint-plugin-widen' +declare module 'eslint-plugin-prettier' diff --git a/packages/eslint-config-widen-base/tsconfig.json b/packages/eslint-config-widen-base/tsconfig.json new file mode 100644 index 0000000..8206c63 --- /dev/null +++ b/packages/eslint-config-widen-base/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "lib", + "rootDir": "src", + "module": "esnext", + "esModuleInterop": true, + "target": "es2016" + }, + "paths": { + "@/*": ["./src/*"] + } +} diff --git a/packages/eslint-config-widen-jest/README.md b/packages/eslint-config-widen-jest/README.md new file mode 100644 index 0000000..43c2815 --- /dev/null +++ b/packages/eslint-config-widen-jest/README.md @@ -0,0 +1,30 @@ +# eslint-config-widen-jest + +Widen's shared ESLint config for Jest. + +## Installation + +```bash +yarn add -D eslint eslint-config-widen-jest eslint-plugin-jest +``` + +## Usage + +In your `eslint.config.mjs` file, add the following four entries to your extends +list. If you don't need a specific configuration, simply remove it from the +list. + +```js +import jest from 'eslint-config-widen-jest' + +export default [ + ...[ + // you can specify what to ignore by using the `ignores` key before any other rule + // this will filter out things we dont want this to run on + { ignores: ['*.test.*'] }, + ...jest, + // you can also override rules by specifying the rule and the new value + { files: ['*.spec.js'], rules: { 'jest/expect-expect': 'off' } }, + ], +] +``` diff --git a/packages/eslint-config-widen-jest/package.json b/packages/eslint-config-widen-jest/package.json new file mode 100644 index 0000000..0550d5a --- /dev/null +++ b/packages/eslint-config-widen-jest/package.json @@ -0,0 +1,27 @@ +{ + "author": "Widen", + "dependencies": { + "eslint-config-prettier": "^9.1.0" + }, + "description": "Widen's shared ESLint config for Jest.", + "exports": { + ".": "./lib/jest.js" + }, + "files": [ + "lib" + ], + "type": "module", + "homepage": "https://github.com/Widen/eslint-config/tree/master/packages/eslint-config-widen-jest#readme", + "license": "ISC", + "name": "eslint-config-widen-jest", + "peerDependencies": { + "eslint": ">= 9", + "eslint-plugin-jest": ">= 28" + }, + "repository": { + "directory": "packages/eslint-config-widen-jest", + "type": "git", + "url": "https://github.com/Widen/eslint-config" + }, + "version": "1.0.0" +} diff --git a/packages/eslint-config-widen-jest/src/jest.ts b/packages/eslint-config-widen-jest/src/jest.ts new file mode 100644 index 0000000..97b38fb --- /dev/null +++ b/packages/eslint-config-widen-jest/src/jest.ts @@ -0,0 +1,22 @@ +import jest from 'eslint-plugin-jest' + +export default [ + { + files: [ + '*.spec.js', + '*.test.js', + '*.spec.jsx', + '*.test.jsx', + '*.spec.ts', + '*.test.ts', + '*.spec.tsx', + '*.test.tsx', + ], + plugins: { + jest, + }, + rules: { + ...jest.configs.recommended.rules, + }, + }, +] diff --git a/packages/eslint-config-widen-jest/src/types.d.ts b/packages/eslint-config-widen-jest/src/types.d.ts new file mode 100644 index 0000000..32d6303 --- /dev/null +++ b/packages/eslint-config-widen-jest/src/types.d.ts @@ -0,0 +1 @@ +declare module 'eslint-plugin-jest' diff --git a/packages/eslint-config-widen-jest/tsconfig.json b/packages/eslint-config-widen-jest/tsconfig.json new file mode 100644 index 0000000..8206c63 --- /dev/null +++ b/packages/eslint-config-widen-jest/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "lib", + "rootDir": "src", + "module": "esnext", + "esModuleInterop": true, + "target": "es2016" + }, + "paths": { + "@/*": ["./src/*"] + } +} diff --git a/packages/eslint-config-widen-playwright/README.md b/packages/eslint-config-widen-playwright/README.md new file mode 100644 index 0000000..9b1a230 --- /dev/null +++ b/packages/eslint-config-widen-playwright/README.md @@ -0,0 +1,20 @@ +# eslint-config-widen-playwright + +Widen's shared ESLint config for Playwright. + +## Installation + +```bash +yarn add -D eslint eslint-config-widen-playwright eslint-plugin-playwright +``` + +## Usage + +In your `eslint.config.mjs` file, add the following four entries to your extends +list. + +```js +import playwright from 'eslint-config-widen-playwright' + +export default [...[{ files: ['e2e/**'] }, ...playwright]] +``` diff --git a/packages/eslint-config-widen-playwright/package.json b/packages/eslint-config-widen-playwright/package.json new file mode 100644 index 0000000..1dcc3d4 --- /dev/null +++ b/packages/eslint-config-widen-playwright/package.json @@ -0,0 +1,27 @@ +{ + "author": "Widen", + "dependencies": { + "eslint-config-prettier": "^9.1.0" + }, + "description": "Widen's shared ESLint config for Playwright.", + "exports": { + ".": "./lib/playwright.js" + }, + "files": [ + "lib" + ], + "type": "module", + "homepage": "https://github.com/Widen/eslint-config/tree/master/packages/eslint-config-widen-playwright#readme", + "license": "ISC", + "name": "eslint-config-widen-playwright", + "peerDependencies": { + "eslint": ">= 9", + "eslint-plugin-playwright": ">= 1" + }, + "repository": { + "directory": "packages/eslint-config-widen-playwright", + "type": "git", + "url": "https://github.com/Widen/eslint-config" + }, + "version": "1.0.0" +} diff --git a/packages/eslint-config-widen-playwright/src/playwright.ts b/packages/eslint-config-widen-playwright/src/playwright.ts new file mode 100644 index 0000000..610c2ac --- /dev/null +++ b/packages/eslint-config-widen-playwright/src/playwright.ts @@ -0,0 +1,43 @@ +import playwright from 'eslint-plugin-playwright' + +delete playwright.configs['playwright-test'].env + +export default [ + { + plugins: { + playwright, + }, + rules: { + 'playwright/missing-playwright-await': [ + 'error', + { customMatchers: ['toBeAccessible', 'toPassAxe'] }, + ], + 'playwright/no-restricted-matchers': [ + 'warn', + { + toEqualValue: 'Use `toHaveValue` instead.', + toHaveSelector: 'Use `toBeVisible` instead.', + toHaveSelectorCount: 'Use `toHaveCount` instead.', + toMatchAttribute: 'Use `toHaveAttribute` instead.', + toMatchText: 'Use `toHaveText` instead.', + toMatchURL: 'Use `toHaveURL` instead.', + toMatchValue: 'Use `toHaveValue` instead.', + }, + ], + 'playwright/prefer-lowercase-title': [ + 'warn', + { ignoreTopLevelDescribe: true }, + ], + 'playwright/prefer-strict-equal': 'warn', + 'playwright/prefer-to-be': 'warn', + 'playwright/prefer-to-have-length': 'warn', + 'playwright/require-top-level-describe': 'warn', + }, + }, + { + ...playwright.configs['playwright-test'], + plugins: { + playwright, + }, + }, +] diff --git a/packages/eslint-config-widen-playwright/src/types.d.ts b/packages/eslint-config-widen-playwright/src/types.d.ts new file mode 100644 index 0000000..14c9ff4 --- /dev/null +++ b/packages/eslint-config-widen-playwright/src/types.d.ts @@ -0,0 +1 @@ +declare module 'eslint-plugin-playwright' diff --git a/packages/eslint-config-widen-playwright/tsconfig.json b/packages/eslint-config-widen-playwright/tsconfig.json new file mode 100644 index 0000000..8206c63 --- /dev/null +++ b/packages/eslint-config-widen-playwright/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "lib", + "rootDir": "src", + "module": "esnext", + "esModuleInterop": true, + "target": "es2016" + }, + "paths": { + "@/*": ["./src/*"] + } +} diff --git a/packages/eslint-config-widen-react/README.md b/packages/eslint-config-widen-react/README.md new file mode 100644 index 0000000..c063b15 --- /dev/null +++ b/packages/eslint-config-widen-react/README.md @@ -0,0 +1,30 @@ +# eslint-config-widen-react + +Widen's shared ESLint config. + +## Installation + +```bash +yarn add -D eslint eslint-config-widen-react eslint-plugin-{react,react-hooks,jsx-a11y} +``` + +## Usage + +In your `eslint.config.mjs` file, add the following four entries to your extends +list. If you don't need a specific configuration, simply remove it from the +list. + +```js +import react from 'eslint-config-widen-react' + +export default [ + ...react, + ...[ + // you can specify what to ignore by using the `ignores` key before any other rule + // this will filter out things we dont want this to run on + { ignores: ['*.test.*'] }, + // you can also override rules by specifying the rule and the new value + { files: ['*.spec.js'], rules: { 'no-unused-vars': 'off' } }, + ], +] +``` diff --git a/packages/eslint-config-widen-react/package.json b/packages/eslint-config-widen-react/package.json new file mode 100644 index 0000000..23b5116 --- /dev/null +++ b/packages/eslint-config-widen-react/package.json @@ -0,0 +1,29 @@ +{ + "author": "Widen", + "dependencies": { + "eslint-config-prettier": "^9.1.0" + }, + "description": "Widen's shared ESLint config for React.", + "exports": { + ".": "./lib/react.js" + }, + "files": [ + "lib" + ], + "type": "module", + "homepage": "https://github.com/Widen/eslint-config/tree/master/packages/eslint-config-widen-react#readme", + "license": "ISC", + "name": "eslint-config-widen-react", + "peerDependencies": { + "eslint": ">= 9", + "eslint-plugin-jsx-a11y": ">= 6", + "eslint-plugin-react": ">= 7", + "eslint-plugin-react-hooks": ">= 4" + }, + "repository": { + "directory": "packages/eslint-config-widen-react", + "type": "git", + "url": "https://github.com/Widen/eslint-config" + }, + "version": "1.0.0" +} diff --git a/packages/eslint-config-widen-react/src/react.ts b/packages/eslint-config-widen-react/src/react.ts new file mode 100644 index 0000000..eb3a267 --- /dev/null +++ b/packages/eslint-config-widen-react/src/react.ts @@ -0,0 +1,115 @@ +import jsxA11y from 'eslint-plugin-jsx-a11y' +import react from 'eslint-plugin-react' +import reactHooks from 'eslint-plugin-react-hooks' +import sharedGlobals from './sharedGlobals.js' + +const languageOptions = { + globals: sharedGlobals, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, +} + +const reactVersion = { + settings: { + react: { + version: 'detect', + }, + }, +} + +export default [ + { + files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'], + languageOptions, + plugins: { + react, + }, + rules: { + ...react.configs.recommended.rules, + }, + ...reactVersion, + }, + { + files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'], + languageOptions, + plugins: { + 'react-hooks': reactHooks, + }, + rules: { + ...reactHooks.configs.recommended.rules, + }, + }, + { + files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'], + languageOptions, + plugins: { + 'jsx-a11y': jsxA11y, + }, + rules: { + ...jsxA11y.configs.recommended.rules, + }, + }, + { + files: ['*.tsx', '*.{spec,test}.{js,jsx}'], + languageOptions, + rules: { + 'react/prop-types': 'off', + }, + }, + { + files: ['*.{spec,test}.{tsx,js,jsx}'], + languageOptions, + rules: { + 'react/button-has-type': 'off', + 'react/display-name': 'off', + }, + }, + { + files: ['*.tsx', '*.{spec,test}.{js,jsx}'], + languageOptions, + rules: { + 'jsx-a11y/click-events-have-key-events': 'warn', + 'jsx-a11y/label-has-associated-control': [ + 'error', + { + controlComponents: ['TextInput'], + }, + ], + 'jsx-a11y/no-autofocus': [ + 'warn', + { + ignoreNonDOM: true, + }, + ], + 'react/button-has-type': 'warn', + // https://reactjs.org/docs/jsx-in-depth.html#props-default-to-true + 'react/jsx-boolean-value': ['warn', 'always'], + 'react/jsx-curly-brace-presence': ['warn', 'never'], + 'react/jsx-first-prop-new-line': ['error', 'multiline'], + 'react/jsx-no-duplicate-props': 'error', + 'react/jsx-no-useless-fragment': 'error', + 'react/jsx-sort-props': [ + 'error', + { + ignoreCase: true, + reservedFirst: true, + }, + ], + 'react/no-find-dom-node': 'warn', + 'react/no-unescaped-entities': 'off', + 'react/no-unknown-property': ['error', { ignore: ['css'] }], + 'react/self-closing-comp': 'warn', + 'react/sort-prop-types': [ + 'error', + { + ignoreCase: true, + }, + ], + 'widen/jsx-fragments': 'error', + 'widen/jsx-import': 'error', + }, + }, +] diff --git a/packages/eslint-config-widen-react/src/sharedGlobals.ts b/packages/eslint-config-widen-react/src/sharedGlobals.ts new file mode 100644 index 0000000..41f3480 --- /dev/null +++ b/packages/eslint-config-widen-react/src/sharedGlobals.ts @@ -0,0 +1,14 @@ +import globals from 'globals' + +// delete an invalid global that causes error because of the trailing space +const browser = globals.browser +delete browser['AudioWorkletGlobalScope '] + +const sharedGlobals = { + ...browser, + ...globals.es6, + ...globals.node, + ...globals.jest, +} + +export default sharedGlobals diff --git a/packages/eslint-config-widen-react/src/types.d.ts b/packages/eslint-config-widen-react/src/types.d.ts new file mode 100644 index 0000000..8a39c3f --- /dev/null +++ b/packages/eslint-config-widen-react/src/types.d.ts @@ -0,0 +1,4 @@ +declare module 'eslint-plugin-jsx-a11y' +declare module 'eslint-plugin-react' +declare module 'eslint-plugin-react-hooks' +declare module 'globals' diff --git a/packages/eslint-config-widen-react/tsconfig.json b/packages/eslint-config-widen-react/tsconfig.json new file mode 100644 index 0000000..8206c63 --- /dev/null +++ b/packages/eslint-config-widen-react/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "lib", + "rootDir": "src", + "module": "esnext", + "esModuleInterop": true, + "target": "es2016" + }, + "paths": { + "@/*": ["./src/*"] + } +} diff --git a/packages/eslint-config-widen-typescript/README.md b/packages/eslint-config-widen-typescript/README.md new file mode 100644 index 0000000..399076e --- /dev/null +++ b/packages/eslint-config-widen-typescript/README.md @@ -0,0 +1,30 @@ +# eslint-config-widen + +Widen's shared ESLint config for Typescript. + +## Installation + +```bash +yarn add -D eslint eslint-config-widen-typescript eslint-plugin-sort @typescript-eslint/{eslint-plugin,parser} +``` + +## Usage + +In your `eslint.config.mjs` file, add the following four entries to your extends +list. If you don't need a specific configuration, simply remove it from the +list. + +```js +import typescript from 'eslint-config-widen-typescript' + +export default [ + ...typescript, + ...[ + // you can specify what to ignore by using the `ignores` key before any other rule + // this will filter out things we dont want this to run on + { ignores: ['*.test.*'] }, + // you can also override rules by specifying the rule and the new value + { files: ['*.spec.js'], rules: { 'no-unused-vars': 'off' } }, + ], +] +``` diff --git a/packages/eslint-config-widen-typescript/package.json b/packages/eslint-config-widen-typescript/package.json new file mode 100644 index 0000000..c4eb05f --- /dev/null +++ b/packages/eslint-config-widen-typescript/package.json @@ -0,0 +1,28 @@ +{ + "author": "Widen", + "dependencies": { + "eslint-config-prettier": "^9.1.0" + }, + "description": "Widen's shared ESLint config for Typescript.", + "exports": { + ".": "./lib/typescript.js" + }, + "files": [ + "lib" + ], + "type": "module", + "homepage": "https://github.com/Widen/eslint-config/tree/master/packages/eslint-config-widen-typescript#readme", + "license": "ISC", + "name": "eslint-config-widen-typescript", + "peerDependencies": { + "eslint": ">= 9", + "eslint-plugin-sort": ">= 3", + "typescript-eslint": ">= 7.16.0" + }, + "repository": { + "directory": "packages/eslint-config-widen-typescript", + "type": "git", + "url": "https://github.com/Widen/eslint-config" + }, + "version": "1.0.0" +} diff --git a/packages/eslint-config-widen-typescript/src/types.d.ts b/packages/eslint-config-widen-typescript/src/types.d.ts new file mode 100644 index 0000000..3d7f529 --- /dev/null +++ b/packages/eslint-config-widen-typescript/src/types.d.ts @@ -0,0 +1 @@ +declare module 'eslint-plugin-sort' diff --git a/packages/eslint-config-widen-typescript/src/typescript.ts b/packages/eslint-config-widen-typescript/src/typescript.ts new file mode 100644 index 0000000..1f3d2f8 --- /dev/null +++ b/packages/eslint-config-widen-typescript/src/typescript.ts @@ -0,0 +1,37 @@ +import sort from 'eslint-plugin-sort' +import { configs, parser, plugin } from 'typescript-eslint' + +export default [ + ...configs.recommended, + { + languageOptions: { + parser: parser, + }, + plugins: { + '@typescript-eslint': plugin, + sort, + }, + rules: { + '@typescript-eslint/camelcase': 'off', + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/explicit-member-accessibility': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-empty-function': 'off', + '@typescript-eslint/no-empty-interface': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-extra-semi': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/no-object-literal-type-assertion': 'off', + '@typescript-eslint/no-unused-vars': [ + 'error', + { + ignoreRestSiblings: true, + varsIgnorePattern: '^_', + }, + ], + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/prefer-interface': 'off', + 'sort/type-properties': 'warn', + }, + }, +] diff --git a/packages/eslint-config-widen-typescript/tsconfig.json b/packages/eslint-config-widen-typescript/tsconfig.json new file mode 100644 index 0000000..8206c63 --- /dev/null +++ b/packages/eslint-config-widen-typescript/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "lib", + "rootDir": "src", + "module": "esnext", + "esModuleInterop": true, + "target": "es2016" + }, + "paths": { + "@/*": ["./src/*"] + } +} diff --git a/packages/eslint-config-widen/README.md b/packages/eslint-config-widen/README.md index 8072759..5de3d9a 100644 --- a/packages/eslint-config-widen/README.md +++ b/packages/eslint-config-widen/README.md @@ -1,5 +1,9 @@ # eslint-config-widen +@deprecated - use eslint-config-widen-base, eslint-config-widen-jest, +eslint-config-widen-playwright, eslint-config-widen-react, +eslint-config-widen-typescript + Widen's shared ESLint config. ## Installation diff --git a/tsconfig.json b/tsconfig.json index 53a897a..42d5711 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,11 @@ "files": [], "references": [ { "path": "packages/eslint-config-widen" }, + { "path": "packages/eslint-config-widen-base" }, + { "path": "packages/eslint-config-widen-jest" }, + { "path": "packages/eslint-config-widen-playwright" }, + { "path": "packages/eslint-config-widen-react" }, + { "path": "packages/eslint-config-widen-typescript" }, { "path": "packages/eslint-plugin-widen" } ] } diff --git a/yarn.lock b/yarn.lock index 0656c1f..dc0174c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3691,6 +3691,66 @@ __metadata: languageName: node linkType: hard +"eslint-config-widen-base@workspace:packages/eslint-config-widen-base": + version: 0.0.0-use.local + resolution: "eslint-config-widen-base@workspace:packages/eslint-config-widen-base" + dependencies: + eslint-config-prettier: ^9.1.0 + peerDependencies: + "@babel/eslint-parser": ^7.22.15 + eslint: ">= 9" + eslint-plugin-sort: ">= 3" + eslint-plugin-widen: ">=3.0.0" + languageName: unknown + linkType: soft + +"eslint-config-widen-jest@workspace:packages/eslint-config-widen-jest": + version: 0.0.0-use.local + resolution: "eslint-config-widen-jest@workspace:packages/eslint-config-widen-jest" + dependencies: + eslint-config-prettier: ^9.1.0 + peerDependencies: + eslint: ">= 9" + eslint-plugin-jest: ">= 28" + languageName: unknown + linkType: soft + +"eslint-config-widen-playwright@workspace:packages/eslint-config-widen-playwright": + version: 0.0.0-use.local + resolution: "eslint-config-widen-playwright@workspace:packages/eslint-config-widen-playwright" + dependencies: + eslint-config-prettier: ^9.1.0 + peerDependencies: + eslint: ">= 9" + eslint-plugin-playwright: ">= 1" + languageName: unknown + linkType: soft + +"eslint-config-widen-react@workspace:packages/eslint-config-widen-react": + version: 0.0.0-use.local + resolution: "eslint-config-widen-react@workspace:packages/eslint-config-widen-react" + dependencies: + eslint-config-prettier: ^9.1.0 + peerDependencies: + eslint: ">= 9" + eslint-plugin-jsx-a11y: ">= 6" + eslint-plugin-react: ">= 7" + eslint-plugin-react-hooks: ">= 4" + languageName: unknown + linkType: soft + +"eslint-config-widen-typescript@workspace:packages/eslint-config-widen-typescript": + version: 0.0.0-use.local + resolution: "eslint-config-widen-typescript@workspace:packages/eslint-config-widen-typescript" + dependencies: + eslint-config-prettier: ^9.1.0 + peerDependencies: + eslint: ">= 9" + eslint-plugin-sort: ">= 3" + typescript-eslint: ">= 7.16.0" + languageName: unknown + linkType: soft + "eslint-config-widen@workspace:^, eslint-config-widen@workspace:packages/eslint-config-widen": version: 0.0.0-use.local resolution: "eslint-config-widen@workspace:packages/eslint-config-widen"