Skip to content

Commit

Permalink
Merge pull request #177 from throwaway96/misc-fixes-20240308
Browse files Browse the repository at this point in the history
Miscellaneous cleanup
  • Loading branch information
throwaway96 authored Mar 18, 2024
2 parents 3c0b043 + 045a2b4 commit f19064a
Show file tree
Hide file tree
Showing 12 changed files with 269 additions and 252 deletions.
6 changes: 5 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.js]
[*.{js,mjs,cjs,ts}]
indent_style = space
indent_size = 2
max_line_length = 140
quote_type = single

[*.py]
indent_style = space
Expand Down
5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

38 changes: 29 additions & 9 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import ts from 'typescript-eslint';

import jsoncParser from 'jsonc-eslint-parser';

import prettierPlugin from 'eslint-plugin-prettier';
import importPlugin from 'eslint-plugin-import';

import prettierConfig from 'eslint-config-prettier';
/* includes the plugin and enables the rules */
import prettierRecommendedConfig from 'eslint-plugin-prettier/recommended';

import globals from 'globals';

Expand Down Expand Up @@ -40,25 +40,33 @@ export default ts.config(
js.configs.recommended,
...ts.configs.strictTypeChecked,
...airbnbCompat,
prettierConfig,
prettierRecommendedConfig,
{
/* all JS/TS files */
files: ['**/*.{js,mjs,cjs,ts}'],
linterOptions: {
/* disable for now */
// reportUnusedDisableDirectives: 'warn',
},
plugins: {
prettier: prettierPlugin,
import: importPlugin,
},
rules: {
'prettier/prettier': ['error'],
'prettier/prettier': [
'error',
{
trailingComma: 'all',
},
],
/* allow names that start with _ to be unused */
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
/* varsIgnorePattern affects catch as well */
varsIgnorePattern: '^_',
},
],
Expand Down Expand Up @@ -115,7 +123,7 @@ export default ts.config(
},
},
{
files: ['services/**/*.{js,ts}', 'tools/*.js', 'eslint.config.{js,cjs,mjs}', 'webpack.config.js'],
files: ['services/**/*.{js,ts}', 'tools/*.js', 'eslint.config.{js,mjs,cjs}', 'webpack.config.js'],
/* all of these use node */
languageOptions: {
globals: {
Expand All @@ -140,13 +148,18 @@ export default ts.config(
},
{
files: ['tools/*.js'],
languageOptions: {
/* these scripts run during build, so they can use recent Node.js */
ecmaVersion: 'latest',
sourceType: 'script',
},
rules: {
/* not sure how to tell it these aren't modules */
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: ['*.config.{js,cjs,mjs}'],
files: ['*.config.{js,mjs,cjs}'],
rules: {
/* obviously we need dev dependencies */
'import/no-extraneous-dependencies': [
Expand All @@ -159,7 +172,7 @@ export default ts.config(
},
},
{
files: ['eslint.config.{js,cjs,mjs}'],
files: ['eslint.config.{js,mjs,cjs}'],
rules: {
/* necessary for flat config */
'import/no-default-export': 'off',
Expand All @@ -171,4 +184,11 @@ export default ts.config(
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: ['babel.config.json', 'tsconfig.json'],
rules: {
/* has various issues (e.g., forcing arrays/objects onto a single line) */
'prettier/prettier': 'off',
},
},
);
12 changes: 6 additions & 6 deletions frontend/App.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
Define your enyo/Application kind in this file.
Define your enyo/Application kind in this file.
*/

var
kind = require('enyo/kind'),
Application = require('enyo/Application'),
MainView = require('./views/MainView');
kind = require('enyo/kind'),
Application = require('enyo/Application'),
MainView = require('./views/MainView');

module.exports = kind({
kind: Application,
view: MainView
kind: Application,
view: MainView
});
6 changes: 3 additions & 3 deletions frontend/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
Instantiate your enyo/Application kind in this file. Note, application
rendering should be deferred until the DOM is ready by wrapping it in a
call to ready().
Instantiate your enyo/Application kind in this file. Note, application
rendering should be deferred until the DOM is ready by wrapping it in a
call to ready().
*/

var
Expand Down
Loading

0 comments on commit f19064a

Please sign in to comment.