@xsynaptic/eslint-config 3.4.0 → 3.4.1

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/dist/index.mjs CHANGED
@@ -65,6 +65,7 @@ function getConfig(customConfig, options) {
65
65
  { rules: {
66
66
  "unicorn/filename-case": "warn",
67
67
  "unicorn/no-array-callback-reference": "off",
68
+ "unicorn/number-literal-case": ["error", { hexadecimalValue: "lowercase" }],
68
69
  "unicorn/prevent-abbreviations": "off"
69
70
  } },
70
71
  {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["webComponentConfigs"],"sources":["../src/index.ts"],"sourcesContent":["import type { Config, ConfigWithExtends, ConfigWithExtendsArray } from '@eslint/config-helpers';\n\nimport { defineConfig } from '@eslint/config-helpers';\nimport eslint from '@eslint/js';\nimport perfectionist from 'eslint-plugin-perfectionist';\nimport unicornPlugin from 'eslint-plugin-unicorn';\nimport { configs as webComponentConfigs } from 'eslint-plugin-wc';\nimport globals from 'globals';\nimport tseslint from 'typescript-eslint';\n\n// Opt-in rules for authoring native web components\nexport function getWebComponentConfig(files: Array<string>): ConfigWithExtends {\n\tconst bestPractice = webComponentConfigs['flat/best-practice'];\n\n\treturn {\n\t\t...bestPractice,\n\t\tfiles,\n\t\trules: {\n\t\t\t...bestPractice?.rules,\n\t\t\t'wc/define-tag-after-class-definition': 'error',\n\t\t\t'wc/guard-define-call': 'error',\n\t\t\t'wc/max-elements-per-file': 'error',\n\t\t\t'wc/no-child-traversal-in-connectedcallback': 'off',\n\t\t\t'wc/no-constructor': 'error',\n\t\t\t'wc/no-exports-with-element': 'error',\n\t\t\t'wc/no-method-prefixed-with-on': 'error',\n\t\t},\n\t};\n}\n\nexport function getConfig(\n\tcustomConfig?: ConfigWithExtendsArray,\n\toptions?: {\n\t\tcustomGlobals?: Record<string, 'readonly' | 'writeable'>;\n\t\tparserOptions?: NonNullable<Config['languageOptions']>['parserOptions'];\n\t},\n): ConfigWithExtendsArray {\n\tconst customGlobals = options?.customGlobals ?? {};\n\n\tconst baseConfig = [\n\t\teslint.configs.recommended,\n\t\t...tseslint.configs.strictTypeChecked,\n\t\t...tseslint.configs.stylisticTypeChecked,\n\t\t{\n\t\t\tlanguageOptions: {\n\t\t\t\tglobals: {\n\t\t\t\t\t...globals.builtin,\n\t\t\t\t\t...globals.nodeBuiltin,\n\t\t\t\t\t...customGlobals,\n\t\t\t\t},\n\t\t\t\tparser: tseslint.parser,\n\t\t\t\tparserOptions: options?.parserOptions ?? {\n\t\t\t\t\tprojectService: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\tplugins: {\n\t\t\t\t'@typescript-eslint': tseslint.plugin,\n\t\t\t},\n\t\t\trules: {\n\t\t\t\t'@typescript-eslint/array-type': ['warn', { default: 'generic' }],\n\t\t\t\t'@typescript-eslint/no-non-null-assertion': 'off',\n\t\t\t\t'@typescript-eslint/no-unused-vars': [\n\t\t\t\t\t'error',\n\t\t\t\t\t{\n\t\t\t\t\t\targsIgnorePattern: '^_',\n\t\t\t\t\t\tcaughtErrorsIgnorePattern: '^_',\n\t\t\t\t\t\tdestructuredArrayIgnorePattern: '^_',\n\t\t\t\t\t\tignoreRestSiblings: true,\n\t\t\t\t\t\tvarsIgnorePattern: '^_',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t'@typescript-eslint/consistent-type-imports': [\n\t\t\t\t\t'error',\n\t\t\t\t\t{ fixStyle: 'separate-type-imports', prefer: 'type-imports' },\n\t\t\t\t],\n\t\t\t\t'@typescript-eslint/prefer-nullish-coalescing': 'off',\n\t\t\t\t'no-restricted-syntax': [\n\t\t\t\t\t'error',\n\t\t\t\t\t{\n\t\t\t\t\t\tmessage: 'Separate type imports into their own `import type` statement.',\n\t\t\t\t\t\tselector: 'ImportDeclaration[importKind=\"value\"] ImportSpecifier[importKind=\"type\"]',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tunicornPlugin.configs.recommended,\n\t\t{\n\t\t\trules: {\n\t\t\t\t'unicorn/filename-case': 'warn',\n\t\t\t\t'unicorn/no-array-callback-reference': 'off', // I prefer this pattern for filtering/sorting content\n\t\t\t\t'unicorn/prevent-abbreviations': 'off', // I *like* abbreviations!\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tplugins: {\n\t\t\t\tperfectionist,\n\t\t\t},\n\t\t\trules: {\n\t\t\t\t'perfectionist/sort-classes': 'off',\n\t\t\t\t'perfectionist/sort-imports': [\n\t\t\t\t\t'error',\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'natural',\n\t\t\t\t\t\torder: 'asc',\n\t\t\t\t\t\tinternalPattern: ['^~/.*', '^@/.*', '^#.*'],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t'perfectionist/sort-interfaces': 'off',\n\t\t\t\t'perfectionist/sort-jsx-props': 'off',\n\t\t\t\t'perfectionist/sort-maps': 'off',\n\t\t\t\t'perfectionist/sort-modules': 'off',\n\t\t\t\t'perfectionist/sort-objects': 'off',\n\t\t\t\t'perfectionist/sort-object-types': 'off',\n\t\t\t\t'perfectionist/sort-sets': 'off',\n\t\t\t\t'perfectionist/sort-switch-case': 'off',\n\t\t\t\t'perfectionist/sort-union-types': 'off',\n\t\t\t},\n\t\t},\n\t] satisfies Array<ConfigWithExtends>;\n\n\treturn defineConfig(...baseConfig, ...(customConfig ?? []));\n}\n"],"mappings":";;;;;;;;AAWA,SAAgB,sBAAsB,OAAyC;CAC9E,MAAM,eAAeA,QAAoB;CAEzC,OAAO;EACN,GAAG;EACH;EACA,OAAO;GACN,GAAG,cAAc;GACjB,wCAAwC;GACxC,wBAAwB;GACxB,4BAA4B;GAC5B,8CAA8C;GAC9C,qBAAqB;GACrB,8BAA8B;GAC9B,iCAAiC;EAClC;CACD;AACD;AAEA,SAAgB,UACf,cACA,SAIyB;CACzB,MAAM,gBAAgB,SAAS,iBAAiB,CAAC;CAmFjD,OAAO,aAAa,GAAG;EAhFtB,OAAO,QAAQ;EACf,GAAG,SAAS,QAAQ;EACpB,GAAG,SAAS,QAAQ;EACpB;GACC,iBAAiB;IAChB,SAAS;KACR,GAAG,QAAQ;KACX,GAAG,QAAQ;KACX,GAAG;IACJ;IACA,QAAQ,SAAS;IACjB,eAAe,SAAS,iBAAiB,EACxC,gBAAgB,KACjB;GACD;GACA,SAAS,EACR,sBAAsB,SAAS,OAChC;GACA,OAAO;IACN,iCAAiC,CAAC,QAAQ,EAAE,SAAS,UAAU,CAAC;IAChE,4CAA4C;IAC5C,qCAAqC,CACpC,SACA;KACC,mBAAmB;KACnB,2BAA2B;KAC3B,gCAAgC;KAChC,oBAAoB;KACpB,mBAAmB;IACpB,CACD;IACA,8CAA8C,CAC7C,SACA;KAAE,UAAU;KAAyB,QAAQ;IAAe,CAC7D;IACA,gDAAgD;IAChD,wBAAwB,CACvB,SACA;KACC,SAAS;KACT,UAAU;IACX,CACD;GACD;EACD;EACA,cAAc,QAAQ;EACtB,EACC,OAAO;GACN,yBAAyB;GACzB,uCAAuC;GACvC,iCAAiC;EAClC,EACD;EACA;GACC,SAAS,EACR,cACD;GACA,OAAO;IACN,8BAA8B;IAC9B,8BAA8B,CAC7B,SACA;KACC,MAAM;KACN,OAAO;KACP,iBAAiB;MAAC;MAAS;MAAS;KAAM;IAC3C,CACD;IACA,iCAAiC;IACjC,gCAAgC;IAChC,2BAA2B;IAC3B,8BAA8B;IAC9B,8BAA8B;IAC9B,mCAAmC;IACnC,2BAA2B;IAC3B,kCAAkC;IAClC,kCAAkC;GACnC;EACD;CAG+B,GAAG,GAAI,gBAAgB,CAAC,CAAE;AAC3D"}
1
+ {"version":3,"file":"index.mjs","names":["webComponentConfigs"],"sources":["../src/index.ts"],"sourcesContent":["import type { Config, ConfigWithExtends, ConfigWithExtendsArray } from '@eslint/config-helpers';\n\nimport { defineConfig } from '@eslint/config-helpers';\nimport eslint from '@eslint/js';\nimport perfectionist from 'eslint-plugin-perfectionist';\nimport unicornPlugin from 'eslint-plugin-unicorn';\nimport { configs as webComponentConfigs } from 'eslint-plugin-wc';\nimport globals from 'globals';\nimport tseslint from 'typescript-eslint';\n\n// Opt-in rules for authoring native web components\nexport function getWebComponentConfig(files: Array<string>): ConfigWithExtends {\n\tconst bestPractice = webComponentConfigs['flat/best-practice'];\n\n\treturn {\n\t\t...bestPractice,\n\t\tfiles,\n\t\trules: {\n\t\t\t...bestPractice?.rules,\n\t\t\t'wc/define-tag-after-class-definition': 'error',\n\t\t\t'wc/guard-define-call': 'error',\n\t\t\t'wc/max-elements-per-file': 'error',\n\t\t\t'wc/no-child-traversal-in-connectedcallback': 'off',\n\t\t\t'wc/no-constructor': 'error',\n\t\t\t'wc/no-exports-with-element': 'error',\n\t\t\t'wc/no-method-prefixed-with-on': 'error',\n\t\t},\n\t};\n}\n\nexport function getConfig(\n\tcustomConfig?: ConfigWithExtendsArray,\n\toptions?: {\n\t\tcustomGlobals?: Record<string, 'readonly' | 'writeable'>;\n\t\tparserOptions?: NonNullable<Config['languageOptions']>['parserOptions'];\n\t},\n): ConfigWithExtendsArray {\n\tconst customGlobals = options?.customGlobals ?? {};\n\n\tconst baseConfig = [\n\t\teslint.configs.recommended,\n\t\t...tseslint.configs.strictTypeChecked,\n\t\t...tseslint.configs.stylisticTypeChecked,\n\t\t{\n\t\t\tlanguageOptions: {\n\t\t\t\tglobals: {\n\t\t\t\t\t...globals.builtin,\n\t\t\t\t\t...globals.nodeBuiltin,\n\t\t\t\t\t...customGlobals,\n\t\t\t\t},\n\t\t\t\tparser: tseslint.parser,\n\t\t\t\tparserOptions: options?.parserOptions ?? {\n\t\t\t\t\tprojectService: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\tplugins: {\n\t\t\t\t'@typescript-eslint': tseslint.plugin,\n\t\t\t},\n\t\t\trules: {\n\t\t\t\t'@typescript-eslint/array-type': ['warn', { default: 'generic' }],\n\t\t\t\t'@typescript-eslint/no-non-null-assertion': 'off',\n\t\t\t\t'@typescript-eslint/no-unused-vars': [\n\t\t\t\t\t'error',\n\t\t\t\t\t{\n\t\t\t\t\t\targsIgnorePattern: '^_',\n\t\t\t\t\t\tcaughtErrorsIgnorePattern: '^_',\n\t\t\t\t\t\tdestructuredArrayIgnorePattern: '^_',\n\t\t\t\t\t\tignoreRestSiblings: true,\n\t\t\t\t\t\tvarsIgnorePattern: '^_',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t'@typescript-eslint/consistent-type-imports': [\n\t\t\t\t\t'error',\n\t\t\t\t\t{ fixStyle: 'separate-type-imports', prefer: 'type-imports' },\n\t\t\t\t],\n\t\t\t\t'@typescript-eslint/prefer-nullish-coalescing': 'off',\n\t\t\t\t'no-restricted-syntax': [\n\t\t\t\t\t'error',\n\t\t\t\t\t{\n\t\t\t\t\t\tmessage: 'Separate type imports into their own `import type` statement.',\n\t\t\t\t\t\tselector: 'ImportDeclaration[importKind=\"value\"] ImportSpecifier[importKind=\"type\"]',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tunicornPlugin.configs.recommended,\n\t\t{\n\t\t\trules: {\n\t\t\t\t'unicorn/filename-case': 'warn',\n\t\t\t\t'unicorn/no-array-callback-reference': 'off', // I prefer this pattern for filtering/sorting content\n\t\t\t\t'unicorn/number-literal-case': ['error', { hexadecimalValue: 'lowercase' }], // Lowercase hex to match Prettier\n\t\t\t\t'unicorn/prevent-abbreviations': 'off', // I *like* abbreviations!\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tplugins: {\n\t\t\t\tperfectionist,\n\t\t\t},\n\t\t\trules: {\n\t\t\t\t'perfectionist/sort-classes': 'off',\n\t\t\t\t'perfectionist/sort-imports': [\n\t\t\t\t\t'error',\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'natural',\n\t\t\t\t\t\torder: 'asc',\n\t\t\t\t\t\tinternalPattern: ['^~/.*', '^@/.*', '^#.*'],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t'perfectionist/sort-interfaces': 'off',\n\t\t\t\t'perfectionist/sort-jsx-props': 'off',\n\t\t\t\t'perfectionist/sort-maps': 'off',\n\t\t\t\t'perfectionist/sort-modules': 'off',\n\t\t\t\t'perfectionist/sort-objects': 'off',\n\t\t\t\t'perfectionist/sort-object-types': 'off',\n\t\t\t\t'perfectionist/sort-sets': 'off',\n\t\t\t\t'perfectionist/sort-switch-case': 'off',\n\t\t\t\t'perfectionist/sort-union-types': 'off',\n\t\t\t},\n\t\t},\n\t] satisfies Array<ConfigWithExtends>;\n\n\treturn defineConfig(...baseConfig, ...(customConfig ?? []));\n}\n"],"mappings":";;;;;;;;AAWA,SAAgB,sBAAsB,OAAyC;CAC9E,MAAM,eAAeA,QAAoB;CAEzC,OAAO;EACN,GAAG;EACH;EACA,OAAO;GACN,GAAG,cAAc;GACjB,wCAAwC;GACxC,wBAAwB;GACxB,4BAA4B;GAC5B,8CAA8C;GAC9C,qBAAqB;GACrB,8BAA8B;GAC9B,iCAAiC;EAClC;CACD;AACD;AAEA,SAAgB,UACf,cACA,SAIyB;CACzB,MAAM,gBAAgB,SAAS,iBAAiB,CAAC;CAoFjD,OAAO,aAAa,GAAG;EAjFtB,OAAO,QAAQ;EACf,GAAG,SAAS,QAAQ;EACpB,GAAG,SAAS,QAAQ;EACpB;GACC,iBAAiB;IAChB,SAAS;KACR,GAAG,QAAQ;KACX,GAAG,QAAQ;KACX,GAAG;IACJ;IACA,QAAQ,SAAS;IACjB,eAAe,SAAS,iBAAiB,EACxC,gBAAgB,KACjB;GACD;GACA,SAAS,EACR,sBAAsB,SAAS,OAChC;GACA,OAAO;IACN,iCAAiC,CAAC,QAAQ,EAAE,SAAS,UAAU,CAAC;IAChE,4CAA4C;IAC5C,qCAAqC,CACpC,SACA;KACC,mBAAmB;KACnB,2BAA2B;KAC3B,gCAAgC;KAChC,oBAAoB;KACpB,mBAAmB;IACpB,CACD;IACA,8CAA8C,CAC7C,SACA;KAAE,UAAU;KAAyB,QAAQ;IAAe,CAC7D;IACA,gDAAgD;IAChD,wBAAwB,CACvB,SACA;KACC,SAAS;KACT,UAAU;IACX,CACD;GACD;EACD;EACA,cAAc,QAAQ;EACtB,EACC,OAAO;GACN,yBAAyB;GACzB,uCAAuC;GACvC,+BAA+B,CAAC,SAAS,EAAE,kBAAkB,YAAY,CAAC;GAC1E,iCAAiC;EAClC,EACD;EACA;GACC,SAAS,EACR,cACD;GACA,OAAO;IACN,8BAA8B;IAC9B,8BAA8B,CAC7B,SACA;KACC,MAAM;KACN,OAAO;KACP,iBAAiB;MAAC;MAAS;MAAS;KAAM;IAC3C,CACD;IACA,iCAAiC;IACjC,gCAAgC;IAChC,2BAA2B;IAC3B,8BAA8B;IAC9B,8BAA8B;IAC9B,mCAAmC;IACnC,2BAA2B;IAC3B,kCAAkC;IAClC,kCAAkC;GACnC;EACD;CAG+B,GAAG,GAAI,gBAAgB,CAAC,CAAE;AAC3D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsynaptic/eslint-config",
3
- "version": "3.4.0",
3
+ "version": "3.4.1",
4
4
  "description": "An ESLint config factory for TypeScript projects",
5
5
  "type": "module",
6
6
  "license": "MIT",