Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ESLint config & lint code #258

Merged
merged 10 commits into from
Jul 30, 2024
8 changes: 0 additions & 8 deletions .eslintrc

This file was deleted.

48 changes: 48 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import Codex from "eslint-config-codex";
import { plugin as TsPlugin, parser as TsParser } from 'typescript-eslint';

export default [
...Codex,
{
files: ['src/**/*.ts'],
languageOptions: {
parser: TsParser,
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: './',
sourceType: 'module',
},
},
rules: {
'n/no-missing-import': ['off'],
'n/no-unsupported-features/node-builtins': ['off'],
'jsdoc/require-returns-description': ['off'],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": ["camelCase"],
"leadingUnderscore": "allow"
},
],
"@typescript-eslint/ban-types": ["error",
{
"types": {
"String": true,
"Boolean": true,
"Number": true,
"Symbol": true,
"{}": false,
"Object": true,
"object": false,
"Function": false,
},
"extendDefaults": true
}
]
}
},
{
ignores: ['dev/**', 'eslint.config.mjs', 'vite.config.js', 'postcss.config.js']
}
];
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@editorjs/image",
"version": "2.9.2",
"version": "2.9.3",
"keywords": [
"codex editor",
"image",
Expand All @@ -26,9 +26,9 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint src/ --ext .ts",
"lint:errors": "eslint src/ --quiet",
"lint:fix": "eslint src/ --fix"
"lint": "eslint",
"lint:errors": "eslint --quiet",
"lint:fix": "eslint --fix"
},
"author": {
"name": "CodeX",
Expand All @@ -37,16 +37,17 @@
"devDependencies": {
"@codexteam/ajax": "^4.2.0",
"@editorjs/editorjs": "2.30.0-rc.12",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"eslint": "^7.22.0",
"@typescript-eslint/eslint-plugin": "^7.16.1",
"@typescript-eslint/parser": "^7.16.1",
"eslint": "^9.7.0",
"eslint-config-codex": "^2.0.1",
"eslint-loader": "^4.0.2",
"formidable": "^3.5.1",
"postcss-nested": "^6.0.1",
"postcss-nested-ancestors": "^3.0.0",
"request": "^2.88.0",
"typescript": "^5.4.5",
"typescript-eslint": "^7.17.0",
"vite": "^5.3.1",
"vite-plugin-css-injected-by-js": "^3.5.1",
"vite-plugin-dts": "^3.9.1"
Expand Down
Loading
Loading