silphius/.eslintrc.cjs
2024-06-17 05:20:01 -05:00

79 lines
1.6 KiB
JavaScript

/**
* This is intended to be a basic starting point for linting in your app.
* It relies on recommended configs out of the box for simplicity, but you can
* and should modify this configuration to best suit your team's needs.
*/
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
env: {
browser: true,
commonjs: true,
es6: true,
},
globals: {
process: false,
},
ignorePatterns: ['!**/.server', '!**/.client'],
// Base config
extends: ['eslint:recommended'],
overrides: [
// Tests
{
files: ['**/*.test.{js,jsx,ts,tsx}'],
rules: {
'no-empty-pattern': 'off',
},
},
// React
{
files: ['**/*.{js,jsx,ts,tsx}'],
plugins: ['react', 'jsx-a11y'],
extends: [
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/recommended',
],
settings: {
react: {
version: 'detect',
},
formComponents: ['Form'],
linkComponents: [
{ name: 'Link', linkAttribute: 'to' },
{ name: 'NavLink', linkAttribute: 'to' },
],
},
rules: {
'react/prop-types': 'off',
},
},
// Node
{
files: [
'app/websocket.js',
'.eslintrc.cjs',
'server.js',
'vite.config.js',
'public/assets/tileset.js',
],
env: {
node: true,
},
},
],
};