Skip to content

Commit

Permalink
upgrade eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
jgerigmeyer committed Dec 2, 2024
1 parent e051967 commit eab4bcc
Show file tree
Hide file tree
Showing 11 changed files with 480 additions and 428 deletions.
14 changes: 0 additions & 14 deletions .eslintignore

This file was deleted.

181 changes: 0 additions & 181 deletions .eslintrc.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,3 @@ updates:
- dependency-name: 'chai'
update-types:
- 'version-update:semver-major'
- dependency-name: 'eslint'
update-types:
- 'version-update:semver-major'
102 changes: 102 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/* eslint-disable @typescript-eslint/no-require-imports */

const babelParser = require('@babel/eslint-parser');
const js = require('@eslint/js');
const prettier = require('eslint-config-prettier');
const importPlugin = require('eslint-plugin-import');
const jest = require('eslint-plugin-jest');
const jestDOM = require('eslint-plugin-jest-dom');
const simpleImportSort = require('eslint-plugin-simple-import-sort');
const globals = require('globals');
const tseslint = require('typescript-eslint');

module.exports = tseslint.config(
{
ignores: [
'.git/*',
'.nyc_output/*',
'.vscode/*',
'.yarn/*',
'.yarnrc.yml',
'coverage/*',
'dist/*',
'docs/*',
'node_modules/*',
],
},
js.configs.recommended,
...tseslint.configs.recommended,
importPlugin.flatConfigs.recommended,
prettier,
{
files: ['**/*.{js,mjs,cjs,ts,cts,mts}'],
languageOptions: {
parser: babelParser,
globals: {
...globals.node,
...globals.es2022,
},
parserOptions: {
sourceType: 'script',
},
},
settings: {
'import/resolver': {
typescript: {},
},
'import/external-module-folders': ['node_modules'],
},
rules: {
'no-console': 1,
'no-warning-comments': ['warn', { terms: ['todo', 'fixme', '@@@'] }],
'import/first': 'warn',
'import/newline-after-import': 'warn',
'import/no-duplicates': ['error', { 'prefer-inline': true }],
'import/order': [
'warn',
{ 'newlines-between': 'always', alphabetize: { order: 'asc' } },
],
'import/named': 'warn',
},
},
{
files: ['src/**/*.{js,mjs,cjs,ts,cts,mts}'],
languageOptions: {
parser: tseslint.parser,
globals: {
...globals.browser,
...globals.es2022,
},
parserOptions: {
sourceType: 'module',
},
},
plugins: {
'simple-import-sort': simpleImportSort,
},
rules: {
'simple-import-sort/imports': 'warn',
'simple-import-sort/exports': 'warn',
'import/order': 'off',
},
},
{
files: ['test/**/*.{js,ts}'],
languageOptions: {
parser: babelParser,
globals: {
...jest.environments.globals.globals,
...globals.mocha,
...globals.es2022,
},
parserOptions: {
sourceType: 'script',
},
},
plugins: {
jest,
'jest-dom': jestDOM,
'simple-import-sort': simpleImportSort,
},
},
);
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,24 @@
},
"devDependencies": {
"@babel/core": "^7.26.0",
"@babel/eslint-parser": "^7.25.9",
"@babel/preset-env": "^7.26.0",
"@babel/preset-typescript": "^7.26.0",
"@eslint/js": "^9.16.0",
"@types/lodash": "^4.17.13",
"@typescript-eslint/eslint-plugin": "^8.16.0",
"@typescript-eslint/parser": "^8.16.0",
"babel-jest": "^29.7.0",
"chai": "^4.5.0",
"eslint": "^8.57.1",
"eslint": "^9.16.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^28.9.0",
"eslint-plugin-jest-dom": "^5.5.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"globals": "^15.13.0",
"jest": "^29.7.0",
"jest-environment-node-single-context": "^29.4.0",
"mocha": "^10.8.2",
"mocha": "^11.0.1",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.49",
"prettier": "^3.4.1",
Expand All @@ -103,8 +106,9 @@
"sassdoc": "^2.7.4",
"sassdoc-theme-herman": "^6.0.2",
"stylelint": "^16.11.0",
"stylelint-config-standard-scss": "^13.1.0",
"typescript": "^5.7.2"
"stylelint-config-standard-scss": "^14.0.0",
"typescript": "^5.7.2",
"typescript-eslint": "^8.17.0"
},
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
Expand All @@ -119,5 +123,5 @@
"sassDir": "./sass/",
"exports": false
},
"packageManager": "[email protected].0"
"packageManager": "[email protected].3"
}
Loading

0 comments on commit eab4bcc

Please sign in to comment.