generated from nl-design-system/example
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create
@frameless/eslint-config
package
- Loading branch information
Showing
10 changed files
with
611 additions
and
369 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import config from '@frameless/eslint-config'; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "@frameless/eslint-config", | ||
"version": "0.0.0", | ||
"author": "Frameless B.V.", | ||
"description": "Default configuration for ESLint", | ||
"license": "EUPL-1.2", | ||
"type": "module", | ||
"main": "src/index.mjs", | ||
"keywords": [ | ||
"eslint" | ||
], | ||
"publishConfig": { | ||
"access": "public", | ||
"registry": "https://registry.npmjs.org/" | ||
}, | ||
"repository": { | ||
"type": "git+ssh", | ||
"url": "git@github.com:frameless/design-system.git", | ||
"directory": "packages/eslint-config" | ||
}, | ||
"peerDependencies": { | ||
"eslint-config-prettier": "^9", | ||
"eslint-plugin-import": "^2", | ||
"eslint-plugin-react": "^7", | ||
"eslint": "^9", | ||
"globals": "^15", | ||
"typescript-eslint": "^8" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import eslintConfigPrettier from 'eslint-config-prettier'; | ||
import eslintPluginImport from 'eslint-plugin-import'; | ||
import eslintPluginReact from 'eslint-plugin-react'; | ||
import globals from 'globals'; | ||
import tseslint from 'typescript-eslint'; | ||
import { jsRules, reactRules } from './rules.mjs'; | ||
|
||
export default tseslint.config( | ||
{ | ||
name: 'frameless/ignores', | ||
ignores: ['**/build/', '**/coverage/', '**/dist/', '**/tmp/'], | ||
}, | ||
{ | ||
name: 'frameless/settings', | ||
// https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options | ||
linterOptions: { | ||
reportUnusedDisableDirectives: true, | ||
}, | ||
// https://eslint.org/docs/latest/use/configure/configuration-files#configuring-shared-settings | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
languageOptions: { | ||
parserOptions: { | ||
sourceType: 'module', | ||
}, | ||
}, | ||
}, | ||
{ | ||
name: 'frameless/rules', | ||
plugins: { | ||
import: eslintPluginImport, | ||
}, | ||
rules: jsRules, | ||
}, | ||
...tseslint.configs.recommended, | ||
{ | ||
name: 'frameless/tooling', | ||
files: ['**/*.cjs', '**/vite.config.ts'], | ||
languageOptions: { | ||
globals: { ...globals.node }, | ||
}, | ||
rules: { | ||
'@typescript-eslint/no-require-imports': 'off', | ||
}, | ||
}, | ||
{ | ||
name: 'frameless/test-files', | ||
files: ['**/*.test.{ts,tsx,js,jsx}'], | ||
languageOptions: { | ||
globals: { ...globals.jest }, | ||
}, | ||
}, | ||
{ | ||
name: 'frameless/source-code', | ||
files: ['**/src/*.{js,mjs,ts}'], | ||
languageOptions: { | ||
globals: { ...globals.browser }, | ||
}, | ||
}, | ||
{ | ||
name: 'frameless/react-jsx', | ||
files: ['**/*.{jsx,tsx}'], | ||
ignores: ['**/web-components-stencil/**/*.{jsx,tsx}'], | ||
plugins: { | ||
react: eslintPluginReact, | ||
}, | ||
rules: { | ||
...eslintPluginReact.configs.recommended.rules, | ||
...eslintPluginReact.configs['jsx-runtime'].rules, | ||
...reactRules, | ||
}, | ||
}, | ||
{ | ||
name: 'eslint-config-prettier', | ||
...eslintConfigPrettier, | ||
}, | ||
); |
Oops, something went wrong.