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

Use @jstnmcbrd/eslint-config #27

Merged
merged 3 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 2 additions & 65 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,66 +1,3 @@
import js from '@eslint/js';
import stylistic from '@stylistic/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
import globals from 'globals';
import eslintConfig from '@jstnmcbrd/eslint-config';

export default [
{
ignores: ['dist'],
},
{
// All JavaScript-esque files
files: ['**/*.{m,c,}{js,ts}'],
plugins: {
'@stylistic': stylistic,
},
languageOptions: {
globals: {
...globals.nodeBuiltin,
},
},
linterOptions: {
reportUnusedDisableDirectives: 'error',
},
rules: {
// Recommended
...js.configs.recommended.rules,
...stylistic.configs['recommended-flat'].rules,

// Overrides
'@stylistic/indent': ['error', 'tab'],
'@stylistic/indent-binary-ops': ['error', 'tab'],
'@stylistic/no-tabs': 0,
'@stylistic/semi': ['error', 'always'],
'@stylistic/member-delimiter-style': 'error',

// Additions
'curly': 'error',
'no-shadow': 'error',
'no-var': 'error',
'prefer-const': 'error',
},
},
{
// TypeScript files
files: ['**/*.{m,c,}ts'],
plugins: {
'@typescript-eslint': typescriptPlugin,
},
languageOptions: {
parser: typescriptParser,
parserOptions: {
project: './tsconfig.eslint.json',
},
},
rules: {
// Recommended
...typescriptPlugin.configs['strict-type-checked'].rules,
...typescriptPlugin.configs['stylistic-type-checked'].rules,

// Overrides
'no-shadow': 0, // handled by TypeScript
'no-undef': 0, // handled by TypeScript
},
},
];
export default eslintConfig({ typescript: true });
Loading
Loading