Skip to content

Commit

Permalink
🧹: update deps; eslint flat config + stylistic; lint pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonaaron committed Dec 14, 2023
1 parent 8f2f6a1 commit 2adba0f
Show file tree
Hide file tree
Showing 14 changed files with 1,488 additions and 707 deletions.
22 changes: 0 additions & 22 deletions .eslintrc.cjs

This file was deleted.

4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint:fix:staged
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## Unreleased

- chore: Update dependencies
- chore: Move to eslint flat config and stylistic package
- chore: Implement list-staged and husky for pre-commit linting
- chore: Drop custom focus plugin in unit tests
- chore: Use jsdeliver cdn in examples
- chore: Fix example in README.md

## [1.0.0] - 2023-10-20

Initial release
54 changes: 54 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import globals from 'globals'
import eslint from '@eslint/js'
import stylistic from '@stylistic/eslint-plugin'
import typescriptParser from '@typescript-eslint/parser'
import typescriptPlugin from '@typescript-eslint/eslint-plugin'

export default [
{ ignores: ['dist', 'docs'] },
eslint.configs.recommended,
stylistic.configs['recommended-flat'],
{
rules: {
'@stylistic/max-statements-per-line': 'off',
'@stylistic/brace-style': 'off',
'@stylistic/multiline-ternary': 'off',
},
},
{
files: ['**/*.js'],
languageOptions: {
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
...globals.es6,
...globals.commonjs,
},
},
},
{
files: ['*.ts', '**/*.ts'],
plugins: {
'@typescript-eslint': typescriptPlugin,
},
languageOptions: {
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
...globals.es6,
...globals.mocha,
},
parser: typescriptParser,
parserOptions: {
project: './tsconfig.json',
ecmaVersion: 2022,
},
},
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
},
},
]
Loading

0 comments on commit 2adba0f

Please sign in to comment.