@tarsilla/eslint-config 0.0.33 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.cjs +1 -1
- package/lib/index.cjs.map +1 -0
- package/lib/index.mjs +1 -1
- package/lib/index.mjs.map +1 -0
- package/package.json +20 -19
- package/src/Config.ts +5 -0
- package/src/index.ts +2 -0
- package/src/library.ts +108 -0
- package/src/react.ts +139 -0
package/lib/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("@eslint/js"),r=require("eslint-plugin-import"),t=require("eslint-plugin-jest"),s=require("eslint-plugin-prettier/recommended"),
|
|
1
|
+
"use strict";var e=require("@eslint/js"),r=require("eslint-plugin-import"),t=require("eslint-plugin-jest"),s=require("eslint-plugin-prettier/recommended"),o=require("eslint-plugin-unused-imports"),n=require("globals"),i=require("typescript-eslint"),a=require("eslint-plugin-react"),l=require("eslint-plugin-react-hooks");const p=n;const u=n;exports.library=function({ignores:n}){return i.config(e.configs.recommended,r.flatConfigs.recommended,r.flatConfigs.typescript,...i.configs.recommended,...i.configs.recommendedTypeChecked,{files:["**/*.test.{js,ts,jsx,tsx}"],...t.configs["flat/recommended"],languageOptions:{globals:{...p.jest}}},s,{ignores:n},{languageOptions:{parserOptions:{ecmaVersion:"latest",sourceType:"module",project:!0,tsconfigRootDir:"./"}},plugins:{"unused-imports":o},rules:{"prettier/prettier":["error",{semi:!0,trailingComma:"all",singleQuote:!0,printWidth:120,tabWidth:2},{usePrettierrc:!1,fileInfoOptions:{withNodeModules:!0}}],"@typescript-eslint/explicit-module-boundary-types":"error","@typescript-eslint/no-explicit-any":"error","no-unused-vars":"off","@typescript-eslint/no-unused-vars":"off","unused-imports/no-unused-imports":"error","unused-imports/no-unused-vars":["error",{vars:"all",varsIgnorePattern:"^_",args:"after-used",argsIgnorePattern:"^_"}],"sort-imports":["error",{ignoreCase:!0,ignoreDeclarationSort:!0,ignoreMemberSort:!1}],"import/order":["error",{groups:["builtin","external","internal",["parent","sibling"]],"newlines-between":"always",alphabetize:{order:"asc",caseInsensitive:!0}}]},settings:{"import/resolver":{typescript:!0,node:!0}}})},exports.react=function({ignores:n}){return i.config(e.configs.recommended,r.flatConfigs.recommended,r.flatConfigs.typescript,...i.configs.recommended,...i.configs.recommendedTypeChecked,{files:["**/*.{jsx,tsx}"],...a.configs.flat.recommended,...a.configs.flat["jsx-runtime"],languageOptions:{...a.configs.flat.recommended.languageOptions,globals:{...u.serviceworker,...u.browser}}},{files:["**/*.test.{js,ts,jsx,tsx}"],...t.configs["flat/recommended"],languageOptions:{globals:{...u.jest}}},s,{ignores:n},{languageOptions:{parserOptions:{ecmaVersion:"latest",sourceType:"module",project:!0,tsconfigRootDir:"./"}},plugins:{"unused-imports":o,"react-hooks":l},rules:{"prettier/prettier":["error",{semi:!0,trailingComma:"all",singleQuote:!0,jsxSingleQuote:!0,printWidth:120,tabWidth:2},{usePrettierrc:!1,fileInfoOptions:{withNodeModules:!0}}],...l.configs.recommended.rules,"react/react-in-jsx-scope":"off","react/jsx-uses-react":"off","@typescript-eslint/explicit-module-boundary-types":"error","@typescript-eslint/no-explicit-any":"error","no-unused-vars":"off","@typescript-eslint/no-unused-vars":"off","unused-imports/no-unused-imports":"error","unused-imports/no-unused-vars":["error",{vars:"all",varsIgnorePattern:"^_",args:"after-used",argsIgnorePattern:"^_"}],"sort-imports":["error",{ignoreCase:!0,ignoreDeclarationSort:!0,ignoreMemberSort:!1}],"import/order":["error",{groups:["builtin","external","internal",["parent","sibling"]],pathGroups:[{pattern:"react",group:"external",position:"before"}],pathGroupsExcludedImportTypes:["react"],"newlines-between":"always",alphabetize:{order:"asc",caseInsensitive:!0}}]},settings:{"import/resolver":{typescript:!0,node:!0},react:{version:"detect"}}})};
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/library.ts","../src/react.ts"],"sourcesContent":["import js from '@eslint/js';\nimport type { TSESLint } from '@typescript-eslint/utils';\nimport imports from 'eslint-plugin-import';\nimport jest from 'eslint-plugin-jest';\nimport prettierRecommended from 'eslint-plugin-prettier/recommended';\nimport unusedImports from 'eslint-plugin-unused-imports';\nimport globalsImp from 'globals';\nimport { config, configs } from 'typescript-eslint';\n\nimport { Config } from './Config';\n\nconst globals = globalsImp as Record<string, Record<string, boolean>>;\n\nfunction library({ ignores }: Config): TSESLint.FlatConfig.ConfigArray {\n return config(\n js.configs.recommended,\n imports.flatConfigs.recommended,\n imports.flatConfigs.typescript,\n ...configs.recommended,\n ...configs.recommendedTypeChecked,\n {\n files: ['**/*.test.{js,ts,jsx,tsx}'],\n ...jest.configs['flat/recommended'],\n languageOptions: {\n globals: {\n ...globals.jest,\n //...globals.vitest,\n },\n },\n },\n prettierRecommended,\n {\n ignores,\n },\n {\n languageOptions: {\n parserOptions: {\n ecmaVersion: 'latest',\n sourceType: 'module',\n project: true,\n tsconfigRootDir: './',\n },\n },\n plugins: {\n 'unused-imports': unusedImports,\n },\n rules: {\n 'prettier/prettier': [\n 'error',\n {\n semi: true,\n trailingComma: 'all',\n singleQuote: true,\n printWidth: 120,\n tabWidth: 2,\n },\n {\n usePrettierrc: false,\n fileInfoOptions: {\n withNodeModules: true,\n },\n },\n ],\n '@typescript-eslint/explicit-module-boundary-types': 'error',\n '@typescript-eslint/no-explicit-any': 'error',\n 'no-unused-vars': 'off',\n '@typescript-eslint/no-unused-vars': 'off',\n 'unused-imports/no-unused-imports': 'error',\n 'unused-imports/no-unused-vars': [\n 'error',\n {\n vars: 'all',\n varsIgnorePattern: '^_',\n args: 'after-used',\n argsIgnorePattern: '^_',\n },\n ],\n 'sort-imports': [\n 'error',\n {\n ignoreCase: true,\n ignoreDeclarationSort: true,\n ignoreMemberSort: false,\n },\n ],\n 'import/order': [\n 'error',\n {\n groups: ['builtin', 'external', 'internal', ['parent', 'sibling']],\n 'newlines-between': 'always',\n alphabetize: {\n order: 'asc',\n caseInsensitive: true,\n },\n },\n ],\n },\n settings: {\n 'import/resolver': {\n typescript: true,\n node: true,\n },\n },\n },\n );\n}\n\nexport { library };\n","import js from '@eslint/js';\nimport type { TSESLint } from '@typescript-eslint/utils';\nimport imports from 'eslint-plugin-import';\nimport jest from 'eslint-plugin-jest';\nimport prettierRecommended from 'eslint-plugin-prettier/recommended';\n//import reactRecommended from 'eslint-plugin-react/configs/recommended.js';\nimport reactPlugin from 'eslint-plugin-react';\nimport reactHooks from 'eslint-plugin-react-hooks';\nimport unusedImports from 'eslint-plugin-unused-imports';\nimport globalsImp from 'globals';\nimport { config, configs } from 'typescript-eslint';\n\nimport { Config } from './Config';\n\nconst globals = globalsImp as Record<string, Record<string, boolean>>;\n\nfunction react({ ignores }: Config): TSESLint.FlatConfig.ConfigArray {\n return config(\n js.configs.recommended,\n imports.flatConfigs.recommended,\n imports.flatConfigs.typescript,\n ...configs.recommended,\n ...configs.recommendedTypeChecked,\n {\n files: ['**/*.{jsx,tsx}'],\n ...reactPlugin.configs.flat.recommended,\n ...reactPlugin.configs.flat['jsx-runtime'],\n languageOptions: {\n ...reactPlugin.configs.flat.recommended.languageOptions,\n globals: {\n ...globals.serviceworker,\n ...globals.browser,\n },\n },\n },\n {\n files: ['**/*.test.{js,ts,jsx,tsx}'],\n ...jest.configs['flat/recommended'],\n languageOptions: {\n globals: {\n ...globals.jest,\n //...globals.vitest,\n },\n },\n },\n prettierRecommended,\n {\n ignores,\n },\n {\n languageOptions: {\n parserOptions: {\n ecmaVersion: 'latest',\n sourceType: 'module',\n project: true,\n tsconfigRootDir: './',\n },\n },\n plugins: {\n 'unused-imports': unusedImports,\n 'react-hooks': reactHooks,\n },\n rules: {\n 'prettier/prettier': [\n 'error',\n {\n semi: true,\n trailingComma: 'all',\n singleQuote: true,\n jsxSingleQuote: true,\n printWidth: 120,\n tabWidth: 2,\n },\n {\n usePrettierrc: false,\n fileInfoOptions: {\n withNodeModules: true,\n },\n },\n ],\n ...reactHooks.configs.recommended.rules,\n 'react/react-in-jsx-scope': 'off',\n 'react/jsx-uses-react': 'off',\n '@typescript-eslint/explicit-module-boundary-types': 'error',\n '@typescript-eslint/no-explicit-any': 'error',\n 'no-unused-vars': 'off',\n '@typescript-eslint/no-unused-vars': 'off',\n 'unused-imports/no-unused-imports': 'error',\n 'unused-imports/no-unused-vars': [\n 'error',\n {\n vars: 'all',\n varsIgnorePattern: '^_',\n args: 'after-used',\n argsIgnorePattern: '^_',\n },\n ],\n 'sort-imports': [\n 'error',\n {\n ignoreCase: true,\n ignoreDeclarationSort: true,\n ignoreMemberSort: false,\n },\n ],\n 'import/order': [\n 'error',\n {\n groups: ['builtin', 'external', 'internal', ['parent', 'sibling']],\n pathGroups: [\n {\n pattern: 'react',\n group: 'external',\n position: 'before',\n },\n ],\n pathGroupsExcludedImportTypes: ['react'],\n 'newlines-between': 'always',\n alphabetize: {\n order: 'asc',\n caseInsensitive: true,\n },\n },\n ],\n },\n settings: {\n 'import/resolver': {\n typescript: true,\n node: true,\n },\n react: {\n version: 'detect',\n },\n },\n },\n );\n}\n\nexport { react };\n"],"names":["globals","globalsImp","ignores","config","js","configs","recommended","imports","flatConfigs","typescript","recommendedTypeChecked","files","jest","languageOptions","prettierRecommended","parserOptions","ecmaVersion","sourceType","project","tsconfigRootDir","plugins","unusedImports","rules","semi","trailingComma","singleQuote","printWidth","tabWidth","usePrettierrc","fileInfoOptions","withNodeModules","vars","varsIgnorePattern","args","argsIgnorePattern","ignoreCase","ignoreDeclarationSort","ignoreMemberSort","groups","alphabetize","order","caseInsensitive","settings","node","reactPlugin","flat","serviceworker","browser","reactHooks","jsxSingleQuote","pathGroups","pattern","group","position","pathGroupsExcludedImportTypes","react","version"],"mappings":"iUAWA,MAAMA,EAAUC,ECGhB,MAAMD,EAAUC,kBDDhB,UAAiBC,QAAEA,IACjB,OAAOC,EAAAA,OACLC,EAAGC,QAAQC,YACXC,EAAQC,YAAYF,YACpBC,EAAQC,YAAY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CACfb,QAAS,IACJA,EAAQY,QAKjBE,EACA,CACEZ,WAEF,CACEW,gBAAiB,CACfE,cAAe,CACbC,YAAa,SACbC,WAAY,SACZC,SAAS,EACTC,gBAAiB,OAGrBC,QAAS,CACP,iBAAkBC,EAClB,cAAe2B,GAEjB1B,MAAO,CACL,oBAAqB,CACnB,QACA,CACEC,MAAM,EACNC,cAAe,MACfC,aAAa,EACbwB,gBAAgB,EAChBvB,WAAY,IACZC,SAAU,GAEZ,CACEC,eAAe,EACfC,gBAAiB,CACfC,iBAAiB,QAIpBkB,EAAW3C,QAAQC,YAAYgB,MAClC,2BAA4B,MAC5B,uBAAwB,MACxB,oDAAqD,QACrD,qCAAsC,QACtC,iBAAkB,MAClB,oCAAqC,MACrC,mCAAoC,QACpC,gCAAiC,CAC/B,QACA,CACES,KAAM,MACNC,kBAAmB,KACnBC,KAAM,aACNC,kBAAmB,OAGvB,eAAgB,CACd,QACA,CACEC,YAAY,EACZC,uBAAuB,EACvBC,kBAAkB,IAGtB,eAAgB,CACd,QACA,CACEC,OAAQ,CAAC,UAAW,WAAY,WAAY,CAAC,SAAU,YACvDY,WAAY,CACV,CACEC,QAAS,QACTC,MAAO,WACPC,SAAU,WAGdC,8BAA+B,CAAC,SAChC,mBAAoB,SACpBf,YAAa,CACXC,MAAO,MACPC,iBAAiB,MAKzBC,SAAU,CACR,kBAAmB,CACjBjC,YAAY,EACZkC,MAAM,GAERY,MAAO,CACLC,QAAS,YAKnB"}
|
package/lib/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"@eslint/js";import r from"eslint-plugin-import";import
|
|
1
|
+
import e from"@eslint/js";import r from"eslint-plugin-import";import t from"eslint-plugin-jest";import o from"eslint-plugin-prettier/recommended";import s from"eslint-plugin-unused-imports";import n from"globals";import{config as i,configs as a}from"typescript-eslint";import p from"eslint-plugin-react";import l from"eslint-plugin-react-hooks";const m=n;function u({ignores:n}){return i(e.configs.recommended,r.flatConfigs.recommended,r.flatConfigs.typescript,...a.recommended,...a.recommendedTypeChecked,{files:["**/*.test.{js,ts,jsx,tsx}"],...t.configs["flat/recommended"],languageOptions:{globals:{...m.jest}}},o,{ignores:n},{languageOptions:{parserOptions:{ecmaVersion:"latest",sourceType:"module",project:!0,tsconfigRootDir:"./"}},plugins:{"unused-imports":s},rules:{"prettier/prettier":["error",{semi:!0,trailingComma:"all",singleQuote:!0,printWidth:120,tabWidth:2},{usePrettierrc:!1,fileInfoOptions:{withNodeModules:!0}}],"@typescript-eslint/explicit-module-boundary-types":"error","@typescript-eslint/no-explicit-any":"error","no-unused-vars":"off","@typescript-eslint/no-unused-vars":"off","unused-imports/no-unused-imports":"error","unused-imports/no-unused-vars":["error",{vars:"all",varsIgnorePattern:"^_",args:"after-used",argsIgnorePattern:"^_"}],"sort-imports":["error",{ignoreCase:!0,ignoreDeclarationSort:!0,ignoreMemberSort:!1}],"import/order":["error",{groups:["builtin","external","internal",["parent","sibling"]],"newlines-between":"always",alphabetize:{order:"asc",caseInsensitive:!0}}]},settings:{"import/resolver":{typescript:!0,node:!0}}})}const c=n;function d({ignores:n}){return i(e.configs.recommended,r.flatConfigs.recommended,r.flatConfigs.typescript,...a.recommended,...a.recommendedTypeChecked,{files:["**/*.{jsx,tsx}"],...p.configs.flat.recommended,...p.configs.flat["jsx-runtime"],languageOptions:{...p.configs.flat.recommended.languageOptions,globals:{...c.serviceworker,...c.browser}}},{files:["**/*.test.{js,ts,jsx,tsx}"],...t.configs["flat/recommended"],languageOptions:{globals:{...c.jest}}},o,{ignores:n},{languageOptions:{parserOptions:{ecmaVersion:"latest",sourceType:"module",project:!0,tsconfigRootDir:"./"}},plugins:{"unused-imports":s,"react-hooks":l},rules:{"prettier/prettier":["error",{semi:!0,trailingComma:"all",singleQuote:!0,jsxSingleQuote:!0,printWidth:120,tabWidth:2},{usePrettierrc:!1,fileInfoOptions:{withNodeModules:!0}}],...l.configs.recommended.rules,"react/react-in-jsx-scope":"off","react/jsx-uses-react":"off","@typescript-eslint/explicit-module-boundary-types":"error","@typescript-eslint/no-explicit-any":"error","no-unused-vars":"off","@typescript-eslint/no-unused-vars":"off","unused-imports/no-unused-imports":"error","unused-imports/no-unused-vars":["error",{vars:"all",varsIgnorePattern:"^_",args:"after-used",argsIgnorePattern:"^_"}],"sort-imports":["error",{ignoreCase:!0,ignoreDeclarationSort:!0,ignoreMemberSort:!1}],"import/order":["error",{groups:["builtin","external","internal",["parent","sibling"]],pathGroups:[{pattern:"react",group:"external",position:"before"}],pathGroupsExcludedImportTypes:["react"],"newlines-between":"always",alphabetize:{order:"asc",caseInsensitive:!0}}]},settings:{"import/resolver":{typescript:!0,node:!0},react:{version:"detect"}}})}export{u as library,d as react};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/library.ts","../src/react.ts"],"sourcesContent":["import js from '@eslint/js';\nimport type { TSESLint } from '@typescript-eslint/utils';\nimport imports from 'eslint-plugin-import';\nimport jest from 'eslint-plugin-jest';\nimport prettierRecommended from 'eslint-plugin-prettier/recommended';\nimport unusedImports from 'eslint-plugin-unused-imports';\nimport globalsImp from 'globals';\nimport { config, configs } from 'typescript-eslint';\n\nimport { Config } from './Config';\n\nconst globals = globalsImp as Record<string, Record<string, boolean>>;\n\nfunction library({ ignores }: Config): TSESLint.FlatConfig.ConfigArray {\n return config(\n js.configs.recommended,\n imports.flatConfigs.recommended,\n imports.flatConfigs.typescript,\n ...configs.recommended,\n ...configs.recommendedTypeChecked,\n {\n files: ['**/*.test.{js,ts,jsx,tsx}'],\n ...jest.configs['flat/recommended'],\n languageOptions: {\n globals: {\n ...globals.jest,\n //...globals.vitest,\n },\n },\n },\n prettierRecommended,\n {\n ignores,\n },\n {\n languageOptions: {\n parserOptions: {\n ecmaVersion: 'latest',\n sourceType: 'module',\n project: true,\n tsconfigRootDir: './',\n },\n },\n plugins: {\n 'unused-imports': unusedImports,\n },\n rules: {\n 'prettier/prettier': [\n 'error',\n {\n semi: true,\n trailingComma: 'all',\n singleQuote: true,\n printWidth: 120,\n tabWidth: 2,\n },\n {\n usePrettierrc: false,\n fileInfoOptions: {\n withNodeModules: true,\n },\n },\n ],\n '@typescript-eslint/explicit-module-boundary-types': 'error',\n '@typescript-eslint/no-explicit-any': 'error',\n 'no-unused-vars': 'off',\n '@typescript-eslint/no-unused-vars': 'off',\n 'unused-imports/no-unused-imports': 'error',\n 'unused-imports/no-unused-vars': [\n 'error',\n {\n vars: 'all',\n varsIgnorePattern: '^_',\n args: 'after-used',\n argsIgnorePattern: '^_',\n },\n ],\n 'sort-imports': [\n 'error',\n {\n ignoreCase: true,\n ignoreDeclarationSort: true,\n ignoreMemberSort: false,\n },\n ],\n 'import/order': [\n 'error',\n {\n groups: ['builtin', 'external', 'internal', ['parent', 'sibling']],\n 'newlines-between': 'always',\n alphabetize: {\n order: 'asc',\n caseInsensitive: true,\n },\n },\n ],\n },\n settings: {\n 'import/resolver': {\n typescript: true,\n node: true,\n },\n },\n },\n );\n}\n\nexport { library };\n","import js from '@eslint/js';\nimport type { TSESLint } from '@typescript-eslint/utils';\nimport imports from 'eslint-plugin-import';\nimport jest from 'eslint-plugin-jest';\nimport prettierRecommended from 'eslint-plugin-prettier/recommended';\n//import reactRecommended from 'eslint-plugin-react/configs/recommended.js';\nimport reactPlugin from 'eslint-plugin-react';\nimport reactHooks from 'eslint-plugin-react-hooks';\nimport unusedImports from 'eslint-plugin-unused-imports';\nimport globalsImp from 'globals';\nimport { config, configs } from 'typescript-eslint';\n\nimport { Config } from './Config';\n\nconst globals = globalsImp as Record<string, Record<string, boolean>>;\n\nfunction react({ ignores }: Config): TSESLint.FlatConfig.ConfigArray {\n return config(\n js.configs.recommended,\n imports.flatConfigs.recommended,\n imports.flatConfigs.typescript,\n ...configs.recommended,\n ...configs.recommendedTypeChecked,\n {\n files: ['**/*.{jsx,tsx}'],\n ...reactPlugin.configs.flat.recommended,\n ...reactPlugin.configs.flat['jsx-runtime'],\n languageOptions: {\n ...reactPlugin.configs.flat.recommended.languageOptions,\n globals: {\n ...globals.serviceworker,\n ...globals.browser,\n },\n },\n },\n {\n files: ['**/*.test.{js,ts,jsx,tsx}'],\n ...jest.configs['flat/recommended'],\n languageOptions: {\n globals: {\n ...globals.jest,\n //...globals.vitest,\n },\n },\n },\n prettierRecommended,\n {\n ignores,\n },\n {\n languageOptions: {\n parserOptions: {\n ecmaVersion: 'latest',\n sourceType: 'module',\n project: true,\n tsconfigRootDir: './',\n },\n },\n plugins: {\n 'unused-imports': unusedImports,\n 'react-hooks': reactHooks,\n },\n rules: {\n 'prettier/prettier': [\n 'error',\n {\n semi: true,\n trailingComma: 'all',\n singleQuote: true,\n jsxSingleQuote: true,\n printWidth: 120,\n tabWidth: 2,\n },\n {\n usePrettierrc: false,\n fileInfoOptions: {\n withNodeModules: true,\n },\n },\n ],\n ...reactHooks.configs.recommended.rules,\n 'react/react-in-jsx-scope': 'off',\n 'react/jsx-uses-react': 'off',\n '@typescript-eslint/explicit-module-boundary-types': 'error',\n '@typescript-eslint/no-explicit-any': 'error',\n 'no-unused-vars': 'off',\n '@typescript-eslint/no-unused-vars': 'off',\n 'unused-imports/no-unused-imports': 'error',\n 'unused-imports/no-unused-vars': [\n 'error',\n {\n vars: 'all',\n varsIgnorePattern: '^_',\n args: 'after-used',\n argsIgnorePattern: '^_',\n },\n ],\n 'sort-imports': [\n 'error',\n {\n ignoreCase: true,\n ignoreDeclarationSort: true,\n ignoreMemberSort: false,\n },\n ],\n 'import/order': [\n 'error',\n {\n groups: ['builtin', 'external', 'internal', ['parent', 'sibling']],\n pathGroups: [\n {\n pattern: 'react',\n group: 'external',\n position: 'before',\n },\n ],\n pathGroupsExcludedImportTypes: ['react'],\n 'newlines-between': 'always',\n alphabetize: {\n order: 'asc',\n caseInsensitive: true,\n },\n },\n ],\n },\n settings: {\n 'import/resolver': {\n typescript: true,\n node: true,\n },\n react: {\n version: 'detect',\n },\n },\n },\n );\n}\n\nexport { react };\n"],"names":["globals","globalsImp","library","ignores","config","js","configs","recommended","imports","flatConfigs","typescript","recommendedTypeChecked","files","jest","languageOptions","prettierRecommended","parserOptions","ecmaVersion","sourceType","project","tsconfigRootDir","plugins","unusedImports","rules","semi","trailingComma","singleQuote","printWidth","tabWidth","usePrettierrc","fileInfoOptions","withNodeModules","vars","varsIgnorePattern","args","argsIgnorePattern","ignoreCase","ignoreDeclarationSort","ignoreMemberSort","groups","alphabetize","order","caseInsensitive","settings","node","react","reactPlugin","flat","serviceworker","browser","reactHooks","jsxSingleQuote","pathGroups","pattern","group","position","pathGroupsExcludedImportTypes","version"],"mappings":"yVAWA,MAAMA,EAAUC,EAEhB,SAASC,GAAQC,QAAEA,IACjB,OAAOC,EACLC,EAAGC,QAAQC,YACXC,EAAQC,YAAYF,YACpBC,EAAQC,YAAYC,cACjBJ,EAAQC,eACRD,EAAQK,uBACX,CACEC,MAAO,CAAC,gCACLC,EAAKP,QAAQ,oBAChBQ,gBAAiB,CACfd,QAAS,IACJA,EAAQa,QAKjBE,EACA,CACEZ,WAEF,CACEW,gBAAiB,CACfE,cAAe,CACbC,YAAa,SACbC,WAAY,SACZC,SAAS,EACTC,gBAAiB,OAGrBC,QAAS,CACP,iBAAkBC,GAEpBC,MAAO,CACL,oBAAqB,CACnB,QACA,CACEC,MAAM,EACNC,cAAe,MACfC,aAAa,EACbC,WAAY,IACZC,SAAU,GAEZ,CACEC,eAAe,EACfC,gBAAiB,CACfC,iBAAiB,KAIvB,oDAAqD,QACrD,qCAAsC,QACtC,iBAAkB,MAClB,oCAAqC,MACrC,mCAAoC,QACpC,gCAAiC,CAC/B,QACA,CACEC,KAAM,MACNC,kBAAmB,KACnBC,KAAM,aACNC,kBAAmB,OAGvB,eAAgB,CACd,QACA,CACEC,YAAY,EACZC,uBAAuB,EACvBC,kBAAkB,IAGtB,eAAgB,CACd,QACA,CACEC,OAAQ,CAAC,UAAW,WAAY,WAAY,CAAC,SAAU,YACvD,mBAAoB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EC,QAAS,QACTC,MAAO,WACPC,SAAU,WAGdC,8BAA+B,CAAC,SAChC,mBAAoB,SACpBhB,YAAa,CACXC,MAAO,MACPC,iBAAiB,MAKzBC,SAAU,CACR,kBAAmB,CACjBjC,YAAY,EACZkC,MAAM,GAERC,MAAO,CACLY,QAAS,YAKnB"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarsilla/eslint-config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"engines": {
|
|
5
|
-
"node": "
|
|
5
|
+
"node": ">=22"
|
|
6
6
|
},
|
|
7
7
|
"main": "./lib/index.mjs",
|
|
8
8
|
"exports": {
|
|
@@ -15,9 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"types": "./lib/index.d.ts",
|
|
17
17
|
"files": [
|
|
18
|
-
"lib
|
|
19
|
-
"
|
|
20
|
-
"lib/index.mjs",
|
|
18
|
+
"lib/*",
|
|
19
|
+
"src/*",
|
|
21
20
|
"README.md",
|
|
22
21
|
"LICENSE"
|
|
23
22
|
],
|
|
@@ -35,25 +34,27 @@
|
|
|
35
34
|
"eslint": "^8.57.0"
|
|
36
35
|
},
|
|
37
36
|
"dependencies": {
|
|
38
|
-
"@eslint/js": "^9.
|
|
39
|
-
"
|
|
40
|
-
"eslint-
|
|
41
|
-
"eslint-
|
|
42
|
-
"eslint-plugin-jest": "^28.
|
|
43
|
-
"eslint-plugin-
|
|
44
|
-
"eslint-plugin-
|
|
45
|
-
"eslint-plugin-react
|
|
46
|
-
"eslint-plugin-
|
|
47
|
-
"
|
|
48
|
-
"
|
|
37
|
+
"@eslint/js": "^9.19.0",
|
|
38
|
+
"@types/node": "^22.13.1",
|
|
39
|
+
"eslint-config-prettier": "^10.0.1",
|
|
40
|
+
"eslint-import-resolver-typescript": "^3.7.0",
|
|
41
|
+
"eslint-plugin-jest": "^28.11.0",
|
|
42
|
+
"eslint-plugin-import": "^2.31.0",
|
|
43
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
44
|
+
"eslint-plugin-react": "^7.37.4",
|
|
45
|
+
"eslint-plugin-react-hooks": "^5.1.0",
|
|
46
|
+
"eslint-plugin-unused-imports": "^4.1.4",
|
|
47
|
+
"prettier": "^3.4.2",
|
|
48
|
+
"typescript-eslint": "^8.23.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@rollup/plugin-terser": "^0.4.4",
|
|
52
|
-
"@rollup/plugin-typescript": "^
|
|
52
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
53
53
|
"@types/eslint__js": "^8.42.3",
|
|
54
|
-
"
|
|
54
|
+
"jiti": "^2.4.2",
|
|
55
|
+
"rollup": "^4.34.2",
|
|
55
56
|
"rollup-plugin-dts": "^6.1.1",
|
|
56
57
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
57
|
-
"typescript": "^5.
|
|
58
|
+
"typescript": "^5.7.3"
|
|
58
59
|
}
|
|
59
60
|
}
|
package/src/Config.ts
ADDED
package/src/index.ts
ADDED
package/src/library.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
3
|
+
import imports from 'eslint-plugin-import';
|
|
4
|
+
import jest from 'eslint-plugin-jest';
|
|
5
|
+
import prettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
6
|
+
import unusedImports from 'eslint-plugin-unused-imports';
|
|
7
|
+
import globalsImp from 'globals';
|
|
8
|
+
import { config, configs } from 'typescript-eslint';
|
|
9
|
+
|
|
10
|
+
import { Config } from './Config';
|
|
11
|
+
|
|
12
|
+
const globals = globalsImp as Record<string, Record<string, boolean>>;
|
|
13
|
+
|
|
14
|
+
function library({ ignores }: Config): TSESLint.FlatConfig.ConfigArray {
|
|
15
|
+
return config(
|
|
16
|
+
js.configs.recommended,
|
|
17
|
+
imports.flatConfigs.recommended,
|
|
18
|
+
imports.flatConfigs.typescript,
|
|
19
|
+
...configs.recommended,
|
|
20
|
+
...configs.recommendedTypeChecked,
|
|
21
|
+
{
|
|
22
|
+
files: ['**/*.test.{js,ts,jsx,tsx}'],
|
|
23
|
+
...jest.configs['flat/recommended'],
|
|
24
|
+
languageOptions: {
|
|
25
|
+
globals: {
|
|
26
|
+
...globals.jest,
|
|
27
|
+
//...globals.vitest,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
prettierRecommended,
|
|
32
|
+
{
|
|
33
|
+
ignores,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
languageOptions: {
|
|
37
|
+
parserOptions: {
|
|
38
|
+
ecmaVersion: 'latest',
|
|
39
|
+
sourceType: 'module',
|
|
40
|
+
project: true,
|
|
41
|
+
tsconfigRootDir: './',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
plugins: {
|
|
45
|
+
'unused-imports': unusedImports,
|
|
46
|
+
},
|
|
47
|
+
rules: {
|
|
48
|
+
'prettier/prettier': [
|
|
49
|
+
'error',
|
|
50
|
+
{
|
|
51
|
+
semi: true,
|
|
52
|
+
trailingComma: 'all',
|
|
53
|
+
singleQuote: true,
|
|
54
|
+
printWidth: 120,
|
|
55
|
+
tabWidth: 2,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
usePrettierrc: false,
|
|
59
|
+
fileInfoOptions: {
|
|
60
|
+
withNodeModules: true,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
'@typescript-eslint/explicit-module-boundary-types': 'error',
|
|
65
|
+
'@typescript-eslint/no-explicit-any': 'error',
|
|
66
|
+
'no-unused-vars': 'off',
|
|
67
|
+
'@typescript-eslint/no-unused-vars': 'off',
|
|
68
|
+
'unused-imports/no-unused-imports': 'error',
|
|
69
|
+
'unused-imports/no-unused-vars': [
|
|
70
|
+
'error',
|
|
71
|
+
{
|
|
72
|
+
vars: 'all',
|
|
73
|
+
varsIgnorePattern: '^_',
|
|
74
|
+
args: 'after-used',
|
|
75
|
+
argsIgnorePattern: '^_',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
'sort-imports': [
|
|
79
|
+
'error',
|
|
80
|
+
{
|
|
81
|
+
ignoreCase: true,
|
|
82
|
+
ignoreDeclarationSort: true,
|
|
83
|
+
ignoreMemberSort: false,
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
'import/order': [
|
|
87
|
+
'error',
|
|
88
|
+
{
|
|
89
|
+
groups: ['builtin', 'external', 'internal', ['parent', 'sibling']],
|
|
90
|
+
'newlines-between': 'always',
|
|
91
|
+
alphabetize: {
|
|
92
|
+
order: 'asc',
|
|
93
|
+
caseInsensitive: true,
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
settings: {
|
|
99
|
+
'import/resolver': {
|
|
100
|
+
typescript: true,
|
|
101
|
+
node: true,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export { library };
|
package/src/react.ts
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
3
|
+
import imports from 'eslint-plugin-import';
|
|
4
|
+
import jest from 'eslint-plugin-jest';
|
|
5
|
+
import prettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
6
|
+
//import reactRecommended from 'eslint-plugin-react/configs/recommended.js';
|
|
7
|
+
import reactPlugin from 'eslint-plugin-react';
|
|
8
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
9
|
+
import unusedImports from 'eslint-plugin-unused-imports';
|
|
10
|
+
import globalsImp from 'globals';
|
|
11
|
+
import { config, configs } from 'typescript-eslint';
|
|
12
|
+
|
|
13
|
+
import { Config } from './Config';
|
|
14
|
+
|
|
15
|
+
const globals = globalsImp as Record<string, Record<string, boolean>>;
|
|
16
|
+
|
|
17
|
+
function react({ ignores }: Config): TSESLint.FlatConfig.ConfigArray {
|
|
18
|
+
return config(
|
|
19
|
+
js.configs.recommended,
|
|
20
|
+
imports.flatConfigs.recommended,
|
|
21
|
+
imports.flatConfigs.typescript,
|
|
22
|
+
...configs.recommended,
|
|
23
|
+
...configs.recommendedTypeChecked,
|
|
24
|
+
{
|
|
25
|
+
files: ['**/*.{jsx,tsx}'],
|
|
26
|
+
...reactPlugin.configs.flat.recommended,
|
|
27
|
+
...reactPlugin.configs.flat['jsx-runtime'],
|
|
28
|
+
languageOptions: {
|
|
29
|
+
...reactPlugin.configs.flat.recommended.languageOptions,
|
|
30
|
+
globals: {
|
|
31
|
+
...globals.serviceworker,
|
|
32
|
+
...globals.browser,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
files: ['**/*.test.{js,ts,jsx,tsx}'],
|
|
38
|
+
...jest.configs['flat/recommended'],
|
|
39
|
+
languageOptions: {
|
|
40
|
+
globals: {
|
|
41
|
+
...globals.jest,
|
|
42
|
+
//...globals.vitest,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
prettierRecommended,
|
|
47
|
+
{
|
|
48
|
+
ignores,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
languageOptions: {
|
|
52
|
+
parserOptions: {
|
|
53
|
+
ecmaVersion: 'latest',
|
|
54
|
+
sourceType: 'module',
|
|
55
|
+
project: true,
|
|
56
|
+
tsconfigRootDir: './',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
plugins: {
|
|
60
|
+
'unused-imports': unusedImports,
|
|
61
|
+
'react-hooks': reactHooks,
|
|
62
|
+
},
|
|
63
|
+
rules: {
|
|
64
|
+
'prettier/prettier': [
|
|
65
|
+
'error',
|
|
66
|
+
{
|
|
67
|
+
semi: true,
|
|
68
|
+
trailingComma: 'all',
|
|
69
|
+
singleQuote: true,
|
|
70
|
+
jsxSingleQuote: true,
|
|
71
|
+
printWidth: 120,
|
|
72
|
+
tabWidth: 2,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
usePrettierrc: false,
|
|
76
|
+
fileInfoOptions: {
|
|
77
|
+
withNodeModules: true,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
...reactHooks.configs.recommended.rules,
|
|
82
|
+
'react/react-in-jsx-scope': 'off',
|
|
83
|
+
'react/jsx-uses-react': 'off',
|
|
84
|
+
'@typescript-eslint/explicit-module-boundary-types': 'error',
|
|
85
|
+
'@typescript-eslint/no-explicit-any': 'error',
|
|
86
|
+
'no-unused-vars': 'off',
|
|
87
|
+
'@typescript-eslint/no-unused-vars': 'off',
|
|
88
|
+
'unused-imports/no-unused-imports': 'error',
|
|
89
|
+
'unused-imports/no-unused-vars': [
|
|
90
|
+
'error',
|
|
91
|
+
{
|
|
92
|
+
vars: 'all',
|
|
93
|
+
varsIgnorePattern: '^_',
|
|
94
|
+
args: 'after-used',
|
|
95
|
+
argsIgnorePattern: '^_',
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
'sort-imports': [
|
|
99
|
+
'error',
|
|
100
|
+
{
|
|
101
|
+
ignoreCase: true,
|
|
102
|
+
ignoreDeclarationSort: true,
|
|
103
|
+
ignoreMemberSort: false,
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
'import/order': [
|
|
107
|
+
'error',
|
|
108
|
+
{
|
|
109
|
+
groups: ['builtin', 'external', 'internal', ['parent', 'sibling']],
|
|
110
|
+
pathGroups: [
|
|
111
|
+
{
|
|
112
|
+
pattern: 'react',
|
|
113
|
+
group: 'external',
|
|
114
|
+
position: 'before',
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
pathGroupsExcludedImportTypes: ['react'],
|
|
118
|
+
'newlines-between': 'always',
|
|
119
|
+
alphabetize: {
|
|
120
|
+
order: 'asc',
|
|
121
|
+
caseInsensitive: true,
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
settings: {
|
|
127
|
+
'import/resolver': {
|
|
128
|
+
typescript: true,
|
|
129
|
+
node: true,
|
|
130
|
+
},
|
|
131
|
+
react: {
|
|
132
|
+
version: 'detect',
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export { react };
|