silphius/.eslintrc.cjs

79 lines
1.6 KiB
JavaScript
Raw Normal View History

2024-06-10 14:47:05 -05:00
/**
* 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: {
2024-06-10 19:35:19 -05:00
ecmaVersion: 'latest',
sourceType: 'module',
2024-06-10 14:47:05 -05:00
ecmaFeatures: {
jsx: true,
},
},
env: {
browser: true,
commonjs: true,
es6: true,
},
2024-06-12 23:17:24 -05:00
globals: {
process: false,
},
2024-06-10 19:35:19 -05:00
ignorePatterns: ['!**/.server', '!**/.client'],
2024-06-10 14:47:05 -05:00
// Base config
2024-06-10 19:35:19 -05:00
extends: ['eslint:recommended'],
2024-06-10 14:47:05 -05:00
overrides: [
2024-06-16 08:01:01 -05:00
// Tests
{
files: ['**/*.test.{js,jsx,ts,tsx}'],
rules: {
'no-empty-pattern': 'off',
},
},
2024-06-10 14:47:05 -05:00
// React
{
2024-06-10 19:35:19 -05:00
files: ['**/*.{js,jsx,ts,tsx}'],
plugins: ['react', 'jsx-a11y'],
2024-06-10 14:47:05 -05:00
extends: [
2024-06-10 19:35:19 -05:00
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/recommended',
2024-06-10 14:47:05 -05:00
],
settings: {
react: {
2024-06-10 19:35:19 -05:00
version: 'detect',
2024-06-10 14:47:05 -05:00
},
2024-06-10 19:35:19 -05:00
formComponents: ['Form'],
2024-06-10 14:47:05 -05:00
linkComponents: [
2024-06-10 19:35:19 -05:00
{ name: 'Link', linkAttribute: 'to' },
{ name: 'NavLink', linkAttribute: 'to' },
2024-06-10 14:47:05 -05:00
],
},
rules: {
2024-06-10 19:35:19 -05:00
'react/prop-types': 'off',
2024-06-10 14:47:05 -05:00
},
},
// Node
{
2024-06-12 23:17:24 -05:00
files: [
'app/websocket.js',
'.eslintrc.cjs',
'server.js',
'vite.config.js',
'public/assets/tileset.js',
],
2024-06-10 14:47:05 -05:00
env: {
node: true,
},
},
],
};