Package Exports
- eslint-config-shiny-code
- eslint-config-shiny-code/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-config-shiny-code) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
✨Shiny code config
My sharable settings for Eslint and Prettier, based on the amazing work done by Wes Bos.
Version 2 of this package uses ESLint 9 and its new flat config.
Installation
- Install the package
npm install eslint-config-shiny-code- Add the scripts to package.json
"scripts": {
"lint": "eslint .",
"fix": "eslint . --fix"
},- Create a eslint.config.js (or .mjs if you don't have
"type: "module"in your package.json)
import {defineConfig} from "eslint/config";
import shinyConfig from "eslint-config-shiny-code";
export default defineConfig([
{
...shinyConfig.configs.base,
files: ["src/**/*.{ts,js,tsx}"],
ignores: ['node_modules'],
}
]);
If you want to override or extend any rules, add a new entry to the array.
- Add a tsconfig.json, this can be copied from this repository or just be an empty
{}object. - Bonus: enable automatic eslint running in the IDE for the project.
Specific configs
React
import {defineConfig} from "eslint/config";
import shinyConfig from "eslint-config-shiny-code";
export default defineConfig([
{
...shinyConfig.configs.react,
files: ["src/**/*.{ts,js,tsx}"],
ignores: ['node_modules'],
}
]);React Native
import {defineConfig} from "eslint/config";
import shinyConfig from "eslint-config-shiny-code";
export default defineConfig([
{
...shinyConfig.configs.reactNative,
files: ["src/**/*.{ts,js,tsx}"],
ignores: ['android/app/build', 'dist/*', 'expo-env.d.ts', 'node_modules', '.expo'],
}
]);