Skip to content

Commit

Permalink
Merge pull request #282 from AndreaPontrandolfo/AndreaPontrandolfo/is…
Browse files Browse the repository at this point in the history
…sue281

AndreaPontrandolfo/issue281
  • Loading branch information
AndreaPontrandolfo authored Oct 27, 2024
2 parents 5e12399 + 8a0b653 commit 917379a
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 56 deletions.
6 changes: 6 additions & 0 deletions .changeset/clean-masks-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'eslint-config-sheriff': minor
---

feat(rules): updated eslint-plugin-import and allowed some rules in `*.config.*` files
Fixes #281
8 changes: 0 additions & 8 deletions apps/docs-website/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ export default defineFlatConfig([
},
},
],
'import/no-unresolved': [
2,
{
commonjs: true,
caseSensitiveStrict: true,
ignore: ['^@theme', '^@docusaurus'],
},
],
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion apps/sheriff-webservices/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"eslint-plugin-arrow-return-style": "^1.3.0",
"eslint-plugin-astro": "^1.2.3",
"eslint-plugin-fsecond": "^1.1.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^28.8.0",
"eslint-plugin-jsdoc": "^48.11.0",
"eslint-plugin-jsx-a11y": "^6.10.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-sheriff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"eslint-plugin-arrow-return-style": "^1.3.0",
"eslint-plugin-astro": "^1.2.3",
"eslint-plugin-fsecond": "^1.1.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^28.8.0",
"eslint-plugin-jsdoc": "^48.11.0",
"eslint-plugin-jsx-a11y": "^6.10.0",
Expand Down
20 changes: 11 additions & 9 deletions packages/eslint-config-sheriff/src/getBaseConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,11 @@ export const getBaseConfig = (
},
{
files: [supportedFileTypes],
plugins: { import: fixupPluginRules(pluginImport) },
plugins: { import: pluginImport },
rules: importHandPickedRules,
languageOptions: {
parserOptions: {
sourceType: 'module', // required for https://github.com/import-js/eslint-plugin-import/blob/09476d7dac1ab36668283f9626f85e2223652b37/src/rules/no-default-export.js#L16
ecmaVersion: 'latest', // required by eslint-plugin-import when using sourceType: 'module'
},
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx', '.mts'],
'@typescript-eslint/parser': ['.ts', '.tsx', '.mts', 'cts'],
espree: ['.js'],
},
'import/resolver': {
Expand All @@ -155,6 +149,12 @@ export const getBaseConfig = (
},
},
},
{
files: ['**/*.d.ts'],
rules: {
'import/no-default-export': 0,
},
},
{
files: [
'**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)',
Expand Down Expand Up @@ -189,9 +189,11 @@ export const getBaseConfig = (
rules: { 'fsecond/prefer-destructured-optionals': 2 },
},
{
files: [`**/*.config.{${allJsExtensions}}`],
files: ['**/*.config.*'],
rules: {
'import/no-default-export': 0,
'import/no-anonymous-default-export': 0,
'arrow-return-style/no-export-default-arrow': 0,
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion packages/sheriff-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"clean": "rm -rf .turbo dist",
"build": "tsup",
"typecheck": "tsc --noEmit",
"lint": "eslint . --max-warnings=0 --cache --cache-location=node_modules/.cache/.eslintcache",
"lint": "eslint ./src --max-warnings=0 --cache --cache-location=node_modules/.cache/.eslintcache",
"publint": "publint",
"typesync": "typesync --dry=fail"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/sheriff-create-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build": "tsup",
"build-watch": "tsup",
"typecheck": "tsc --noEmit",
"lint": "eslint . --max-warnings=0 --cache --cache-location=node_modules/.cache/.eslintcache",
"lint": "eslint ./src --max-warnings=0 --cache --cache-location=node_modules/.cache/.eslintcache",
"publint": "publint",
"typesync": "typesync --dry=fail"
},
Expand Down
69 changes: 34 additions & 35 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 917379a

Please sign in to comment.